Class XmlDocuments
java.lang.Object
io.jenkins.plugins.xmleditor.core.parse.XmlDocuments
Entry point for turning file bytes into a lossless document and back.
-
Method Details
-
parse
public static LDocument parse(byte[] bytes, String displayName, long maxBytes) throws XmlEditorException Decodes, checks well-formedness (securely) and builds the lossless tree.- Parameters:
displayName- used as prefix of error messages, e.g.pom.xml:12:5: ...- Throws:
XmlEditorException
-
parseText
public static LDocument parseText(String text, String displayName, long maxBytes) throws XmlEditorException Parses XML that is already text (e.g. thetext:parameter of a step): the encoding declared in it is ignored, since there are no bytes to decode.- Throws:
XmlEditorException
-
toBytes
- Throws:
XmlEditorException
-