[ http://issues.apache.org/jira/browse/XMLBEANS-190?page=all ]
daryoush mehrtash updated XMLBEANS-190:
---------------------------------------
Attachment: CopyTest.java
> Namespaces in QName is not preserved after copy of the XMLBeans from one tree
> to anoter.
> ----------------------------------------------------------------------------------------
>
> Key: XMLBEANS-190
> URL: http://issues.apache.org/jira/browse/XMLBEANS-190
> Project: XMLBeans
> Type: Bug
> Versions: Version 2.1
> Reporter: daryoush mehrtash
> Attachments: CopyTest.java
>
> I parse a schema file to XMLBeans, the schema defines the "impl" namespace.
> I then parse another document, which is also a schema file that uses "impl"
> namespace but is set to a different namespace than the orignial schema.
> WHen I copy the XMLObjects from one schema to the other, the QNames of the
> schema objects are not updated to reflect the new namespaces.
> I have attached a simple program to reproduce the problem. Notice that the
> Person element in the "s2" uses <xsd:element name=\"addr\"
> type=\"impl:Address\"/> after it is copied to the "s1" i expect the "impl"
> be changed to "tns1" but it remains "impl" which is not the correct
> namespace in the target schema.
> The output of my attached code is:
> After add the schema: <xsd:schema elementFormDefault="qualified"
> targetNamespace="http://byXmlBeanNS"
> xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://web"
> xmlns:intf="http://web" xmlns:tns1="http://byXmlBeanNS"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <xsd:element name="Person">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="addr" type="impl:Address"/>
> <---------------------
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> But I expected
> After add the schema: <xsd:schema elementFormDefault="qualified"
> targetNamespace="http://byXmlBeanNS"
> xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://web"
> xmlns:intf="http://web" xmlns:tns1="http://byXmlBeanNS"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <xsd:element name="Person">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="addr" type="tns1:Address"/>
> <------------------
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]