Coder Social home page Coder Social logo

Unconvertable xsd schema about go-xml HOT 2 OPEN

Toasterson avatar Toasterson commented on June 3, 2024
Unconvertable xsd schema

from go-xml.

Comments (2)

droyo avatar droyo commented on June 3, 2024

The error is here (note the extra space)

type  struct {
        Type Anon52 `xml:"type,attr"`
}

It seems similar to #99 . It appears to be trying to generate a complexType with an attribute named "type". There are a lot of those in the gist you provided. If I had to guess, I suspect it's this one, since there's no additional fields inside the complexType:

 <xs:element name="include_values">
   <xs:complexType>
     <xs:attribute name="type" use="required">
       <xs:simpleType>
         <xs:restriction base="xs:token">
           <xs:enumeration value="constraints"/>
           <xs:enumeration value="values"/>
         </xs:restriction>
       </xs:simpleType>
     </xs:attribute>
   </xs:complexType>
 </xs:element>

I'm not sure when I'll get a chance to look further, but could you try slimming down your xsd and see if you could pinpoint the type that causes this? Then maybe the -vvv output from xsdgen could give us a clue (warning: it prints a lot of output).

from go-xml.

Toasterson avatar Toasterson commented on June 3, 2024

I managed to get a working version with the alternate wool xgen and some heavy manual editing. Its at for a reference https://git.wegmueller.it/OpenCloud/opencloud/src/branch/master/smf/service_bundle.xsd.go

I tried to minify the file and see which type generates the error and it turns out pretty much every one does...

Example:

<xs:element name="doc_link">
    <xs:complexType>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="uri" use="required"/>
    </xs:complexType>
  </xs:element>
read service_bundle-min.xsd
read xml.xsd
setting namespaces to ["http://www.w3.org/XML/1998/namespace"]
complexType doc_link: could not find type  in namespace  for attribute name

I only found -vv as option not -vvv is that still enough output?

from go-xml.

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.