[ https://issues.apache.org/jira/browse/XERCESJ-1442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kun Xu updated XERCESJ-1442: ---------------------------- Attachment: XSDElementTraverser_patch.txt > XML Schema 1.1: Defect when compare two target namespaces > --------------------------------------------------------- > > Key: XERCESJ-1442 > URL: https://issues.apache.org/jira/browse/XERCESJ-1442 > Project: Xerces2-J > Issue Type: Bug > Components: XML Schema 1.1 Structures > Affects Versions: 2.9.1 > Reporter: Kun Xu > Priority: Trivial > Attachments: XSDElementTraverser_patch.txt > > > When we compare two target namespaces in the following schema file, parser > reports an unexpected error "Since element 'element1' contains the > targetNamespace attribute and does not have a targetNamespace attribute or > its value is different from the value of targetNamespace of 'element1', > there.....", which contradicts the fact (element and schema have the same > target namespace). > XSD: > <?xml version="1.0"?> > <schema xmlns="http://www.w3.org/2001/XMLSchema" > xmlns:tns="http://www.schemaTest.org/schema11_S3_2_3" > targetNamespace="http://www.schemaTest.org/schema11_S3_2_3" > > elementFormDefault="unqualified" > attributeFormDefault="qualified"> > <complexType name="type1"> > <sequence> > <element name="element1" type="integer" > targetNamespace="http://www.schemaTest.org/schema11_S3_2_3"/> > <element name="element2" type="integer"/> > </sequence> > </complexType> > <element name="root" type="tns:type1"/> > </schema> > Reason: > We use "!=" to compare two strings but they are two different objects, > therefore the result will be false even they have the same value. > Suggestion: > simply change "!=" to "!equals()". Thanks. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: j-dev-h...@xerces.apache.org