Java Technology & XML - Trouble Using Netbeans and XML Schema

I am currently experimenting on using XML files to store data for a game that I am developing. I had been using NetBeans 5.5 to validate my XML Schema (I am still new to XSD); however, now I am getting errors and have been trying for the better part of the week but am still unable to resolve them. Here is a clip from one of the schemas:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:cdt="http://JoaL.blissfulTragedy.com/Characters"

targetNamespace="http://JoaL.blissfulTragedy.com/Characters" >

<!-- Document to Define Character Attributes and their current Constraints -->

<!-- Character Name -->

<xs:simpleType name="name">

<xs:restriction base="xs:NMTOKEN">

<xs:maxLength value="15"/>

</xs:restriction>

</xs:simpleType>

...

When I validate the XML (the two down arrows) I get the following errors for every restriction I have declared:

s4s-att-invalid-value: Invalid attribute valuefor'base' in element'restriction'. Recorded reason: UndeclaredPrefix: Cannot resolve'xs:NMTOKEN' as a QName: the prefix'xs' is not declared.

After retyping the file three times I tried one of the stock NetBeans schemas, which will produce the same error whenever I add a restriction through the UI.

Any advice will be greatly appreciated :P

[2066 byte] By [shdwFxa] at [2007-11-26 23:32:53]
# 1

I think this is a dirty great bug in the Sun version of the apache Xerces classes that were bundled with jdk1.5.

I've had similar problems, and it seems to boil down to the fact that the NamespaceSupport class's getURI method does == instead of .equals when looking up the uri for a particular prefix. I'm told that this is a deliberate feature for the Apache stuff, and that the class assumes interned strings or strings that have gone through their internal SymbolTable mechanism, and that I can work around it by using interned strings. However, it is one of their classes that fails to intern the string (or put it through the symbol table etc.), so that doesn't really make sense as there are no hooks into this stuff.

They have even marked the bug as closed/fixed, and I'm attempting to re-raise it at present (so it'll be fixed in about ten years then).

dufthera at 2007-7-10 14:45:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
See Sun Java bug 6337180
dufthera at 2007-7-10 14:45:42 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...