Can I re-order an existing XML to adhere to an XSD

后端 未结 2 1634
终归单人心
终归单人心 2021-01-06 13:34

We\'re generating an XML with Java (org.w3c.dom.Node), using essentially

parent.appendChild(doc.createElement(nodeName));

this gen

2条回答
  •  失恋的感觉
    2021-01-06 14:15

    I don't think something like that exists. Simple reordering might be possible, but XML-Schema allows to define so many constraints, that it might be impossible to write a general tool that converts some XML document into a valid document according to some schema.

    So, just build the document correctly in the first place.

提交回复
热议问题