Giter Site home page Giter Site logo

problem following import about scalaxb HOT 8 CLOSED

eed3si9n avatar eed3si9n commented on August 29, 2024
problem following import

from scalaxb.

Comments (8)

eed3si9n avatar eed3si9n commented on August 29, 2024

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.

from scalaxb.

dbolene avatar dbolene commented on August 29, 2024

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

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

Ok, I'll take a look at this.

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

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.

from scalaxb.

dbolene avatar dbolene commented on August 29, 2024

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...

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

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.

from scalaxb.

dbolene avatar dbolene commented on August 29, 2024

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

from scalaxb.

eed3si9n avatar eed3si9n commented on August 29, 2024

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

from scalaxb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.