Skip to content

AssertionError on adding a valid schema #1

Description

@burmisov

Fails to add this schema to parser:
XMLSchema.xsd

An AssertionError dumps to console.

P.S. Thank you for the library and idea. Never found time to implement it myself.

Activity

  1. mitar commented on Jun 30, 2014

    @mitar
    Member

    Yes, parser is not perfect yet. I mostly implemented stuff needed for me, plus checking the standard a bit. But there are things missing. This is why I added assertions everywhere. :-) Better that it fails than that it says something is parsed but it is not really.

    Do you know which line it fails on?

  2. mitar commented on Jun 30, 2014

    @mitar
    Member

    From looking at the schema, it will probably fail at xs:key tags. It has no clue what to do with them.

    It currently also ignores groups because I didn't have a need to use that. So referencing a group will probably also fail.

    Can you make a pull request with a test of this schema and some valid data? I could then look into it (or we could do it together, I do not have much time this days). Add it to other directory of tests.

  3. mitar commented on Jun 30, 2014

    @mitar
    Member

    It seems we could just delete xs:key, because it just makes data unique, but this does not influence conversion. (This module does not do full XML validation, it just uses those parts of schema which helps with conversion.)

  4. mitar commented on Aug 2, 2014

    @mitar
    Member

    Ping?

  5. mitar commented on Aug 2, 2014

    @mitar
    Member

    Can you provide me with an example XML and schema?

  6. burmisov commented on Aug 3, 2014

    @burmisov
    Author

    Sorry, I was offline for some time. Do we really need example XML if there adding the schema to parser fails? Don't get me wrong, I've got a bunch of schemas and XML (several hundreds of gigabytes namely), but I just didn't get that far yet.

  7. mitar commented on Aug 3, 2014

    @mitar
    Member

    Example XML is needed to create a test so that in the future there will be no regression. It can be a small XML, with just problematic parts. It does not have to be a XML with real data.

  8. burmisov commented on Aug 3, 2014

    @burmisov
    Author

    I don't know if it'll be appropriate for the current project stage, but the schema mensioned (http://www.w3.org/2001/XMLSchema.xsd) is in fact can be considered an XML document that should pass itself considered as a schema. As far as I understand.

  9. mitar commented on Aug 3, 2014

    @mitar
    Member

    Good idea. I can try that as well. :-)

  10. felixhao28 commented on May 16, 2016

    @felixhao28

    I am having the same issue, according to this link, complexType can have id, name, abstract, mixed, block, final... but you are only checking name and abstract: https://github.com/peerlibrary/node-xml4js/blob/master/lib/xsd.js#L311

  11. mitar commented on May 16, 2016

    @mitar
    Member

    On which value does it fail? I think it would be easy to ignore id. But for abstract, block, final, and any I am unsure how exactly to map it. Not sure also if they do influence conversion at all. Remember, I am not making full schema parser, but just enough to know when to do an array and when not to, and to know to which type to convert a value at the leaves.

  12. felixhao28 commented on May 16, 2016

    @felixhao28

    it fails on literally any value on any property other than id, name, mixed, because you asserting complexType.$ to be empty. if you only care about types then why not ignore other properties that don't contribute to resulting type?

  13. mitar commented on May 16, 2016

    @mitar
    Member

    Because I have not went through the whole list of other properties which can be there and think if they do or do not contribute to the resulting type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions