XML::Xerces Sample: EnumVal
Sample: EnumVal
EnumVal
EnumVal shows how to enumerate the markup decls in a DTD Grammar.
Running EnumVal
This program parses the specified XML file, then shows how to enumerate the contents of the DTD Grammar.
Usage: perl EnumVal.pl <XML file> This program parses the specified XML file, then shows how to enumerate the contents of the DTD Grammar. Essentially, shows how one can access the DTD information stored in internal data structures.
Here is a sample output from EnumVal
cd samples perl EnumVal.pl personal.xml Element Name: personnel, Content Model: (person)+ Element Name: person, Content Model: (name,email*,url*,link?) attribute Name: id, Type: ID Element Name: name, Content Model: (#PCDATA|family|given)* Element Name: email, Content Model: (#PCDATA) Element Name: url, Content Model: EMPTY attribute Name: href, Type: CDATA Element Name: link, Content Model: EMPTY attribute Name: subordinates, Type: IDREF(S) attribute Name: manager, Type: IDREF(S) Element Name: family, Content Model: (#PCDATA) Element Name: given, Content Model: (#PCDATA) personal.xml: duration: 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)