1 package MOBY
::MobyXMLConstants
;
3 use vars
qw( $VERSION @ISA @EXPORT @NodeNames);
7 #########################################################
8 #The purpose of this module is to emulate some of the #
9 #functionality found in the XML::DOM::Node module. Upon #
10 #switching parsers, it was apparent that some subs didnt#
11 #exist in LibXML and so they have been recreated here. #
12 #########################################################
13 # Constants for XML::DOM Node types
22 PROCESSING_INSTRUCTION_NODE
26 DOCUMENT_FRAGMENT_NODE
36 #---- Constant definitions
38 sub UNKNOWN_NODE
() { 0 } # not in the DOM Spec
39 sub ELEMENT_NODE
() { 1 }
40 sub ATTRIBUTE_NODE
() { 2 }
41 sub TEXT_NODE
() { 3 }
42 sub CDATA_SECTION_NODE
() { 4 }
43 sub ENTITY_REFERENCE_NODE
() { 5 }
44 sub ENTITY_NODE
() { 6 }
45 sub PROCESSING_INSTRUCTION_NODE
() { 7 }
46 sub COMMENT_NODE
() { 8 }
47 sub DOCUMENT_NODE
() { 9 }
48 sub DOCUMENT_TYPE_NODE
() { 10 }
49 sub DOCUMENT_FRAGMENT_NODE
() { 11 }
50 sub NOTATION_NODE
() { 12 }
51 sub ELEMENT_DECL_NODE
() { 13 } # not in the DOM Spec
52 sub ATT_DEF_NODE
() { 14 } # not in the DOM Spec
53 sub XML_DECL_NODE
() { 15 } # not in the DOM Spec
54 sub ATTLIST_DECL_NODE
() { 16 } # not in the DOM Spec
56 "UNKNOWN_NODE", # not in the DOM Spec!
60 "XML_CDATA_SECTION_NODE",
61 "XML_ENTITY_REF_NODE",
66 "XML_DOCUMENT_TYPE_NODE",
67 "XML_DOCUMENT_FRAG_NODE",
69 "XML_ELEMENT_DECL_NODE",
72 "XML_ATTLIST_DECL_NODE"
75 # this sub takes in a LibXML::Node and outputs the nodeTypeName.
77 $NodeNames[ $_[0]->nodeType ];