Click here to Skip to main content
15,889,992 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionxml menubar Pin
paypony18-Jun-09 20:29
paypony18-Jun-09 20:29 
AnswerRe: xml menubar Pin
Stuart Dootson18-Jun-09 22:12
professionalStuart Dootson18-Jun-09 22:12 
AnswerRe: xml menubar Pin
led mike19-Jun-09 5:15
led mike19-Jun-09 5:15 
GeneralRe: xml menubar Pin
Stuart Dootson19-Jun-09 12:47
professionalStuart Dootson19-Jun-09 12:47 
QuestionUse same objects to access DB and WebService Pin
the_jat18-Jun-09 3:57
the_jat18-Jun-09 3:57 
AnswerCross Posted Pin
led mike18-Jun-09 5:19
led mike18-Jun-09 5:19 
QuestionDetect Invalid sequence of tag in XML document using schema. Pin
tprakash17-Jun-09 21:35
tprakash17-Jun-09 21:35 
AnswerRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson18-Jun-09 0:15
professionalStuart Dootson18-Jun-09 0:15 
Neither of your files should validate. I suspect your schema isn't parsing correctly, you're not checking errors and thinking that validation's happening.

Your problems?

  1. You can't use the ref attribute of the element element without using some level of XML namespaces.
  2. You've omitted the Permission elements from your sample files
  3. Your closing Permissions tags are incorrect - I'll presume that's a typo


Here's an xsd/xml pair that does cause the validation error you want (at least with libxml2):

XSD file
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
    targetNamespace="http://test-namespace.com/"
    xmlns="http://test-namespace.com/"
    xmlns:srd="http://test-namespace.com/"
    elementFormDefault="qualified" attributeFormDefault="unqualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:element name="Roles">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref ="Role"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>

   <xs:element name ="Role">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="Permissions"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>

   <xs:element name ="Permissions">
      <xs:complexType>
         <xs:sequence>
            <xs:element name ="Permission" type="xs:string" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>


</xs:schema>


XML file
<?xml version="1.0" encoding="utf-8"?>
<Roles xmlns="http://test-namespace.com/">
   <Role>
      <Permissions>
         <Permission>Reader</Permission>
      </Permissions>
   </Role>
   <Permissions>
      <Permission>Reader</Permission>
   </Permissions>
</Roles>


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

GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash18-Jun-09 18:10
tprakash18-Jun-09 18:10 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 2:18
tprakash14-Jul-09 2:18 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson14-Jul-09 2:25
professionalStuart Dootson14-Jul-09 2:25 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 22:54
tprakash14-Jul-09 22:54 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson15-Jul-09 0:27
professionalStuart Dootson15-Jul-09 0:27 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash15-Jul-09 21:35
tprakash15-Jul-09 21:35 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 23:13
tprakash14-Jul-09 23:13 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson15-Jul-09 0:42
professionalStuart Dootson15-Jul-09 0:42 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash15-Jul-09 22:28
tprakash15-Jul-09 22:28 
Question[Message Deleted] Pin
lostinxsl16-Jun-09 4:49
lostinxsl16-Jun-09 4:49 
AnswerRe: XSL: which generates Javascript Pin
led mike16-Jun-09 5:36
led mike16-Jun-09 5:36 
General[Message Deleted] Pin
lostinxsl16-Jun-09 13:45
lostinxsl16-Jun-09 13:45 
GeneralRe: XSL: which generates Javascript Pin
led mike17-Jun-09 4:29
led mike17-Jun-09 4:29 
QuestionXML Accuracy Puzzle Pin
contactowen16-Jun-09 2:40
contactowen16-Jun-09 2:40 
AnswerRe: XML Accuracy Puzzle Pin
Stuart Dootson16-Jun-09 2:54
professionalStuart Dootson16-Jun-09 2:54 
GeneralRe: XML Accuracy Puzzle Pin
contactowen16-Jun-09 4:19
contactowen16-Jun-09 4:19 
GeneralRe: XML Accuracy Puzzle Pin
Stuart Dootson16-Jun-09 5:43
professionalStuart Dootson16-Jun-09 5:43 

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.