XML to JSON Converter #1092
-
I am working with the OSCAL XML to JSON converter and have run into an issue when using the converter to convert an OSCAL Metaschema model following the instructions as stated under "Converting OSCAL XML Content to JSON" . It will produce a JSON document that only has the following error: <nm:ERROR xmlns:err="http://www.w3.org/2005/xqt-errors" xmlns:nm="http://csrc.nist.gov/ns/metaschema" code="err:FOJS0006">A valid document must have a child element</nm:ERROR> The error (FOJS0006) indicates that there is "Invalid XML representation of JSON". We have tested the converter both with our own metaschema/schema xmls and ones pulled from the OSCAL github directly Can anyone please help resolve this issue or help me understand what needs to be adjusted/modified for the model to convert from XML to JSON? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@ggomez1225 is there a chance you could follow up on our Gitter channel (linked to this repo)? https://gitter.im/usnistgov-OSCAL/Lobby (or message me directly). The converters are derived from metaschema sources, but they do not operate on metaschemas. The catalog converters, for example, operate on OSCAL catalog (XML or JSON as the case may be). When the converter runs, the metaschema is no longer part of the picture. So the problem could be as simple as wiring up with the wrong inputs. But I don't like the error message (which is apparently being passed from an XML parser), and we can probably improve the converter(s) and/or documentation to make it less mysterious. |
Beta Was this translation helpful? Give feedback.
@ggomez1225 is there a chance you could follow up on our Gitter channel (linked to this repo)? https://gitter.im/usnistgov-OSCAL/Lobby (or message me directly).
The converters are derived from metaschema sources, but they do not operate on metaschemas. The catalog converters, for example, operate on OSCAL catalog (XML or JSON as the case may be). When the converter runs, the metaschema is no longer part of the picture. So the problem could be as simple as wiring up with the wrong inputs.
But I don't like the error message (which is apparently being passed from an XML parser), and we can probably improve the converter(s) and/or documentation to make it less mysterious.