Method Parser.XML.Tree.XMLParser()->node_factory()
- Method
node_factory
protectedAbstractSimpleNodenode_factory(inttype,stringname,mappingattr,stringtext)- Description
Factory for creating 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.
Overload this function to provide application-specific XML nodes.
- Returns
Returns a node object representing the XML tag, or
0(zero) if the subtree rooted in the tag should be cut.- Note
This function is not available in Pike 7.6 and earlier.
- See also
node_factory_dispatch(), AbstractSimpleNode()->node_factory()