Method Parser.XML.Tree.AbstractSimpleNode()->node_factory()
- Method
node_factory
optionalthis_programnode_factory(inttype,stringname,mappingattr,stringtext)- Description
Optional factory for creating contained nodes.
- Parameter
type Type of node to create. One of:
XML_TEXTXML text.
textcontains a string with the text.XML_COMMENTXML comment.
textcontains a string with the comment text.XML_HEADER<?xml?>-header
attrcontains a mapping with the attributes.XML_PIXML processing instruction.
namecontains the name of the processing instruction andtextthe remainder.XML_ELEMENTXML element tag.
namecontains the name of the tag andattrthe attributes.XML_DOCTYPEDTD information.
DTD_ENTITYDTD_ELEMENTDTD_ATTLISTDTD_NOTATION- Parameter
name Name of the tag if applicable.
- Parameter
attr Attributes for the tag if applicable.
- Parameter
text Contained text of the tab if any.
This function is called during parsning to create the various XML nodes.
Define this function to provide application-specific XML nodes.
- Returns
Returns one of
AbstractSimpleNodeA node object representing the XML tag.
int(0)0(zero) if the subtree rooted here should be cut.zeroUNDEFINEDto fall back to the next level of parser (ie behave as if this function does not exist).- Note
This function is only relevant for XML_ELEMENT nodes.
- Note
This function is not available in Pike 7.6 and earlier.
- Note
In Pike 8.0 and earlier this function was only called in root nodes.