Click here to Skip to main content
14,663,929 members
Home » Discussions » XML / XSL
   

XML / XSL

 
AnswerRe: Space in attribute name Pin
tassilo10-Nov-09 23:06
Membertassilo10-Nov-09 23:06 
QuestionHow can I traverse and read values in an XML using VBScript? Pin
Curtis Rowell6-Nov-09 1:03
MemberCurtis 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
Membermd_refay4-Nov-09 4:19 
AnswerRe: Xml File Problems Pin
The Man from U.N.C.L.E.11-Nov-09 11:45
MemberThe Man from U.N.C.L.E.11-Nov-09 11:45 
QuestionXSD Unique Implementation and XPath Pin
Skippums2-Nov-09 12:33
MemberSkippums2-Nov-09 12:33 
AnswerRe: XSD Unique Implementation and XPath Pin
Christian Graus3-Nov-09 11:27
mveChristian 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
MemberSkippums4-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
MemberSoundman32.22-Nov-09 1:28 
AnswerRe: Sorted xml element while serialising Pin
Soundman32.22-Nov-09 3:58
MemberSoundman32.22-Nov-09 3:58 
Questionattribute centric Pin
Michael A. Klausmeyer1-Nov-09 8:27
MemberMichael A. Klausmeyer1-Nov-09 8:27 
QuestionHow to Password Protect a XML SpreadSheet Pin
ANSHUMAN44429-Oct-09 5:14
MemberANSHUMAN44429-Oct-09 5:14 
AnswerRe: How to Password Protect a XML SpreadSheet Pin
Christian Graus1-Nov-09 9:30
mveChristian Graus1-Nov-09 9:30 
QuestionC# XML datagridview delete row Pin
Wheels01227-Oct-09 3:38
MemberWheels01227-Oct-09 3:38 
QuestionC# Append XML File Pin
Wheels01223-Oct-09 5:42
MemberWheels01223-Oct-09 5:42 
AnswerRe: C# Append XML File Pin
Christian Graus23-Oct-09 10:35
mveChristian Graus23-Oct-09 10:35 
GeneralRe: C# Append XML File Pin
Wheels01226-Oct-09 1:24
MemberWheels01226-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
MemberONeil 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
mveChristian Graus23-Oct-09 10:44 
QuestionXSL group [modified] Pin
Clas Andersson22-Oct-09 21:26
MemberClas Andersson22-Oct-09 21:26 
AnswerRe: XSL group Pin
tassilo10-Nov-09 23:02
Membertassilo10-Nov-09 23:02 
Questionhow to write to xml file! [modified] Pin
live4u19-Oct-09 2:04
Memberlive4u19-Oct-09 2:04 
AnswerRe: how to write to xml file! Pin
Christian Graus22-Oct-09 18:30
mveChristian Graus22-Oct-09 18:30 

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.