NodeBuilder.addProcessingInstruction( target as String, text as String ) as This NodeBuilder object
Add an XML processing instruction node to the node tree the builder is building.
Parameters | |
---|---|
target | The processing instruction target. |
text | The contents of the processing instruction. |
Processing instruction nodes may only be added to XML documents.
const builder = new NodeBuilder(); builder.startDocument(); builder.addProcessingInstruction( 'xml-stylesheet','href="mystyles.css" type="text/css"'); builder.addElement('doc','My simple document with a stylesheet'); builder.endDocument(); builder.toNode(); // Returns an XML document node equivalent to the following: // // ?xml version="1.0" encoding="UTF-8"?> // <?xml-stylesheet href="mystyles.css" type="text/css"?> // <doc>My simple document with a stylesheet</doc>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.