Page 1 of 1

Multiple xs:ID's in one schema?

Posted: Thu Feb 10, 2005 1:05 am
by Vosper
I am writing some software to help me navigate my mp3 collection. I have designed a Schema for it, which is basically like this:

Code: Select all

<artist id="">
<album id="">
<song id="">Blah blah</song>
</album>
</artist>
Can I use multiple ID's like this? The schema validates in Oxygen but when I use getElementByID it returns null, even though the ID's match.

Posted: Thu Feb 10, 2005 1:32 am
by Vosper
Duh. When creating the new XML Document I had forget to the make the DocumentBuilderFactory aware of the Schema - so it was returning null because it didn't know which elements were of type "xs:ID"

I'm downloading J2SE 5 now because it seems to have better Schema integration :)