Hi all,

I have an xml stream with attributes which are validate with key element and
keyref element.

here is an exemple of xml stream:
<?xml version='1.0' encoding='UTF-8'?>
<root>
   <node1 personId='10'>
     <a/><b/>
   </node1>
   <node2 id='1'>
     <c/><d/>
   </node2>
   <node2 id='2'>
     <c/><d/>
   </node2>
</root>

and the keys reference in an external xmlschema:
<xs:key name="id">
 <xs:selector xpath="node2"/>
 <xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="personId" refer="id">
 <xs:selector xpath="node1"/>
 <xs:field xpath="@personId"/>
</xs:keyref>

When I validate using sax whitout namespace using
xmlReader.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation";,
xsd);
The xml is not validate by the parser and it is correct.

But when I include namespace both in XML an XMLSchema and parsing using:
xmlReader.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation";,
"http://www.namespace.com/names "+xsd);
The XML are valide !! and it is not correct
All other definition are working when I valide the XML all except key and
keyref definition.

When I validate with xmlspy it works, but I don't trust in xmlspy validate
(cf simpleType derivation)

Have you got any ideas about this, or is it a bug?

Thanks for your replies.

Bertrand Goupil




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to