Click here to Skip to main content
15,892,537 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionXQuery / multiple conditions Pin
pedefetoll15-Nov-09 23:19
pedefetoll15-Nov-09 23:19 
QuestionXml to RDBMS table data transgformation Pin
rishi saraf13-Nov-09 1:53
rishi saraf13-Nov-09 1:53 
QuestionSpace in attribute name Pin
Anir19829-Nov-09 20:59
Anir19829-Nov-09 20:59 
AnswerRe: Space in attribute name Pin
Stuart Dootson9-Nov-09 23:01
professionalStuart Dootson9-Nov-09 23:01 
AnswerRe: Space in attribute name Pin
tassilo10-Nov-09 23:06
tassilo10-Nov-09 23:06 
QuestionHow can I traverse and read values in an XML using VBScript? Pin
Curtis Rowell6-Nov-09 1:03
Curtis Rowell6-Nov-09 1:03 
AnswerRe: How can I traverse and read values in an XML using VBScript? Pin
Stuart Dootson9-Nov-09 4:08
professionalStuart Dootson9-Nov-09 4:08 
QuestionXml File Problems Pin
md_refay4-Nov-09 4:19
md_refay4-Nov-09 4:19 
AnswerRe: Xml File Problems Pin
The Man from U.N.C.L.E.11-Nov-09 11:45
The Man from U.N.C.L.E.11-Nov-09 11:45 
QuestionXSD Unique Implementation and XPath Pin
Skippums2-Nov-09 12:33
Skippums2-Nov-09 12:33 
AnswerRe: XSD Unique Implementation and XPath Pin
Christian Graus3-Nov-09 11:27
protectorChristian Graus3-Nov-09 11:27 
AnswerRe: XSD Unique Implementation and XPath Pin
Stuart Dootson3-Nov-09 22:54
professionalStuart Dootson3-Nov-09 22:54 
The Essential XML Quick Reference[^] is an excellent (and free) XML (+ XSD + XPath + XSLT) reference.

On page 349, it defines the available XPath selectors (I'd copy them here, but it disallows copying - grrrr).

However, I don't think you can do what you want with the 'unique' relation. The correctness 'uniqueness' set would be '..|.' using the Child element as the context node. But you can't do that with XML Schemas.

Using the Parent as context node, there's no way to define the uniqueness set, I don't think, as there are n sets, where n==number of Child nodes.

However - using Schematron[^], you can validate this rule using this Schema:

<schema xmlns="http://www.ascc.net/xml/schematron" > 
     <pattern name="Check CHild/Parent keys"> 
          <rule context="Child"> 
               <assert test="@key!=../@key">Child key should differ from Parent key.</assert> 
               <report test="@name">Child key should differ from Parent key.</report> 
          </rule> 
     </pattern> 
</schema>


This should be used in addition to a schema describing the basic structure of the XML. Using xmllint (which comes with libxml2), I can confirm that this Schematron schema meets your requirements.

XML files can be validated against Schematron schemas using an XSLT processor, so even if your XML parser doesn't have Schematron support, you can still use Schematron.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: XSD Unique Implementation and XPath Pin
Skippums4-Nov-09 2:28
Skippums4-Nov-09 2:28 
GeneralRe: XSD Unique Implementation and XPath Pin
Stuart Dootson4-Nov-09 2:52
professionalStuart Dootson4-Nov-09 2:52 
QuestionSorted xml element while serialising Pin
Soundman32.22-Nov-09 1:28
Soundman32.22-Nov-09 1:28 
AnswerRe: Sorted xml element while serialising Pin
Soundman32.22-Nov-09 3:58
Soundman32.22-Nov-09 3:58 
Questionattribute centric Pin
Michael A. Klausmeyer1-Nov-09 8:27
Michael A. Klausmeyer1-Nov-09 8:27 
QuestionHow to Password Protect a XML SpreadSheet Pin
ANSHUMAN44429-Oct-09 5:14
ANSHUMAN44429-Oct-09 5:14 
AnswerRe: How to Password Protect a XML SpreadSheet Pin
Christian Graus1-Nov-09 9:30
protectorChristian Graus1-Nov-09 9:30 
QuestionC# XML datagridview delete row Pin
Wheels01227-Oct-09 3:38
Wheels01227-Oct-09 3:38 
QuestionC# Append XML File Pin
Wheels01223-Oct-09 5:42
Wheels01223-Oct-09 5:42 
AnswerRe: C# Append XML File Pin
Christian Graus23-Oct-09 10:35
protectorChristian Graus23-Oct-09 10:35 
GeneralRe: C# Append XML File Pin
Wheels01226-Oct-09 1:24
Wheels01226-Oct-09 1:24 
QuestionIs it possible to call a comand line program from within an Xml File Preprocessor Pin
ONeil Tomlinson23-Oct-09 1:09
ONeil Tomlinson23-Oct-09 1:09 
AnswerRe: Is it possible to call a comand line program from within an Xml File Preprocessor Pin
Christian Graus23-Oct-09 10:44
protectorChristian Graus23-Oct-09 10:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.