Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem following import #23

Closed
dbolene opened this issue Jan 11, 2011 · 8 comments
Closed

problem following import #23

dbolene opened this issue Jan 11, 2011 · 8 comments
Labels

Comments

@dbolene
Copy link

dbolene commented Jan 11, 2011

running

$ scalaxb epcglobal_1_0.xsd -p test

yields:

java.lang.RuntimeException: resolveType type not found: epcglobal:EPC ReferenceTypeSymbol(epcglobal:EPC,null)
    at scala.Predef$.error(Predef.scala:58)
    at scalaxb.compiler.xsd.ContextProcessor$class.resolveTypeSymbol$1(ContextProcessor.scala:195)
    at scalaxb.compiler.xsd.ContextProcessor$$anonfun$resolveType$1.apply(ContextProcessor.scala:201)
    at scalaxb.compiler.xsd.ContextProcessor$$anonfun$resolveType$1.apply(ContextProcessor.scala:201)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scalaxb.compiler.xsd.ContextProcessor$class.resolveType(ContextProcessor.scala:201)
    at scalaxb.compiler.xsd.Driver$$anon$3.resolveType(Driver.scala:40)
    at scalaxb.compiler.xsd.ContextProcessor$$anonfun$processContext$2.apply(ContextProcessor.scala:71)
    at scalaxb.compiler.xsd.ContextProcessor$$anonfun$processContext$2.apply(ContextProcessor.scala:68)
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
    at scala.collection.immutable.List.foreach(List.scala:45)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:44)
    at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42)
    at scalaxb.compiler.xsd.ContextProcessor$class.processContext(ContextProcessor.scala:68)
    at scalaxb.compiler.xsd.Driver$$anon$3.processContext(Driver.scala:40)
    at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:43)
    at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:33)
    at scalaxb.compiler.Module$class.processReaders(Module.scala:123)
    at scalaxb.compiler.xsd.Driver.processReaders(Driver.scala:33)
    at scalaxb.compiler.Module$class.processFiles(Module.scala:75)
    at scalaxb.compiler.xsd.Driver.processFiles(Driver.scala:33)
    at scalaxb.compiler.Main$.start(Main.scala:84)
    at scalaxb.compiler.Main$.main(Main.scala:32)
    at scalaxb.compiler.Main.main(Main.scala)

with the following two files:

epcglobal_1_0.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:sbdh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:epcglobal="urn:epcglobal:xsd:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:epcglobal:epcis:xsd:1" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.0">
    <xsd:annotation>
        <xsd:documentation xml:lang="en">
            <epcglobal:copyright>Copyright (C) 2006, 2005, 2004 EPCglobal Inc., All Rights Reserved.</epcglobal:copyright>
            <epcglobal:disclaimer>EPCglobal Inc., its members, officers, directors, employees, or agents shall not be liable for any injury, loss, damages, financial or otherwise, arising from, related to, or caused by the use of this document.  The use of said document shall constitute your express consent to the foregoing exculpation.</epcglobal:disclaimer>
            <epcglobal:specification>EPC INFORMATION SERVICE (EPCIS) Version 1.0</epcglobal:specification>
        </xsd:documentation>
    </xsd:annotation>
    <xsd:import namespace="urn:epcglobal:xsd:1" schemaLocation="./EPCglobal.xsd"/>
    <xsd:import namespace="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" schemaLocation="./StandardBusinessDocumentHeader.xsd"/>
    <!-- EPCIS CORE ELEMENTS -->
    <xsd:element name="EPCISDocument" type="epcis:EPCISDocumentType"/>
    <xsd:complexType name="EPCISDocumentType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            document that contains a Header and a Body.
                </xsd:documentation>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="epcglobal:Document">
                <xsd:sequence>
                    <xsd:element name="EPCISHeader" type="epcis:EPCISHeaderType" minOccurs="0"/>
                    <xsd:element name="EPCISBody" type="epcis:EPCISBodyType"/>
                    <xsd:element name="extension" type="epcis:EPCISDocumentExtensionType" minOccurs="0"/>
                    <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:anyAttribute processContents="lax"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="EPCISHeaderType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            specific header(s) including the Standard Business Document Header.
                </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element ref="sbdh:StandardBusinessDocumentHeader"/>
            <xsd:element name="extension" type="epcis:EPCISHeaderExtensionType" minOccurs="0"/>
            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="EPCISBodyType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            specific body that contains EPCIS related Events.
                </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="EventList" type="epcis:EventListType" minOccurs="0"/>
            <xsd:element name="extension" type="epcis:EPCISBodyExtensionType" minOccurs="0"/>
            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <!-- EPCIS CORE ELEMENT TYPES -->
    <xsd:complexType name="EventListType">
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name="ObjectEvent" type="epcis:ObjectEventType" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="AggregationEvent" type="epcis:AggregationEventType" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="QuantityEvent" type="epcis:QuantityEventType" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="TransactionEvent" type="epcis:TransactionEventType" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="extension" type="epcis:EPCISEventListExtensionType"/>
            <xsd:any namespace="##other" processContents="lax"/>
        </xsd:choice>
        <!-- Note: the use of "unbounded" in both the xsd:choice element
                    and the enclosed xsd:element elements is, strictly speaking,
                    redundant. However, this was found to avoid problems with
                    certain XML processing tools, and so is retained here.
                -->
    </xsd:complexType>
    <xsd:complexType name="EPCListType">
        <xsd:sequence>
            <xsd:element name="epc" type="epcglobal:EPC" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="ActionType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="ADD"/>
            <xsd:enumeration value="OBSERVE"/>
            <xsd:enumeration value="DELETE"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="ParentIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <!-- Standard Vocabulary -->
    <xsd:simpleType name="BusinessStepIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <!-- Standard Vocabulary -->
    <xsd:simpleType name="DispositionIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <!-- User Vocabulary -->
    <xsd:simpleType name="EPCClassType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <!-- User Vocabulary -->
    <xsd:simpleType name="ReadPointIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <xsd:complexType name="ReadPointType">
        <xsd:sequence>
            <xsd:element name="id" type="epcis:ReadPointIDType"/>
            <xsd:element name="extension" type="epcis:ReadPointExtensionType" minOccurs="0"/>
            <!-- The wildcard below provides the extension mechanism described in Section 9.4 -->
            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ReadPointExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <!-- User Vocabulary -->
    <xsd:simpleType name="BusinessLocationIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <xsd:complexType name="BusinessLocationType">
        <xsd:sequence>
            <xsd:element name="id" type="epcis:BusinessLocationIDType"/>
            <xsd:element name="extension" type="epcis:BusinessLocationExtensionType" minOccurs="0"/>
            <!-- The wildcard below provides the extension mechanism described in Section 9.4 -->
            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BusinessLocationExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <!-- User Vocabulary -->
    <xsd:simpleType name="BusinessTransactionIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <!-- Standard Vocabulary -->
    <xsd:simpleType name="BusinessTransactionTypeIDType">
        <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <xsd:complexType name="BusinessTransactionType">
        <xsd:simpleContent>
            <xsd:extension base="epcis:BusinessTransactionIDType">
                <xsd:attribute name="type" type="epcis:BusinessTransactionTypeIDType" use="optional"/>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>
    <xsd:complexType name="BusinessTransactionListType">
        <xsd:sequence>
            <xsd:element name="bizTransaction" type="epcis:BusinessTransactionType" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <!-- items listed alphabetically by name -->
    <!-- Some element types accommodate extensibility in the manner of
        "Versioning XML Vocabularies" by David Orchard (see
        http://www.xml.com/pub/a/2003/12/03/versioning.html).

        In this approach, an optional <extension> element is defined
        for each extensible element type, where an <extension> element
        may contain future elements defined in the target namespace.

        In addition to the optional <extension> element, extensible element
        types are declared with a final xsd:any wildcard to accommodate
        future elements defined by third parties (as denoted by the ##other
        namespace).

        Finally, the xsd:anyAttribute facility is used to allow arbitrary
        attributes to be added to extensible element types. -->
    <xsd:complexType name="EPCISEventType" abstract="true">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            base type for all EPCIS events.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="eventTime" type="xsd:dateTime"/>
            <xsd:element name="recordTime" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="eventTimeZoneOffset" type="xsd:string"/>
            <xsd:element name="baseExtension" type="epcis:EPCISEventExtensionType" minOccurs="0"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="ObjectEventType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            Object Event captures information about an event pertaining to one or more
            objects identified by EPCs.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="epcis:EPCISEventType">
                <xsd:sequence>
                    <xsd:element name="epcList" type="epcis:EPCListType"/>
                    <xsd:element name="action" type="epcis:ActionType"/>
                    <xsd:element name="bizStep" type="epcis:BusinessStepIDType" minOccurs="0"/>
                    <xsd:element name="disposition" type="epcis:DispositionIDType" minOccurs="0"/>
                    <xsd:element name="readPoint" type="epcis:ReadPointType" minOccurs="0"/>
                    <xsd:element name="bizLocation" type="epcis:BusinessLocationType" minOccurs="0"/>
                    <xsd:element name="bizTransactionList" type="epcis:BusinessTransactionListType" minOccurs="0"/>
                    <xsd:element name="extension" type="epcis:ObjectEventExtensionType" minOccurs="0"/>
                    <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:anyAttribute processContents="lax"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="AggregationEventType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            Aggregation Event captures an event that applies to objects that
            have a physical association with one another.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="epcis:EPCISEventType">
                <xsd:sequence>
                    <xsd:element name="parentID" type="epcis:ParentIDType" minOccurs="0"/>
                    <xsd:element name="childEPCs" type="epcis:EPCListType"/>
                    <xsd:element name="action" type="epcis:ActionType"/>
                    <xsd:element name="bizStep" type="epcis:BusinessStepIDType" minOccurs="0"/>
                    <xsd:element name="disposition" type="epcis:DispositionIDType" minOccurs="0"/>
                    <xsd:element name="readPoint" type="epcis:ReadPointType" minOccurs="0"/>
                    <xsd:element name="bizLocation" type="epcis:BusinessLocationType" minOccurs="0"/>
                    <xsd:element name="bizTransactionList" type="epcis:BusinessTransactionListType" minOccurs="0"/>
                    <xsd:element name="extension" type="epcis:AggregationEventExtensionType" minOccurs="0"/>
                    <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:anyAttribute processContents="lax"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="QuantityEventType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            Quantity Event captures an event that takes place with respect to a specified quantity of
            object class.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="epcis:EPCISEventType">
                <xsd:sequence>
                    <xsd:element name="epcClass" type="epcis:EPCClassType"/>
                    <xsd:element name="quantity" type="xsd:int"/>
                    <xsd:element name="bizStep" type="epcis:BusinessStepIDType" minOccurs="0"/>
                    <xsd:element name="disposition" type="epcis:DispositionIDType" minOccurs="0"/>
                    <xsd:element name="readPoint" type="epcis:ReadPointType" minOccurs="0"/>
                    <xsd:element name="bizLocation" type="epcis:BusinessLocationType" minOccurs="0"/>
                    <xsd:element name="bizTransactionList" type="epcis:BusinessTransactionListType" minOccurs="0"/>
                    <xsd:element name="extension" type="epcis:QuantityEventExtensionType" minOccurs="0"/>
                    <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:anyAttribute processContents="lax"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="TransactionEventType">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
            Transaction Event describes the association or disassociation of physical objects to one or more business
            transactions.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:complexContent>
            <xsd:extension base="epcis:EPCISEventType">
                <xsd:sequence>
                    <xsd:element name="bizTransactionList" type="epcis:BusinessTransactionListType"/>
                    <xsd:element name="parentID" type="epcis:ParentIDType" minOccurs="0"/>
                    <xsd:element name="epcList" type="epcis:EPCListType"/>
                    <xsd:element name="action" type="epcis:ActionType"/>
                    <xsd:element name="bizStep" type="epcis:BusinessStepIDType" minOccurs="0"/>
                    <xsd:element name="disposition" type="epcis:DispositionIDType" minOccurs="0"/>
                    <xsd:element name="readPoint" type="epcis:ReadPointType" minOccurs="0"/>
                    <xsd:element name="bizLocation" type="epcis:BusinessLocationType" minOccurs="0"/>
                    <xsd:element name="extension" type="epcis:TransactionEventExtensionType" minOccurs="0"/>
                    <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:anyAttribute processContents="lax"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="EPCISDocumentExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="EPCISHeaderExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="EPCISBodyExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="EPCISEventListExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="EPCISEventExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="ObjectEventExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="AggregationEventExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="QuantityEventExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
    <xsd:complexType name="TransactionEventExtensionType">
        <xsd:sequence>
            <xsd:any namespace="##local" processContents="lax" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute processContents="lax"/>
    </xsd:complexType>
</xsd:schema>

and EPCglobal.xsd:

<xsd:schema xmlns:epcglobal="urn:epcglobal:xsd:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:epcglobal:xsd:1" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.0">
    <xsd:annotation>
        <xsd:documentation>
            <epcglobal:copyright>Copyright (C) 2004 Epcglobal Inc., All Rights Reserved.</epcglobal:copyright>
            <epcglobal:disclaimer>EPCglobal Inc., its members, officers, directors, employees, or agents shall not be liable for any injury, loss, damages, financial or otherwise, arising from, related to, or caused by the use of this document.  The use of said document shall constitute your express consent to the foregoing exculpation.</epcglobal:disclaimer>
            <epcglobal:specification>EPCglobal common components Version 1.0</epcglobal:specification>
        </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType name="Document" abstract="true">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
         EPCglobal document properties for all messages.
      </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="schemaVersion" type="xsd:decimal" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="en">
           The version of the schema corresponding to which the instance conforms. 
        </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="creationDate" type="xsd:dateTime" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="en">
           The date the message was created. Used for auditing and logging.
        </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>
    <xsd:complexType name="EPC">
        <xsd:annotation>
            <xsd:documentation xml:lang="en">
         EPC represents the Electronic Product Code.
      </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleContent>
            <xsd:extension base="xsd:string"/>
        </xsd:simpleContent>
    </xsd:complexType>
</xsd:schema>

---- thanks ... david bolene

@eed3si9n
Copy link
Owner

I haven't checked it but could you try the following?

$ scalaxb EPCglobal.xsd epcglobal_1_0.xsd StandardBusinessDocumentHeader.xsd  -p test

It doesn't follow import by design since I didn't want scalaxb to go out to the web.

@dbolene
Copy link
Author

dbolene commented Jan 11, 2011

Eugene,

Similar result:

scalaxb EPCglobal.xsd epcglobal_1_0.xsd StandardBusinessDocumentHeader.xsd -p test

java.lang.RuntimeException: resolveType type not found: Partner ReferenceTypeSymbol(Partner,null)
at scala.Predef$.error(Predef.scala:58)
at scalaxb.compiler.xsd.ContextProcessor$class.resolveTypeSymbol$1(ContextProcessor.scala:195)
at scalaxb.compiler.xsd.ContextProcessor$$anonfun$resolveType$1.apply(ContextProcessor.scala:201)
at scalaxb.compiler.xsd.ContextProcessor$$anonfun$resolveType$1.apply(ContextProcessor.scala:201)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scalaxb.compiler.xsd.ContextProcessor$class.resolveType(ContextProcessor.scala:201)
at scalaxb.compiler.xsd.Driver$$anon$3.resolveType(Driver.scala:40)
at scalaxb.compiler.xsd.ContextProcessor$$anonfun$processContext$2.apply(ContextProcessor.scala:71)
at scalaxb.compiler.xsd.ContextProcessor$$anonfun$processContext$2.apply(ContextProcessor.scala:68)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:44)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:42)
at scalaxb.compiler.xsd.ContextProcessor$class.processContext(ContextProcessor.scala:68)
at scalaxb.compiler.xsd.Driver$$anon$3.processContext(Driver.scala:40)
at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:43)
at scalaxb.compiler.xsd.Driver.processContext(Driver.scala:33)
at scalaxb.compiler.Module$class.processReaders(Module.scala:123)
at scalaxb.compiler.xsd.Driver.processReaders(Driver.scala:33)
at scalaxb.compiler.Module$class.processFiles(Module.scala:75)
at scalaxb.compiler.xsd.Driver.processFiles(Driver.scala:33)
at scalaxb.compiler.Main$.start(Main.scala:84)
at scalaxb.compiler.Main$.main(Main.scala:32)
at scalaxb.compiler.Main.main(Main.scala)

Here is the contents of standardBusinessDocumentHeader.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" targetNamespace="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="DocumentIdentification.xsd"/>
<xs:include schemaLocation="Partner.xsd"/>
<xs:include schemaLocation="Manifest.xsd"/>
<xs:include schemaLocation="BusinessScope.xsd"/>
<xs:complexType name="StandardBusinessDocumentHeader">
xs:sequence
<xs:element name="HeaderVersion" type="xs:string"/>
<xs:element name="Sender" type="Partner" maxOccurs="unbounded"/>
<xs:element name="Receiver" type="Partner" maxOccurs="unbounded"/>
<xs:element name="DocumentIdentification" type="DocumentIdentification"/>
<xs:element name="Manifest" type="Manifest" minOccurs="0"/>
<xs:element name="BusinessScope" type="BusinessScope" minOccurs="0"/>
/xs:sequence
/xs:complexType
<xs:element name="StandardBusinessDocumentHeader" type="StandardBusinessDocumentHeader"/>
<xs:element name="StandardBusinessDocument" type="StandardBusinessDocument"/>
<xs:complexType name="StandardBusinessDocument">
xs:sequence
<xs:element ref="StandardBusinessDocumentHeader" minOccurs="0"/>
<xs:any namespace="##other" processContents="lax"/>
/xs:sequence
/xs:complexType
/xs:schema

@eed3si9n
Copy link
Owner

Ok, I'll take a look at this.

@eed3si9n
Copy link
Owner

It can't resolve Partner because the following are missing:

<xs:include schemaLocation="DocumentIdentification.xsd"/>
<xs:include schemaLocation="Partner.xsd"/>
<xs:include schemaLocation="Manifest.xsd"/>
<xs:include schemaLocation="BusinessScope.xsd"/>

You need to pass in all dependent schemas.

@dbolene
Copy link
Author

dbolene commented Jan 11, 2011

That worked! Actually this worked: scalaxb basicTypes.xsd businessScope.xsd documentIdentification.xsd epcglobal_1_0.xsd EPCglobal.xsd epcglobalMasterData_1_0.xsd epcglobalQuery_1_0.xsd manifest.xsd partner.xsd standardBusinessDocumentHeader.xsd -p test

Can't wait to play with the output,

Thanks for your time, david...

@eed3si9n
Copy link
Owner

No problem. I am now thinking maybe I should load schemas automatically at least from the local file system if they are not passed in explicitly.

@dbolene
Copy link
Author

dbolene commented Jan 11, 2011

Makes sense to me. Also it would be great if the tutorial made it more explicit you can pass multiple xsd's to it.

@eed3si9n
Copy link
Owner

Implemented current directory search. Also added a document on the website: http://scalaxb.org/multiple-schema-files

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants