[xsd-users] Multiple XML files with identical element names

Thomas Walter thomas.walter at de.gm.com
Wed Apr 30 03:44:24 EDT 2008


Hello,

I want to parse multiple independent XML files using XSD. When I generate 
the object model of either XSD file I will later on get linker errors of 
duplicated objects. The issue is that the schemas use some same names for 
certain elements, e.g. each schema file includes a definition for revision 
log. This results in duplicated functions/objects. Is there a way to let 
the xsd compiler know to use a certain prefix for the generated code for 
one schema, a certain option?

Here is an extract that is identical in either schema file:

    <!--  -->
    <xs:complexType name="RevisionLogEntryType">
        <xs:sequence>
            <xs:element name="RevisionVersion" type="VersionType"/>
            <xs:element name="RevisionDate" type="xs:date"/>
            <xs:element name="RevisionDescription" type="xs:string"/>
            <xs:element name="RevisionAuthor" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <!--  -->
    <xs:complexType name="RevisionLogType">
        <xs:sequence>
            <xs:element name="RevisionLogEntry" 
type="RevisionLogEntryType" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!--  -->

Thanks a lot in advance,
Thomas



More information about the xsd-users mailing list