DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11152>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11152 Xerces treats location path "//" in xpath attribute of xs:selector element of xs:key element as if it were "/" Summary: Xerces treats location path "//" in xpath attribute of xs:selector element of xs:key element as if it were "/" Product: Xerces2-J Version: 2.0.0 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: XML Schema Structures AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Hi I'm using the following XML file: -------- start xml <?xml version="1.0" encoding="UTF-8"?> <filebase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="bug.xsd"> <categories> <category description="help me!" id="0015"> <category description="I am drowning" id="0015"> <category description="You are drowning" id="0005"> <category description="XML is drowning me!" id="0003"> <category description="XML is good" id="0002"> <category description="XML is bad" id="0006"/> </category> </category> </category> </category> </category> <category description="help me again!" id="0015"/> </categories> </filebase> -------- end xml and the following xsd (bug.xsd): -------- start xsd <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="category"> <xs:complexType> <xs:sequence minOccurs="0"> <xs:element ref="category"/> </xs:sequence> <xs:attribute name="id" type="xs:string"/> <xs:attribute name="description" type="xs:string"/> </xs:complexType> </xs:element> <xs:element name="filebase"> <xs:complexType> <xs:sequence> <xs:element name="categories"> <xs:complexType> <xs:sequence maxOccurs="unbounded"> <xs:element ref="category"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:key name="categoryId"> <xs:selector xpath=".//category"/> <xs:field xpath="@id"/> </xs:key> </xs:element> </xs:schema> -------- end xsd And I'm using the following parser options: -------- start parserOptions parser.setFeature("http://xml.org/sax/features/namespaces", true); parser.setFeature("http://xml.org/sax/features/validation", true); parser.setFeature("http://apache.org/xml/features/validation/schema", true); parser.setFeature ("http://apache.org/xml/features/validation/schema/normalized-value",true); -------- end parserOptions and there are two bugs as I see it: 1) The first feature (namespaces) should be set to true by default according to the docs (features), but it's false. 2) More interesting: there are TWO repeated IDs in the XML snippet above, but Xerces only finds one (see the xs:key in the XSD snippet above). I've replicated this problem a lot and it seems it can't handle the "//" (/descendant- or- self:: node()) location path. I hope this is a real bug and can be fixed. I'm not expert enough to know if the "//" is legal, but XML Spy seems to think so (which doesn't help). Thanks, Daniel P.S. Feel free to send me comments by e-mail about this potential bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
