tail-f-systems / JNC

JNC (Java NETCONF Client) is the name of a Java library for communicating with NETCONF agents, and a plugin for pyang (http://code.google.com/p/pyang/) to generate Java classes from YANG models, to be used by the JNC library.
Other
77 stars 87 forks source link

Saved XML isn't well formed #12

Closed hshorter closed 1 year ago

hshorter commented 11 years ago

When saving a NodeSet with .toXMLString the resulting XML isn't 'well formed' and cannot be parsed by the XMLParser. This makes it difficult to load XML which has been previously saved.

    NodeSet all = session.getConfig();
    new XMLParser().parse(all.toXMLString());

results in:

[Fatal Error] :261:2: The markup in the document following the root element must be well-formed. Exception in thread "main" Parse error: parse error: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

When adding dummy tags around the whole thing, eg ..... the types cannot be cast to our own model.

Emil-Tail-f commented 11 years ago

Is there a manual workaround for this issue that we could automate in the toXMLString method?