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

implimentation #10

Open
chacliff opened this issue Apr 19, 2016 · 4 comments
Open

implimentation #10

chacliff opened this issue Apr 19, 2016 · 4 comments

Comments

@chacliff
Copy link

chacliff commented Apr 19, 2016

having a hard time with your implementation. i was previously using xml2js so i know what i can take advantage of from there. but i wanted to take advantage of the xsd somehow and found your module.

Your validator seems to get all the way down to the bottom level of the xml and then throws an error. I think i have the proper xsd for my xml but not sure what the problem is here.

   <gsdd:ClinicalRequest>
            <gsdd:Prescribed>
                <gsdd:Product>
                    <gsdd:ProductIdentifier>
                        <gsdd:IdentifierType>ProductID</gsdd:IdentifierType>
                        <gsdd:Identifier>1131</gsdd:Identifier>
                    </gsdd:ProductIdentifier>

is the structure it i believe is diving into.
Here is the schema.xsd entry i believe corresponds to the data.

  <s:complexType name="ProductIdentifierType">
    <s:sequence>
      <s:element name="IdentifierType" type="tns:ProductIdentifierEnum"/>
      <s:element name="Identifier" type="s:string"/>
    </s:sequence>
  </s:complexType>

further.. the enum looks like this

<s:simpleType name="ProductIdentifierEnum" final="list">
    <s:restriction base="s:string">
      <s:enumeration value="NDC9"/>
      <s:enumeration value="ProductID"/>
    </s:restriction>
  </s:simpleType>

All this looks correct to me yet your module reports the error...

    {"message":"Uncaught error: Element ({http://gsdd.goldstandard.com/}Clinical
Request) does not match schema, xpath: /{http://gsdd.goldstandard.com/}ClinicalR
equest/{http://gsdd.goldstandard.com/}Prescribed/{http://gsdd.goldstandard.com/}
Product/{http://gsdd.goldstandard.com/}ProductIdentifier/{http://gsdd.goldstanda
rd.com/}IdentifierType, allowed elements: {}","domain":{"domain":null,"_events":
{},"_eventsCount":1,"members":[]},"domainThrown":true,"isBoom":true,"isServer":t
rue,"data":null,"output":{"statusCode":500,"payload":{"statusCode":500,"error":"
Internal Server Error","message":"An internal server error occurred"},"headers":
{"content-type":"application/json; charset=utf-8","cache-control":"no-cache","co
ntent-encoding":"gzip","vary":"accept-encoding"}},"isDeveloperError":true}

if necessary i can provide the full xsd and the full sample xml. i'm sure we can work together to make your module better if necessary. This should be a good real world example to go off of.

@mitar
Copy link
Member

mitar commented Apr 19, 2016

Yes, this is not really a full implementation. I implemented only parts of validation needed for my XSD. :-(

So there are many cases which it does not handle. But it should not be too hard to add them.

@chacliff
Copy link
Author

it would be really nice to contribute some time to it. maybe you can tell me more about the error and the architecture of your "validator.js" file and we can collaborate on making it handle an example like mine in our spare time?

@mitar
Copy link
Member

mitar commented May 3, 2016

It would be great if you could make a pull request with a test for this particular failing XSD and XML.

@chacliff
Copy link
Author

yeah i'll look at the other test files and see if i can pull something together and do a pull request.

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

No branches or pull requests

2 participants