libxml-enno
view release on metacpan or search on metacpan
html/XML/Checker.html view on Meta::CPAN
Init, Final, Char, Start, End, Element, Attlist, Doctype,
Unparsed, Entity, Notation.
<P>I don't know how to correctly support the Default handler for all <A HREF="Parser.html">XML::Parser</A>
releases. The Start handler works a little different (see below) and I
added Attr, InitDomElem, FinalDomElem, CDATA and EntityRef handlers.
See <A HREF="Parser.html">XML::Parser</A> for a description of the handlers that are not listed below.
<P>Note that this interface may disappear, when the PerlSAX interface stabilizes.
<DL><DT><A NAME="Start_tag_"><STRONG><P>Start ($tag)
</STRONG></A><PRE> $checker->Start($tag);
</PRE><DD>Call this when an Element with the specified $tag name is encountered.
Different from the Start handler in <A HREF="Parser.html">XML::Parser</A>, in that no attributes
are passed in (use the Attr handler for those.)
<DT><A NAME="Attr_tag_attrName_attrValue_isSpecified_"><STRONG><P>Attr ($tag, $attrName, $attrValue, $isSpecified)
</STRONG></A><PRE> $checker->Attr($tag,$attrName,$attrValue,$spec);
</PRE><DD>Checks an attribute with the specified $attrName and $attrValue against the
ATTLIST definition of the element with the specified $tag name.
$isSpecified means whether the attribute was specified (1) or defaulted (0).
<DT><A NAME="EndAttr_"><STRONG><P>EndAttr ()
</STRONG></A><PRE> $checker->EndAttr;
</PRE><DD>This should be called after all attributes are passed with Attr().
It will check which of the #REQUIRED attributes were not specified and generate
the appropriate error (159) for each one that is missing.
<DT><A NAME="CDATA_text_"><STRONG><P>CDATA ($text)
</STRONG></A><PRE> $checker->CDATA($text);
</PRE><DD>This should be called whenever CDATASections are encountered.
Similar to Char handler (but might perform different checks later...)
<DT><A NAME="EntityRef_entity_isParameterEntity_"><STRONG><P>EntityRef ($entity, $isParameterEntity)
</STRONG></A><PRE> $checker->EntityRef($entity,$isParameterEntity);
</PRE><DD>Checks the ENTITY reference. Set $isParameterEntity to 1 for
entity references that start with '%'.
<DT><A NAME="InitDomElem_and_FinalDomElem_"><STRONG><P>InitDomElem () and FinalDomElem ()
</STRONG></A><DD>Used by XML::DOM::Element::check() to initialize (and cleanup) the
context stack when checking a single element.
</DL><H2><A NAME="PerlSAX_interface">PerlSAX interface
</A></H2><P>XML::Checker now also supports the PerlSAX interface, so you can use XML::Checker
wherever you use PerlSAX handlers.
<P>XML::Checker implements the following methods: start_document, end_document,
start_element, end_element, characters, processing_instruction, comment,
start_cdata, end_cdata, entity_reference, notation_decl, unparsed_entity_decl,
entity_decl, element_decl, attlist_decl, doctype_decl, xml_decl
<P>Not implemented: set_document_locator, ignorable_whitespace
<P>See PerlSAX.pod for details. (It is called lib/PerlSAX.pod in the libxml-perl
distribution which can be found at CPAN.)
<P><HR><H1><A NAME="CAVEATS">CAVEATS
</A></H1><P>This is an alpha release. Almost everything is subject to change.
<P><HR><H1><A NAME="AUTHOR">AUTHOR
</A></H1><P>Send bug reports, hints, tips, suggestions to Enno Derksen at
<<I>enno@att.com</I>>.
<P><HR><H1><A NAME="SEE_ALSO">SEE ALSO
</A></H1><P>The home page of XML::Checker at <A HREF="http://www.erols.com/enno/checker/index.html">http://www.erols.com/enno/checker/index.html</A>
<P>The XML spec (Extensible Markup Language 1.0) at <A HREF="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</A>
<P>The <A HREF="Parser.html">XML::Parser</A> and <A HREF="Parser/Expat.html">XML::Parser::Expat</A> manual pages.
<P>The other packages that come with XML::Checker:
<A HREF="Checker/Parser.html">XML::Checker::Parser</A>, <A HREF="DOM/ValParser.html">XML::DOM::ValParser</A>
<P>The DOM Level 1 specification at <A HREF="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</A>
<P>The PerlSAX specification. It is currently in lib/PerlSAX.pod in the
libxml-perl distribution by Ken MacLeod.
<P>The original SAX specification (Simple API for XML) can be found at
<A HREF="http://www.megginson.com/SAX">http://www.megginson.com/SAX</A> and <A HREF="http://www.megginson.com/SAX/SAX2">http://www.megginson.com/SAX/SAX2</A>
<P><HR><I><FONT SIZE="-1">Last updated: Wed Feb 23 13:37:15 2000</FONT></I></BODY></HTML>
( run in 0.534 second using v1.01-cache-2.11-cpan-d7f47b0818f )