Loading TOC...

MarkLogic Server 11.0 Product Documentation
ProcessingInstruction.target

ProcessingInstruction.target as String

Summary

The target of an XML processing instruction.

Usage Notes

This method is only defined on processing instruction nodes.

Example

// Assume example.xml has contents similar to the following:
//   <data>
//     <?myPITarget somePIData?>
//   </data>

const node = cts.doc('example.xml').root.firstChild;
if (node.nodeType === Node.PROCESSING_INSTRUCTION_NODE) {
  node.target
} else {
  'not a processing instruction'
}

// returns 'myPITarget'

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.