node-libxml-xsd icon indicating copy to clipboard operation
node-libxml-xsd copied to clipboard

Retrieving xsd annotation and xsd documentation for elements with errors

Open renegadeandy opened this issue 6 years ago • 3 comments

Hi,

If I get an error on a particular element, I get a JSON object back in the validate callback which looks as follows:

{"domain":17,"code":1866,"level":2,"column":0,"line":149,"str1":"tracmaxFiles"}

This error element has xsd:annotations and xsd:documentation tags associated with it. Is is possible to get access to these elements? Are their alternative libraries which could do this if this can't. If not, would it be possible to extend libxml-xsd to make this a capability?

Thanks!

renegadeandy avatar Aug 28 '18 14:08 renegadeandy

You would like to access the element that caused the error ? Seems like a good idea, I don't know if it is doable. I don't maintain this module actively, but I review pull requests, so feel free to look into it and submit a PR.

albanm avatar Aug 30 '18 12:08 albanm

hahah 👍 Okay, if I somehow find time i'll look into extending it!

renegadeandy avatar Aug 30 '18 16:08 renegadeandy

Actually, it's not quite just access the element, some elements have annotations or documentation, I would like to have these in the response object. I have taken a quick look, and I may be wrong, but I believe that I would need to modify libxmljs-mt in order to achieve what I want with this module. Does that seem / sound right?

renegadeandy avatar Sep 05 '18 06:09 renegadeandy