-
Notifications
You must be signed in to change notification settings - Fork 103
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
Restrictions in model when using compile_xsd_file #71
Comments
If you mean: an option to ensure that the parser enforces the restriction, the answer is no. The parser only checks the structure of the XML documents, restrictions like minInclusive and maxInclusive are not checked. If you are looking for a way to somehow inspect the XSD (your question sort of suggests that?) then you could try erlsom_parseXsd:parseXsd/2. |
Thanks for the quick response! For this XSD:
i get this result:
I would have expected the pattern somewhere in the result, but its missing. |
Hm, I tried this:
But that gives:
So the information you are looking for is not there either. It means that there is no simple way to do this using erlsom, I am afraid. The most logical way to do it would be to compile the schema for XML Schema, and then parse the XSD using that model. But unfortunately that won't work; for some reason erlsom does not accept the XSD for XML Schema. What you could do is have a look at the module parseXsd.erl, and extend the 'xsdModel' that is returned by the function xsdModel. Alternatively you can parse the XSD using the SAX mode or the "simple DOM mode". But either way you will have to puzzle a bit, sorry. |
Is it possible to get the restrictions from the XSD file when using compile_xsd_file function?
Example XSD
The model returned by compile_xsd_file does not contain the restriction:
Is there any option to allow getting the content of the restriction?
The text was updated successfully, but these errors were encountered: