The types I'm using id xs:ID and xs:IDREF. And yes, I'm getting the error if I change the root element. I'm absolutely sure that the validation of XMLSpy is right and validateSchema is wrong. I can't find any option for enable/disable id/idref checking for Domdocument's validateSchema().
Main Topics
Browse All Topics





by: GertonePosted on 2009-10-26 at 06:26:25ID: 25661981
That largely depends on the schema or DTD that you use to validate this
and that you don't show
Usually if I see different behaviour between XML Spy and any other application, I know that XML Spy is wrong.
But you might have even hit a worse parser.
If the type of the "id" attribute is xs:ID (or xs:key)
and the type of the idref attribute is xs:IDREF, xs:IDREFS, or xs:keyref
and the reference to the schema is right, than XML Spy is right.
But I am afraid that the likely cause of confusion is then in you not referencing the schema right
Would it give you an error if you made a more obvious error eg. <rot> instead of <root>. CAn you check that?
Also note that some XML parsers allow you to switch off id/idref checking. Make sure that your parser does not have such a switch, turned off by default