You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Khaled Noaman (JIRA)" <xe...@xml.apache.org> on 2010/04/15 19:47:51 UTC

[jira] Resolved: (XERCESJ-1442) XML Schema 1.1: Defect when compare two target namespaces

     [ https://issues.apache.org/jira/browse/XERCESJ-1442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Khaled Noaman resolved XERCESJ-1442.
------------------------------------

    Fix Version/s: 2.10.0
       Resolution: Fixed

Fixed. Xerce-J uses unique symbol ids, so == should be enough. The problem was that the value of the targetNamespaceAttribute was not assigned the unique id from the symbol table.

> 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
>             Fix For: 2.10.0
>
>         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-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org