[
https://issues.apache.org/jira/browse/XMLBEANS-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674670#action_12674670
]
Jacob Danner commented on XMLBEANS-399:
---------------------------------------
Also, you should consider just having one xsdconfig file and compiling all of
the XSDs together.
For Example:
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
<xb:namespace uri="urn:ORG:xsd:ORGHdrSrv.001.07">
<xb:package>hdrsrv.xsd</xb:package>
</xb:namespace>
</xb:config>
<xb:namespace uri="urn:ORG:xsd:ORGHdrTrt.001.07">
<xb:package>hdrtrt.xsd</xb:package>
</xb:namespace>
</xb:config>
> Getting Null while parsing with XSD
> -----------------------------------
>
> Key: XMLBEANS-399
> URL: https://issues.apache.org/jira/browse/XMLBEANS-399
> Project: XMLBeans
> Issue Type: Bug
> Affects Versions: Version 1.0.4
> Environment: Windows,Linux,Java 1.5 , xmlbeans-1.0.4
> Reporter: Guna
> Priority: Critical
> Fix For: unspecified
>
>
> Hi ,
> I'm really new to xmlbeans and I have a question. I have 3 xsd and 3
> xsdconfig files.
> {noformat}
> ORGInfoRequestMsg.00.03.04.xsd:
> ==================================
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:HTRT="urn:ORG:xsd:ORGHdrTrt.001.07"
> xmlns:HE2E="urn:ORG:xsd:ORGHdrSrv.001.07"
> xmlns="urn:ORG:xsd:ORGInfoRequestMsg.00.03.04"
> targetNamespace="urn:ORG:xsd:ORGInfoRequestMsg.00.03.04"
> elementFormDefault="qualified">
> <xs:import namespace="urn:ORG:xsd:ORGHdrTrt.001.07"
> schemaLocation="ORGHdrTrt.001.07.xsd"/>
> <xs:import namespace="urn:ORG:xsd:ORGHdrSrv.001.07"
> schemaLocation="ORGHdrSrv.001.07.xsd"/>
>
> <xs:element name="ORGInfoRequestMsg" type="ORGInfoRequestMsg.00.03.04"/>
>
> <xs:complexType name="ORGInfoRequestMsg.00.03.04">
> <xs:sequence>
> <xs:element name="ORGHdrTrt"
> type="HTRT:ORGHdrTrt.001.07"/>
> <xs:element name="ORGHdrSrv"
> type="HE2E:ORGHdrSrv.001.07"/>
> </xs:sequence>
> </xs:complexType>
> </xs:schema>
> ORGInfoRequestMsg.00.03.04.xsdconfig:
> ====================================
> <xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
> <xb:namespace uri="##any">
> <xb:package>inforeqmsg.xsd</xb:package>
> </xb:namespace>
> </xb:config>
> ORGHdrTrt.001.07.xsd :
> =====================
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="urn:ORG:xsd:ORGHdrTrt.001.07"
> xmlns="urn:ORG:xsd:ORGHdrTrt.001.07"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
>
> <xs:element name="ORGHdrTrt" type="ORGHdrTrt.001.07">
> <xs:annotation>
> <xs:documentation> Some Infor </xs:documentation>
> </xs:annotation>
> </xs:element>
>
>
> <xs:complexType name="ORGHdrTrt.001.07">
> <xs:sequence>
> <xs:element name="IdMsgTrt" type="IdMsgTrt1"/>
> </xs:sequence>
> </xs:complexType>
> <xs:simpleType name="IdMsgTrt1">
> <xs:restriction base="Max61Text">
> <xs:pattern value="[a-zA-Z0-9]{61,61}"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:schema>
> ORGHdrTrt.001.07.xsdconfig:
> ===========================
> <xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
> <xb:namespace uri="##any">
> <xb:package>hdrtrt.xsd</xb:package>
> </xb:namespace>
> </xb:config>
> ORGHdrSrv.001.07.xsd:
> ====================
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace="urn:ORG:xsd:ORGHdrSrv.001.07"
> xmlns="urn:ORG:xsd:ORGHdrSrv.001.07"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
>
> <xs:element name="ORGHdrSrv" type="ORGHdrSrv.001.07">
> <xs:annotation>
> <xs:documentation> release 6.05 </xs:documentation>
> </xs:annotation>
> </xs:element>
>
> <xs:complexType name="ORGHdrSrv.001.07">
> <xs:sequence>
> <xs:element name="IdE2EMsg" type="IdE2EMsg1"/>
> </xs:sequence>
> </xs:complexType>
> <xs:simpleType name="IdE2EMsg1">
> <xs:restriction base="Max44Text">
> <xs:pattern value="[a-zA-Z0-9]{44,44}"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:schema>
> ORGHdrSrv.001.07.xsdconfig:
> ===========================
> <xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
> <xb:namespace uri="##any">
> <xb:package>hdrsrv.xsd</xb:package>
> </xb:namespace>
> </xb:config>
> {noformat}
> Input Xml :
> ========
> {noformat}
> <?xml version="1.0" encoding="UTF-8"?>
> <ORGInfoRequestMsg xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns="urn:ORG:xsd:ORGInfoRequestMsg.00.03.05"
>
> xmlns:HTRT="urn:ORG:xsd:ORGHdrTrt.001.07"
>
> xmlns:HE2E="urn:ORG:xsd:ORGHdrSrv.001.07">
> <ORGHdrTrt><HTRT:IdMsgTrt>0000028Y0000064S000034P000000000000888888880000639PTRATTA000</HTRT:IdMsgTrt></ORGHdrTrt>
> <ORGHdrSrv><HE2E:IdE2EMsg>0000028Y0000064S0000639P00000000000088888888</HE2E:IdE2EMsg></ORGHdrSrv>
> </ORGInfoRequestMsg>
> {noformat}
> And this is my source code:
> Java Parsing Source :
> =================
> {noformat}
> import inforeqmsg.xsd.ORGInfoRequestMsg;
> //import hdrtrt.xsd.ORGHdrTrt; // Compilation error
> import inforeqmsg.xsd.ORGHdrTrt; // Note : i can able to use ORGHdrTrt from
> inforeqmsg.xsd package only
> ORGInfoRequestMsg infoRequestMsg = ORGInfoRequestMsg.Factory.parse(inputXml);
> System.out.println( " InfoRequestMsg :: " + infoRequestMsg ); //here it
> displays my input xml
> ORGHdrTrt hdrTrt = infoRequestMsg.getOrgHdrTrt();
> System.out.println( " hdrTrt :: " + hdrTrt ); //it displays NULL.
> {noformat}
> I am using AntTask to create the following jars.
> 1.ORGHdrTrt.jar ( generated source has classes/interfaces mapped to
> ORGHdrTrt.001.07.xsd elements/attributes )
> 2.ORGHdrSrv.jar ( generated source has classes/interfaces mapped to
> ORGHdrSrv.001.07.xsd elements/attributes )
> 3.ORGInfoRequestMsg.jar ( generated source has classes/interfaces mapped to
> ORGInfoRequestMsg.001.07.xsd elements/attributes
> + generated source has
> classes/interfaces mapped to ORGHdrTrt.001.07.xsd elements/attributes
> + generated source has
> classes/interfaces mapped to ORGHdrSrv.001.07.xsd elements/attributes )
> i.e..ORGInfoRequestMsg.jar didnt refer the ORGHdrTrt.jar and ORGHdrSrv.jar
> sources, but it has created its own sources again.
> But SchemaType ORGHdrTrt hdrTrt is just return null ?
> Can anyone please help what is wrong and give me better solution to the
> problem
> Note : I can able to change only the xsdconfig and java source.And I can't
> change XSD and XML because that is given to me.
>
> Any help is greatly appreciated..
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]