XMLNSC: Comments and Processing Instructions
The XMLNSC parser discards comments and processing instructions because both comments and processing instructions are auxiliary information with no business meaning.
Comments
Comments can be preserved if you select the Retain comments check box on the Parser Options page of the node properties.
If Retain comments is
selected, each comment in the input document is represented by a single
syntax element with field type XMLNSC.Comment. The Retain
comments option can also be accessed by using the following
ESQL:
DECLARE X BLOB;
-- assume that X contains an XML document
CREATE LASTCHILD OF OutputRoot.XMLNSC
PARSE(X DOMAIN XMLNSC
NAME preserveComments
OPTIONS XMLNSC.CommentsRetainAll);
-- do it again, this time discarding comments
CREATE LASTCHILD OF OutputRoot.XMLNSC
PARSE(X DOMAIN XMLNSC
NAME discardComments
OPTIONS XMLNSC.CommentsRetainNone);
Processing Instructions
Processing instructions can be preserved if you select the Retain processing instructions check box on the Parser Options page of the node properties.
If Retain
processing instructions is selected, each processing instruction
the input document is represented by a single syntax element with
field type XMLNSC.ProcessingInstruction. The Retain processing
instructions option can also be accessed by using the following
ESQL:
DECLARE X BLOB;
-- assume that X contains an XML document
CREATE LASTCHILD OF OutputRoot.XMLNSC
PARSE(X DOMAIN XMLNSC
NAME preserveProcessingInstructions
OPTIONS XMLNSC.ProcessingInstructionsRetainAll);
-- do it again, this time discarding processing instructions
CREATE LASTCHILD OF OutputRoot.XMLNSC
PARSE(X DOMAIN XMLNSC
NAME discardProcessingInstructions
OPTIONS XMLNSC.ProcessingInstructionsRetainNone);