> Hi Dave,
>
> I have multiple xml schema files which one refer to another and I want to
> create a single data structure to access data from the xml files. I used
> visual studio to create schema files given an xml file. Visual studio
> generate 2 schema files as given below. Can you tell me if your tool can
> help me with this problem? Your code is successfully working if I have
> single schema file.
Deepak,
Good to hear from you.
You need to fill in an xs:import or xs:include element to refer to
the other schema document. There is a difference between the way
xs:import and xs:include handle namespaces. I believe that in your
case either will work.
I made that modification to your schema files. The modified
versions are attached.
Then, I generated data bindings (Python code) with the following
command line:
$ generateDS.py -o outsuper.py -s outsub.py --super outsuper schema01.xsd
Note that the "-s" and "" are not necessary unless you need to
generate Python subclasses to work with. That can be handy when you
want to generate a single library (with "-o") and want to add code
for different purposes in subclasses (generated with "-s").
Hope this helps. Let me know whether that works for you.
Dave
--
Dave Kuhlman
http://www.davekuhlman.org
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:XXXX="XXXX"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="XXXX" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
<xs:import schemaLocation="schema02.xsd"/>
-->
<xs:include schemaLocation="schema02.xsd"/>
<xs:element name="hudatWelds">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="hudatWeld" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="hudatWeld">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="componentClass" type="xs:string" />
<xs:element name="UUID" type="xs:string" />
<xs:element name="instanceID" type="xs:string" />
<xs:element name="jointType" type="xs:string" />
<xs:element name="grooveConfiguration" type="xs:string" />
<xs:element name="weldJointConfiguration" type="xs:string" />
<xs:element name="weldPenetration" type="xs:string" />
<xs:element name="doubleSided" type="xs:boolean" />
<xs:element name="materialWeldCompatible" type="xs:boolean" />
<xs:element name="weldProcess" type="xs:string" />
<xs:element name="inspectionReqt" type="xs:string" />
<xs:element name="weldLength">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedShort">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="jointStrengthReqt">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedShort">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="jointElongationReqt" type="xs:unsignedByte" />
<xs:element name="fillerMaterialSpec" type="xs:string" />
<xs:element name="weldSide1">
<xs:complexType>
<xs:sequence>
<xs:element name="incAngle">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="leg1Length">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="leg2Length">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="weldArea">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="weldVolume">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedInt">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="weldSide2">
<xs:complexType>
<xs:sequence>
<xs:element name="incAngle">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedByte">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="leg1Length">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="leg2Length">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="weldArea">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="weldVolume">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedInt">
<xs:attribute name="unit" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="part1">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:string" />
<xs:element name="stockNumber" type="xs:string" />
<xs:element name="creoName" type="xs:string" />
<xs:element name="stepName" type="xs:string" />
<xs:element name="thickness" type="xs:decimal" />
<xs:element name="material">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="part2">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:string" />
<xs:element name="stockNumber" type="xs:string" />
<xs:element name="creoName" type="xs:string" />
<xs:element name="stepName" type="xs:string" />
<xs:element name="thickness" type="xs:decimal" />
<xs:element name="material">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="id" type="xs:string"
use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users