Giter VIP home page Giter VIP logo

Comments (6)

deanroker123 avatar deanroker123 commented on September 4, 2024

Sorry thought I was on the wrong github repo. I still have this issue.

from go-xml.

droyo avatar droyo commented on September 4, 2024

Thanks for the report.

It's possible that a loop was created in the tree during parsing by one of the passes in the xsd package.

If you are able to share the xsd file I can take a look. If you're not, you could start by running the xsdparse utility against the document. xsdparse will just parse the file and apply some normalization steps. That will rule out any transformations that the xsdgen package performs.

from go-xml.

deanroker123 avatar deanroker123 commented on September 4, 2024

I get the same problem with xsdparse.

Here is the file in question. I added some logging in question and I think its to do with the global attributes file. It is pretty big.

Attachment removed

Let me know when you have the file and I will remove the link.

from go-xml.

droyo avatar droyo commented on September 4, 2024

Thanks, I have it and reproduced your issue.

I am still in the process of debugging. The problem appears to be in the xsd.flattenRef transformation. It is creating a loop in the document tree. This appears to be a recently introduced bug, since I was able to parse the documents with an older version of xsdparse

from go-xml.

droyo avatar droyo commented on September 4, 2024

I think I see the issue. There is an element in mod_base.xsd refers to itself:

<xs:element name="sup">
  <xs:complexType mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      ...
      <xs:element ref="sup"/>

XML schema does allow recursive types[1], I've just never accounted for them. For xsdgen, we could use pointers to model a recursive type:

type Sup struct {
    ...
    Sup *Sup
    ...
}

from go-xml.

deanroker123 avatar deanroker123 commented on September 4, 2024

That sounds like a great idea. Thank you for the prompt investigation

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.