From: Petr C. <pci...@us...> - 2005-01-11 14:34:43
|
Update of /cvsroot/perl-xml/sax-perl-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6394 Modified Files: changes-2.1 changes-2.1.html changes-2.1.xml changes.css changes.xsl index.html sax-2.1-adv.html sax-2.1-idx.html sax-2.1-ref.html sax-2.1.html Log Message: Index: changes-2.1 =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes-2.1,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- changes-2.1 27 Sep 2004 09:03:18 -0000 1.3 +++ changes-2.1 11 Jan 2005 14:34:29 -0000 1.4 @@ -1,4 +1,4 @@ -This document is deprecated. -It has been replaced with changes-2.1.html -as of September 27, 2004. - +This document is deprecated. +It has been replaced with changes-2.1.html +as of September 27, 2004. + Index: changes-2.1.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes-2.1.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- changes-2.1.html 10 Nov 2004 08:26:59 -0000 1.3 +++ changes-2.1.html 11 Jan 2005 14:34:29 -0000 1.4 @@ -38,6 +38,47 @@ Changes in attribute_decl(): ValueDefault renamed to Mode. The new name is less confusing and corresponds to SAX Java API. </p> + <p class="change"> + <b>Change <a name="C4">C4</a> + </b> + <i> [resolves issue <a href="#I12">I12</a>]</i> + <br /> + The following text has been added to define what the document locator is + supposed to return: "If possible, a Perl SAX driver should provide the line + and column position of the last character of the text associated with the + current document event. The first line is line 1; the first column in each + line is column 1." + </p> + <p class="change"> + <b>Change <a name="C5">C5</a> + </b> + <i> [resolves issue <a href="#I11">I11</a>]</i> + <br />Hash values are Unicode strings (scalars with + UTF-8 flag on) The spec defines that a stream argument that can be provided + to parse_file() method can be either a file handle, a glob reference, + or a IO::Handle sub-class. + </p> + <p class="change"> + <b>Change <a name="C6">C6</a> + </b> + <i> [resolves issue <a href="#I7">I7</a>]</i> + <br /> + New section "Namespace Processing" has been added. It describes + the behavior of a parser for NS processing turned off: + Element/attribute hash keys are always present, + NamespaceURI, Prefix and LocalName are undef. Attributes keys + are prefixed with {}. NS declarations are treated as common + attributes. start_prefix_mapping and end_prefix_mapping are + never called. + </p> + <p class="change"> + <b>Change <a name="C7">C7</a> + </b> + <i> [resolves issue <a href="#I8">I8</a>]</i> + <br /> + The spec defines explicitly that values of callback argument hashrefs are + Unicode strings (scalars with UTF-8 flag on). + </p> <h2>Summary of Issues</h2> <p class="open"> <b>Issue <a name="I1">I1</a> @@ -50,6 +91,8 @@ also to Perl SAX 2.0 retrospectively to distinguish between 1.0, 2.0 and 2.1 drivers. <br /> + Suggestion: the read-only feature. + <br /> </p> <p class="open"> <b>Issue <a name="I2">I2</a> @@ -73,6 +116,11 @@ features to let apps to know whether extension handlers are supported o not (http://xmlns.perl.org/sax/LexicalHandler, DeclHandler). <br /> + Suggestion: LexicalHandler and DeclHandler are set using the + parser properties with the same name. The two read-only features, + (http://xmlns.perl.org/sax/LexicalHandler, DeclHandler) return + 0 or 1 to indicate whether the parser support these two interfaces. + <br /> </p> <p class="open"> <b>Issue <a name="I3">I3</a> @@ -85,6 +133,8 @@ DTD. This could be introduced into Perl SAX 2.1 as an optional extension (advertised by a feature). <br /> + Suggestion: not to apply. + <br /> </p> <p class="decided"> <b>Issue <a name="I4">I4</a> @@ -106,6 +156,8 @@ All hash references could be replaced with blessed classes. Need to clarify what would be benefits of such change. <br /> + Suggestion: not to apply. + <br /> </p> <p class="decided"> <b>Issue <a name="I6">I6</a> @@ -116,10 +168,10 @@ eName, aName, Type, Mode (was ValueDefault), Value <br /> </p> - <p class="open"> + <p class="decided"> <b>Issue <a name="I7">I7</a> </b> - <i> status: open, resolution: none</i> + <i> status: decided, resolution: applied [resolved as change <a href="#C6">C6</a>]</i> <br /> The effect of turning off namespace processing is unclear in Perl SAX. The spec should state that all namespace-related processing is skipped, @@ -130,10 +182,10 @@ {}pfx:lname). NS declarations are treated as common attributes. <br /> </p> - <p class="open"> + <p class="decided"> <b>Issue <a name="I8">I8</a> </b> - <i> status: open, resolution: none</i> + <i> status: decided, resolution: applied [resolved as change <a href="#C7">C7</a>]</i> <br /> Perl SAX should require explicitly all event data to be Unicode strings (to have the UTF-8 flag on). @@ -171,16 +223,14 @@ this method. <br /> Suggested solution: - To change parse_file() so that it accepts a string in addition to the - currently supported types. Alternatively, parse_file() can be considered - deprecated (though supported for compatibility) and another method - (? parse_stream) used to accept streams. + To change parse_file() so that it accepts a system path in addition to the + currently supported types. <br /> </p> - <p class="open"> + <p class="decided"> <b>Issue <a name="I11">I11</a> </b> - <i> status: open, resolution: none</i> + <i> status: decided, resolution: applied [resolved as change <a href="#C5">C5</a>]</i> <br /> The specification should state explicitly what is meant be "streams", what are supported types for parse_file(): file handles, @@ -190,10 +240,10 @@ To support all of the above mentioned types. <br /> </p> - <p class="open"> + <p class="decided"> <b>Issue <a name="I12">I12</a> </b> - <i> status: open, resolution: none</i> + <i> status: decided, resolution: applied [resolved as change <a href="#C4">C4</a>]</i> <br /> The spec should be more explicit about what a document locator is supposed to return. It could for example read: @@ -203,5 +253,20 @@ The first line is line 1; the first column in each line is column 1. <br /> </p> + <p class="open"> + <b>Issue <a name="I13">I13</a> + </b> + <i> status: open, resolution: none</i> + <br /> + The value of the Encoding property of Input Sources should be able to override + the encoding value specified in the xml declaration. The spec should state this + explicitly, if so. + <br /> + Suggestion: to add the following text: If available, the value + of Encoding property has a higher priority than encoding + specified in an XML declaration. + + <br /> + </p> </body> </html> Index: changes-2.1.xml =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes-2.1.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- changes-2.1.xml 10 Nov 2004 08:26:59 -0000 1.3 +++ changes-2.1.xml 11 Jan 2005 14:34:29 -0000 1.4 @@ -1,182 +1,238 @@ -<?xml version="1.0"?> -<change-log xmlns="http://sax.perl.org/changeLog"> - - <title>Perl SAX 2.1 Changes and Issues</title> - - <description> - The purpose of this file is to record changes done from Perl SAX - 2.0 and to track related issues.</description> - - <change-list> - - <change id="C1" issue-ref=""> - XMLVersion and Encoding fields added to document locator - (as in Locator2 interface of SAX 2.0 Ext. 1.1) - </change> - - <change id="C2" issue-ref="I4"> - The definition of parse() unified in the Basic and - Advanced documents. parse_uri() added. The new definition fits to - the current XML::SAX::Base implementation (as of XML::SAX v0.12). - </change> - - <change id="C3" issue-ref="I6"> - Changes in attribute_decl(): ValueDefault renamed to Mode. - The new name is less confusing and corresponds to SAX Java API. - </change> - - </change-list> - - <issue-list> - - <issue id="I1" status="open" resolution="none" change-ref=""> - <para> - A parser should advertise SAX version it supports. There can be - a new method ($parser->get_sax_version()) or a read-only feature - (http://xmlns.perl.org/sax/version). This feature should be introduced - also to Perl SAX 2.0 retrospectively to distinguish between 1.0, 2.0 - and 2.1 drivers. - </para> - </issue> - - <issue id="I2" status="open" resolution="none" change-ref=""> - <para> - "http://xml.org/sax/handlers/LexicalHandler" feature on the parser - needs to be set to the object to receive lexical events currently. If - the reader does not support lexical events, it will throw - a XML::SAX::Exception::NotRecognized or a - XML::SAX::Exception::NotSupported when you attempt to register the - handler. DeclHandler works in the same way. Actually, this is a theory - - XML::SAX::Base doesn't implement this currently. - </para> - <para> - This approach is very different from the common PerlSAX mechanism: - look for a specific handler, then look for a handler method on the - default handler, ignore the callback when not found. It would be more - 'perlish' to apply this simple mechanism to LexicalHandler and - DeclHandler too. If we want these two be extension handlers (compliant - 2.1 parsers are not required to support them) there could be read-only - features to let apps to know whether extension handlers are supported - o not (http://xmlns.perl.org/sax/LexicalHandler, DeclHandler). - </para> - </issue> - - <issue id="I3" status="open" resolution="none" change-ref=""> - <para> - SAX 2.0 Ext. 1.1 has a new Attributes2 interface which extends - attributes with new properties (Declared, Specified) to distinguish - between attributed specified in an XML doc and those declared in - DTD. This could be introduced into Perl SAX 2.1 as an optional - extension (advertised by a feature). - </para> - </issue> - - <issue id="I4" status="decided" resolution="applied" change-ref="C2"> - <para> - The parse() method is defined in different ways in the Basic and - Advanced documents. - Proposed solution: to add an explicit parse_uri() method, parse() - would call either parse_uri(), parse_string(), or parse_stream() - based on InputSource. - </para> - </issue> - - <issue id="I5" status="open" resolution="none" change-ref=""> - <para> - All hash references could be replaced with blessed classes. Need to - clarify what would be benefits of such change. - </para> - </issue> - - <issue id="I6" status="decided" resolution="applied" change-ref="C3"> - <para> - Changes in attribute_decl - eName, aName, Type, Mode (was ValueDefault), Value - </para> - </issue> - - <issue id="I7" status="open" resolution="none" change-ref=""> - <para> - The effect of turning off namespace processing is unclear in Perl SAX. - The spec should state that all namespace-related processing is skipped, - and no namespace-related information is made available. - </para> - <para> - Suggestion: All node keys are always present, NamespaceURI, Prefix and - LocalName are undef. Attributes keys are prefixed with {} (for example - {}pfx:lname). NS declarations are treated as common attributes. - </para> - </issue> - - <issue id="I8" status="open" resolution="none" change-ref=""> - <para> - Perl SAX should require explicitly all event data to be Unicode strings - (to have the UTF-8 flag on). - </para> - </issue> - - <issue id="I9" status="open" resolution="none" change-ref=""> - <para> - Input sources don't have a String property defined though the - parse_string() method exists and use it. Current XML::SAX::Base version - (0.12) already implements String property. The properties are checked in - this order: CharacterStream, ByteStream, String, SystemId. - </para> - <para> - Suggested solution: To add the following paragraph: - </para> - <para> - String - The character or byte string for this input source. - If there is a string specified, the SAX parser will ignore any byte - or character stream and will not attempt to open a URI connection to - the system identifier. - If the UTF-8 flag of the string is turned on, the effect is as if - the Encoding property is set to UTF-8. - </para> - <para> - The order of properties to be checked has to be determined. - </para> - </issue> - - <issue id="I10" status="open" resolution="none" change-ref=""> - <para> - parse_file() is meant to accept streams in Perl SAX, while other - modules (such as XML::LibXML and XML::Parser) accept system paths for - this method. - </para> - <para> - Suggested solution: - To change parse_file() so that it accepts a string in addition to the - currently supported types. Alternatively, parse_file() can be considered - deprecated (though supported for compatibility) and another method - (? parse_stream) used to accept streams. - </para> - </issue> - - <issue id="I11" status="open" resolution="none" change-ref=""> - <para> - The specification should state explicitly what is meant be "streams", - what are supported types for parse_file(): file handles, - glob references, IO::Handle sub-classes, ... - </para> - <para> - Suggested solution: - To support all of the above mentioned types. - </para> - </issue> - - <issue id="I12" status="open" resolution="none" change-ref=""> - <para> - The spec should be more explicit about what a document locator is - supposed to return. It could for example read: - </para> - <para> - If possible, a Perl SAX driver should provide the line and column position - of the first character after the text associated with the document event. - The first line is line 1; the first column in each line is column 1. - </para> - </issue> - - </issue-list> - -</change-log> +<?xml version="1.0"?> +<change-log xmlns="http://sax.perl.org/changeLog"> + + <title>Perl SAX 2.1 Changes and Issues</title> + + <description> + The purpose of this file is to record changes done from Perl SAX + 2.0 and to track related issues.</description> + + <change-list> + + <change id="C1" issue-ref=""> + XMLVersion and Encoding fields added to document locator + (as in Locator2 interface of SAX 2.0 Ext. 1.1) + </change> + + <change id="C2" issue-ref="I4"> + The definition of parse() unified in the Basic and + Advanced documents. parse_uri() added. The new definition fits to + the current XML::SAX::Base implementation (as of XML::SAX v0.12). + </change> + + <change id="C3" issue-ref="I6"> + Changes in attribute_decl(): ValueDefault renamed to Mode. + The new name is less confusing and corresponds to SAX Java API. + </change> + + <change id="C4" issue-ref="I12"> + The following text has been added to define what the document locator is + supposed to return: "If possible, a Perl SAX driver should provide the line + and column position of the last character of the text associated with the + current document event. The first line is line 1; the first column in each + line is column 1." + </change> + + <change id="C5" issue-ref="I11">Hash values are Unicode strings (scalars with + UTF-8 flag on) The spec defines that a stream argument that can be provided + to parse_file() method can be either a file handle, a glob reference, + or a IO::Handle sub-class. + </change> + + <change id="C6" issue-ref="I7"> + New section "Namespace Processing" has been added. It describes + the behavior of a parser for NS processing turned off: + Element/attribute hash keys are always present, + NamespaceURI, Prefix and LocalName are undef. Attributes keys + are prefixed with {}. NS declarations are treated as common + attributes. start_prefix_mapping and end_prefix_mapping are + never called. + </change> + + <change id="C7" issue-ref="I8"> + The spec defines explicitly that values of callback argument hashrefs are + Unicode strings (scalars with UTF-8 flag on). + </change> + + </change-list> + + <issue-list> + + <issue id="I1" status="open" resolution="none" change-ref=""> + <para> + A parser should advertise SAX version it supports. There can be + a new method ($parser->get_sax_version()) or a read-only feature + (http://xmlns.perl.org/sax/version). This feature should be introduced + also to Perl SAX 2.0 retrospectively to distinguish between 1.0, 2.0 + and 2.1 drivers. + </para> + <para> + Suggestion: the read-only feature. + </para> + </issue> + + <issue id="I2" status="open" resolution="none" change-ref=""> + <para> + "http://xml.org/sax/handlers/LexicalHandler" feature on the parser + needs to be set to the object to receive lexical events currently. If + the reader does not support lexical events, it will throw + a XML::SAX::Exception::NotRecognized or a + XML::SAX::Exception::NotSupported when you attempt to register the + handler. DeclHandler works in the same way. Actually, this is a theory + - XML::SAX::Base doesn't implement this currently. + </para> + <para> + This approach is very different from the common PerlSAX mechanism: + look for a specific handler, then look for a handler method on the + default handler, ignore the callback when not found. It would be more + 'perlish' to apply this simple mechanism to LexicalHandler and + DeclHandler too. If we want these two be extension handlers (compliant + 2.1 parsers are not required to support them) there could be read-only + features to let apps to know whether extension handlers are supported + o not (http://xmlns.perl.org/sax/LexicalHandler, DeclHandler). + </para> + <para> + Suggestion: LexicalHandler and DeclHandler are set using the + parser properties with the same name. The two read-only features, + (http://xmlns.perl.org/sax/LexicalHandler, DeclHandler) return + 0 or 1 to indicate whether the parser support these two interfaces. + </para> + </issue> + + <issue id="I3" status="open" resolution="none" change-ref=""> + <para> + SAX 2.0 Ext. 1.1 has a new Attributes2 interface which extends + attributes with new properties (Declared, Specified) to distinguish + between attributed specified in an XML doc and those declared in + DTD. This could be introduced into Perl SAX 2.1 as an optional + extension (advertised by a feature). + </para> + <para> + Suggestion: not to apply. + </para> + </issue> + + <issue id="I4" status="decided" resolution="applied" change-ref="C2"> + <para> + The parse() method is defined in different ways in the Basic and + Advanced documents. + Proposed solution: to add an explicit parse_uri() method, parse() + would call either parse_uri(), parse_string(), or parse_stream() + based on InputSource. + </para> + </issue> + + <issue id="I5" status="open" resolution="none" change-ref=""> + <para> + All hash references could be replaced with blessed classes. Need to + clarify what would be benefits of such change. + </para> + <para> + Suggestion: not to apply. + </para> + </issue> + + <issue id="I6" status="decided" resolution="applied" change-ref="C3"> + <para> + Changes in attribute_decl + eName, aName, Type, Mode (was ValueDefault), Value + </para> + </issue> + + <issue id="I7" status="decided" resolution="applied" change-ref="C6"> + <para> + The effect of turning off namespace processing is unclear in Perl SAX. + The spec should state that all namespace-related processing is skipped, + and no namespace-related information is made available. + </para> + <para> + Suggestion: All node keys are always present, NamespaceURI, Prefix and + LocalName are undef. Attributes keys are prefixed with {} (for example + {}pfx:lname). NS declarations are treated as common attributes. + </para> + </issue> + + <issue id="I8" status="decided" resolution="applied" change-ref="C7"> + <para> + Perl SAX should require explicitly all event data to be Unicode strings + (to have the UTF-8 flag on). + </para> + </issue> + + <issue id="I9" status="open" resolution="none" change-ref=""> + <para> + Input sources don't have a String property defined though the + parse_string() method exists and use it. Current XML::SAX::Base version + (0.12) already implements String property. The properties are checked in + this order: CharacterStream, ByteStream, String, SystemId. + </para> + <para> + Suggested solution: To add the following paragraph: + </para> + <para> + String - The character or byte string for this input source. + If there is a string specified, the SAX parser will ignore any byte + or character stream and will not attempt to open a URI connection to + the system identifier. + If the UTF-8 flag of the string is turned on, the effect is as if + the Encoding property is set to UTF-8. + </para> + <para> + The order of properties to be checked has to be determined. + </para> + </issue> + + <issue id="I10" status="open" resolution="none" change-ref=""> + <para> + parse_file() is meant to accept streams in Perl SAX, while other + modules (such as XML::LibXML and XML::Parser) accept system paths for + this method. + </para> + <para> + Suggested solution: + To change parse_file() so that it accepts a system path in addition to the + currently supported types. + </para> + </issue> + + <issue id="I11" status="decided" resolution="applied" change-ref="C5"> + <para> + The specification should state explicitly what is meant be "streams", + what are supported types for parse_file(): file handles, + glob references, IO::Handle sub-classes, ... + </para> + <para> + Suggested solution: + To support all of the above mentioned types. + </para> + </issue> + + <issue id="I12" status="decided" resolution="applied" change-ref="C4"> + <para> + The spec should be more explicit about what a document locator is + supposed to return. It could for example read: + </para> + <para> + If possible, a Perl SAX driver should provide the line and column position + of the first character after the text associated with the document event. + The first line is line 1; the first column in each line is column 1. + </para> + </issue> + + <issue id="I13" status="open" resolution="none" change-ref=""> + <para> + The value of the Encoding property of Input Sources should be able to override + the encoding value specified in the xml declaration. The spec should state this + explicitly, if so. + </para> + <para> + Suggestion: to add the following text: If available, the value + of Encoding property has a higher priority than encoding + specified in an XML declaration. + + </para> + </issue> + + </issue-list> + +</change-log> Index: changes.css =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- changes.css 25 Oct 2004 09:22:38 -0000 1.2 +++ changes.css 11 Jan 2005 14:34:29 -0000 1.3 @@ -1,23 +1,23 @@ -p { - padding: 2px 5px 2px 5px; -} - -.change { - border: solid 1px #999999; - background-color: #bbeeff; -} - -.open { - border: solid 1px #999999; - background-color: #ffbbbb; -} - -.decided { - border: solid 1px #999999; - background-color: #bbffbb; -} - -.closed { - border: solid 1px #999999; - background-color: #bbbbff; -} +p { + padding: 2px 5px 2px 5px; +} + +.change { + border: solid 1px #999999; + background-color: #bbeeff; +} + +.open { + border: solid 1px #999999; + background-color: #ffbbbb; +} + +.decided { + border: solid 1px #999999; + background-color: #bbffbb; +} + +.closed { + border: solid 1px #999999; + background-color: #bbbbff; +} Index: changes.xsl =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- changes.xsl 27 Sep 2004 09:03:18 -0000 1.1 +++ changes.xsl 11 Jan 2005 14:34:29 -0000 1.2 @@ -1,85 +1,85 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xsl:stylesheet version="1.0" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:chg="http://sax.perl.org/changeLog" - xmlns="http://www.w3.org/1999/xhtml" - exclude-result-prefixes="chg"> - - <xsl:output method="xhtml" - doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" - doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> - - <xsl:template match="/chg:change-log"> - <html> - <head> - <title>Perl SAX 2.1 Changes and Issues</title> - <link href="changes.css" rel="STYLESHEET" type="text/css"/> - </head> - <body> - <h1>Perl SAX 2.1 Changes and Issues</h1> - <p> - The development of - <a href="http://perl-xml.sourceforge.net/perl-sax/">Perl SAX 2.1</a> - API is in progress. Comments should be sent to Perl-XML mailing list - (per...@li...). - </p> - <h2>Changes from Perl SAX 2.0</h2> - <xsl:apply-templates select="chg:change-list/chg:change"/> - <h2>Summary of Issues</h2> - <xsl:apply-templates select="chg:issue-list/chg:issue"/> - </body> - </html> - </xsl:template> - - <xsl:template match="chg:change"> - <p class="change"> - <b> - <xsl:text>Change </xsl:text> - <a name="{@id}"> - <xsl:value-of select="@id"/> - </a> - </b> - <i> - <xsl:if test="@issue-ref != ''"> - <xsl:text> [resolves issue </xsl:text> - <a href="#{@issue-ref}"> - <xsl:value-of select="@issue-ref"/> - </a> - <xsl:text>]</xsl:text> - </xsl:if> - </i> - <br /> - <xsl:value-of select="text()"/> - </p> - </xsl:template> - - <xsl:template match="chg:issue"> - <p class="{@status}"> - <b> - <xsl:text>Issue </xsl:text> - <a name="{@id}"> - <xsl:value-of select="@id"/> - </a> - </b> - <i> - <xsl:text> status: </xsl:text> - <xsl:value-of select="@status"/> - <xsl:text>, resolution: </xsl:text> - <xsl:value-of select="@resolution"/> - <xsl:if test="@change-ref != ''"> - <xsl:text> [resolved as change </xsl:text> - <a href="#{@change-ref}"> - <xsl:value-of select="@change-ref"/> - </a> - <xsl:text>]</xsl:text> - </xsl:if> - </i> - <br /> - <xsl:for-each select="chg:para"> - <xsl:value-of select="text()"/> - <br /> - </xsl:for-each> - </p> - </xsl:template> - -</xsl:stylesheet> +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:chg="http://sax.perl.org/changeLog" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="chg"> + + <xsl:output method="xhtml" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> + + <xsl:template match="/chg:change-log"> + <html> + <head> + <title>Perl SAX 2.1 Changes and Issues</title> + <link href="changes.css" rel="STYLESHEET" type="text/css"/> + </head> + <body> + <h1>Perl SAX 2.1 Changes and Issues</h1> + <p> + The development of + <a href="http://perl-xml.sourceforge.net/perl-sax/">Perl SAX 2.1</a> + API is in progress. Comments should be sent to Perl-XML mailing list + (per...@li...). + </p> + <h2>Changes from Perl SAX 2.0</h2> + <xsl:apply-templates select="chg:change-list/chg:change"/> + <h2>Summary of Issues</h2> + <xsl:apply-templates select="chg:issue-list/chg:issue"/> + </body> + </html> + </xsl:template> + + <xsl:template match="chg:change"> + <p class="change"> + <b> + <xsl:text>Change </xsl:text> + <a name="{@id}"> + <xsl:value-of select="@id"/> + </a> + </b> + <i> + <xsl:if test="@issue-ref != ''"> + <xsl:text> [resolves issue </xsl:text> + <a href="#{@issue-ref}"> + <xsl:value-of select="@issue-ref"/> + </a> + <xsl:text>]</xsl:text> + </xsl:if> + </i> + <br /> + <xsl:value-of select="text()"/> + </p> + </xsl:template> + + <xsl:template match="chg:issue"> + <p class="{@status}"> + <b> + <xsl:text>Issue </xsl:text> + <a name="{@id}"> + <xsl:value-of select="@id"/> + </a> + </b> + <i> + <xsl:text> status: </xsl:text> + <xsl:value-of select="@status"/> + <xsl:text>, resolution: </xsl:text> + <xsl:value-of select="@resolution"/> + <xsl:if test="@change-ref != ''"> + <xsl:text> [resolved as change </xsl:text> + <a href="#{@change-ref}"> + <xsl:value-of select="@change-ref"/> + </a> + <xsl:text>]</xsl:text> + </xsl:if> + </i> + <br /> + <xsl:for-each select="chg:para"> + <xsl:value-of select="text()"/> + <br /> + </xsl:for-each> + </p> + </xsl:template> + +</xsl:stylesheet> Index: index.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- index.html 27 Sep 2004 09:03:18 -0000 1.5 +++ index.html 11 Jan 2005 14:34:29 -0000 1.6 @@ -1,47 +1,47 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Perl SAX</title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link href="perl-sax.css" rel="STYLESHEET" type="text/css" /> - </head> - <body> - <div class="Header"> - <div class="Title">Perl SAX (Simple API for XML) Page</div> - This is the current Perl SAX page. The former official - <a href="http://sax.perl.org">Perl SAX page</a> is no more - maintained for various reasons. - Perl SAX is a part of - the <a href="http://perl-xml.sourceforge.net/">Perl XML Project</a> - hosted by <a href="http://www.sourceforge.net/">Sourceforge</a>. - </div> - <div> - <div class="SubTitle">Perl SAX 2.0</div> - Current stable version of Perl SAX is 2.0. The API is defined - by the following documents: - <ul> - <li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/perl-xml/libxml-perl/doc/sax-2.0.html?rev=HEAD&content-type=text/html">Perl - SAX 2.0 Binding</a></li> - <li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/perl-xml/libxml-perl/doc/sax-2.0-adv.html?rev=HEAD&content-type=text/html">Perl - SAX 2.0 Advanced</a></li> - </ul> - </div> - <div> - <div class="SubTitle">Perl SAX 2.1</div> - The version 2.1 is under development: - <ul> - <li><a href="sax-2.1.html">Perl SAX 2.1 Binding</a></li> - <li><a href="sax-2.1-adv.html">Perl SAX 2.1 Advanced</a></li> - <li><a href="sax-2.1-ref.html">Perl SAX 2.1 Reference</a> (an indexed view of the two above docs)</li> - <li><a href="changes-2.1.html">Changes and Issues</a></li> - </ul> - </div> - <div> - <div class="SubTitle">Related Pages</div> - <ul> - <li><a href="http://www.saxproject.org/">Official SAX Page</a></li> - </ul> - </div> - - </body> -</html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>Perl SAX</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <link href="perl-sax.css" rel="STYLESHEET" type="text/css" /> + </head> + <body> + <div class="Header"> + <div class="Title">Perl SAX (Simple API for XML) Page</div> + This is the current Perl SAX page. The former official + <a href="http://sax.perl.org">Perl SAX page</a> is no more + maintained for various reasons. + Perl SAX is a part of + the <a href="http://perl-xml.sourceforge.net/">Perl XML Project</a> + hosted by <a href="http://www.sourceforge.net/">Sourceforge</a>. + </div> + <div> + <div class="SubTitle">Perl SAX 2.0</div> + Current stable version of Perl SAX is 2.0. The API is defined + by the following documents: + <ul> + <li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/perl-xml/libxml-perl/doc/sax-2.0.html?rev=HEAD&content-type=text/html">Perl + SAX 2.0 Binding</a></li> + <li><a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/perl-xml/libxml-perl/doc/sax-2.0-adv.html?rev=HEAD&content-type=text/html">Perl + SAX 2.0 Advanced</a></li> + </ul> + </div> + <div> + <div class="SubTitle">Perl SAX 2.1</div> + The version 2.1 is under development: + <ul> + <li><a href="sax-2.1-ref.html"><b>Perl SAX 2.1 Reference</b></a> (an indexed view of the two following docs)</li> + <li><a href="sax-2.1.html">Perl SAX 2.1 Binding</a></li> + <li><a href="sax-2.1-adv.html">Perl SAX 2.1 Advanced</a></li> + <li><a href="changes-2.1.html">Changes and Issues</a></li> + </ul> + </div> + <div> + <div class="SubTitle">Related Pages</div> + <ul> + <li><a href="http://www.saxproject.org/">Official SAX Page</a></li> + </ul> + </div> + + </body> +</html> Index: sax-2.1-adv.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1-adv.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sax-2.1-adv.html 25 Oct 2004 09:27:14 -0000 1.4 +++ sax-2.1-adv.html 11 Jan 2005 14:34:29 -0000 1.5 @@ -1,1024 +1,1028 @@ -<!-- $Id$ --> -<html> -<head> -<title>Advanced Features of the Perl SAX 2.1 Binding</title> -<meta name="keywords" content="XML SGML SAX Perl libxml libxml-perl" /> -<style type="text/css"> -.prop { - font-family: monospace; - font-weight: bold; - vertical-align: top; - padding-right: 1em; [...2021 lines suppressed...] +<li><tt>parse()</tt> methods return the value returned by calling the +<tt>end_document()</tt> handler.</li> + +<li> + Method names have been converted to lower-case with underscores. + Parameters are all mixed case with initial upper-case. +</li> +</ul> + +<p> + If compatibility is a problem for you consider writing a Filter that + converts from this style to the one you want. It is likely that such + a Filter will be available from CPAN in the not distant future. +</p> + + +<div>$Revision$</div> +<div>$Date$</div> +</body> +</html> Index: sax-2.1-idx.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1-idx.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sax-2.1-idx.html 25 Oct 2004 09:27:14 -0000 1.5 +++ sax-2.1-idx.html 11 Jan 2005 14:34:29 -0000 1.6 @@ -1,206 +1,226 @@ -<!-- $Id$ --> -<html> - <head> - <title>Perl SAX 2.1</title> - <style type="text/css"> - a {text-decoration:none} - div {font-size: 14px; color: #777777;} - div.box {padding:4px 2px 4px 2px; - margin:0px 0px 10px 0px; - border:1px solid #777777;} - div.title {font-size:16px; font-weight:bold; float:left; - padding:0px 0px 0px 2px;} - div.item {padding: 1px 0px 0px 10px; clear:left;} - div.right {float:right; padding:0px 5px 0px 0px;} - </style> - </head> - <body> - -<div class="box" style="background-color:#eeeeee"> - <div class="title">Perl SAX 2.1</div> - <div class="right">[<a target="_top" href="http://perl-xml.sourceforge.net/perl-sax/">home</a>]</div> - <div class="item"> - <a href="#parser">Parser</a> - </div> - <div class="item"> - <a href="#content">ContentHandler</a> - </div> - <div class="item"> - <a href="#dtd">DTDHandler</a> - </div> - <div class="item"> - <a href="#error">ErrorHandler</a> - </div> - <div class="item"> - <a href="#resolver">Entity Resolver</a> - </div> - <div class="item"> - <a href="#lexical">LexicalHandler</a> - </div> - <div class="item"> - <a href="#decl">DeclHandler</a> - </div> - <div class="item"> - <a href="#other">other objects</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="parser"/>Parser</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1.html?#parse" target="cnt">parse()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#parseURI" target="cnt">parse_uri()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#parseFile" target="cnt">parse_file()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#parseString" target="cnt">parse_string()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#getFeature" target="cnt">get_feature()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#setFeature" target="cnt">set_feature()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#getFeatures" target="cnt">get_features()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="content"/>ContentHandler</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#setDocumentLocator" target="cnt">set_document_locator()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#startDocument" target="cnt">start_document()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#endDocument" target="cnt">end_document()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#startElement" target="cnt">start_element()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#endElement" target="cnt">end_element()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#characters" target="cnt">characters()</a> - </div> - <div class="item"> - <a href="sax-2.1.html?#ignorableWhitespace" target="cnt">ignorable_whitespace()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#startPrefixMapping" target="cnt">start_prefix_mapping()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#endPrefixMapping" target="cnt">end_prefix_mapping()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#processingInstruction" target="cnt">processing_instruction()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#skippedEntity" target="cnt">skipped_entity()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="dtd"/>DTDHandler</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#notationDecl" target="cnt">notation_decl()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#unparsedEntity" target="cnt">unparsed_entity_decl()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="error"/>ErrorHandler</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#warning" target="cnt">warning()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#error" target="cnt">error()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#fatalError" target="cnt">fatal_error()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="resolver"/>EntityResolver</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#resolveEntity" target="cnt">resolve_entity()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="lexical"/>LexicalHandler</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#startDTD" target="cnt">start_dtd()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#endDTD" target="cnt">end_dtd()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#startEntity" target="cnt">start_entity()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#endEntity" target="cnt">end_entity()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#startCDATA" target="cnt">start_cdata()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#endCDATA" target="cnt">end_cdata()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#comment" target="cnt">comment()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="decl"/>DeclHandler</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1-adv.html?#elementDecl" target="cnt">element_decl()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#attributeDecl" target="cnt">attribute_decl()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#internalEntityDecl" target="cnt">internal_entity_decl()</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#externalEntityDecl" target="cnt">external_entity_decl()</a> - </div> -</div> - -<div class="box"> - <div class="title"><a name="other"/>other objects</div> - <div class="right">[<a href="#top">top</a>]</div> - <div class="item"> - <a href="sax-2.1.html?#Exceptions" target="cnt">Exceptions</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#InputSources" target="cnt">Input Sources</a> - </div> - <div class="item"> - <a href="sax-2.1-adv.html?#Features" target="cnt">Features</a> - </div> -</div> - -<div>$Revision$</div> -<div>$Date$</div> - - </body> -</html> +<!-- $Id$ --> +<html> + <head> + <title>Perl SAX 2.1</title> + <style type="text/css"> + a {text-decoration:none} + div {font-size: 14px; color: #777777;} + div.box {padding:4px 2px 4px 2px; + margin:0px 0px 10px 0px; + border:1px solid #777777;} + div.title {font-size:16px; font-weight:bold; float:left; + padding:0px 0px 0px 2px;} + div.item {padding: 1px 0px 0px 10px; clear:left;} + div.right {float:right; padding:0px 5px 0px 0px;} + </style> + </head> + <body> + +<div class="box"> + <div class="title">Perl SAX 2.1</div> + <div class="right">[<a target="_top" href="http://perl-xml.sourceforge.net/perl-sax/">home</a>]</div> + <div class="item"> + <a href="sax-2.1.html" target="cnt">Introduction</a> + </div> + <div class="item"> + <a href="sax-2.1.html#nsProcessing" target="cnt">Namespace Processing</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html#Parsers" target="cnt">SAX Parsers</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html#Filters" target="cnt">SAX Filters</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html#Java" target="cnt">Java Compatibility</a> + </div> +</div> + +<div class="box" style="background-color:#eeeeee"> + <div class="title">Interfaces</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="#parser">Parser</a> + </div> + <div class="item"> + <a href="#content">ContentHandler</a> + </div> + <div class="item"> + <a href="#dtd">DTDHandler</a> + </div> + <div class="item"> + <a href="#error">ErrorHandler</a> + </div> + <div class="item"> + <a href="#resolver">Entity Resolver</a> + </div> + <div class="item"> + <a href="#lexical">LexicalHandler</a> + </div> + <div class="item"> + <a href="#decl">DeclHandler</a> + </div> + <div class="item"> + <a href="#other">other objects</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="parser"/>Parser</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1.html?#parse" target="cnt">parse()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#parseURI" target="cnt">parse_uri()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#parseFile" target="cnt">parse_file()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#parseString" target="cnt">parse_string()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#getFeature" target="cnt">get_feature()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#setFeature" target="cnt">set_feature()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#getFeatures" target="cnt">get_features()</a> + </div>sax-2.1.html +</div> + +<div class="box"> + <div class="title"><a name="content"/>ContentHandler</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#setDocumentLocator" target="cnt">set_document_locator()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#startDocument" target="cnt">start_document()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#endDocument" target="cnt">end_document()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#startElement" target="cnt">start_element()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#endElement" target="cnt">end_element()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#characters" target="cnt">characters()</a> + </div> + <div class="item"> + <a href="sax-2.1.html?#ignorableWhitespace" target="cnt">ignorable_whitespace()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#startPrefixMapping" target="cnt">start_prefix_mapping()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#endPrefixMapping" target="cnt">end_prefix_mapping()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#processingInstruction" target="cnt">processing_instruction()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#skippedEntity" target="cnt">skipped_entity()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="dtd"/>DTDHandler</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#notationDecl" target="cnt">notation_decl()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#unparsedEntity" target="cnt">unparsed_entity_decl()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="error"/>ErrorHandler</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#warning" target="cnt">warning()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#error" target="cnt">error()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#fatalError" target="cnt">fatal_error()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="resolver"/>EntityResolver</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#resolveEntity" target="cnt">resolve_entity()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="lexical"/>LexicalHandler</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#startDTD" target="cnt">start_dtd()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#endDTD" target="cnt">end_dtd()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#startEntity" target="cnt">start_entity()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#endEntity" target="cnt">end_entity()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#startCDATA" target="cnt">start_cdata()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#endCDATA" target="cnt">end_cdata()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#comment" target="cnt">comment()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="decl"/>DeclHandler</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1-adv.html?#elementDecl" target="cnt">element_decl()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#attributeDecl" target="cnt">attribute_decl()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#internalEntityDecl" target="cnt">internal_entity_decl()</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#externalEntityDecl" target="cnt">external_entity_decl()</a> + </div> +</div> + +<div class="box"> + <div class="title"><a name="other"/>other objects</div> + <div class="right">[<a href="#top">top</a>]</div> + <div class="item"> + <a href="sax-2.1.html?#Exceptions" target="cnt">Exceptions</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#InputSources" target="cnt">Input Sources</a> + </div> + <div class="item"> + <a href="sax-2.1-adv.html?#Features" target="cnt">Features</a> + </div> +</div> + +<div>$Revision$</div> +<div>$Date$</div> + + </body> +</html> Index: sax-2.1-ref.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1-ref.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sax-2.1-ref.html 6 Aug 2004 10:23:38 -0000 1.3 +++ sax-2.1-ref.html 11 Jan 2005 14:34:29 -0000 1.4 @@ -1,11 +1,11 @@ -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> -<frameset cols="225, *"> - <noframes> - <a href="sax-2.1.html">Perl SAX 2.1 Binding</a> - </noframes> - <frame name="idx" id="idx" src="sax-2.1-idx.html" /> - <frame name="cnt" id="cnt"src="sax-2.1.html" /> -</frameset> - +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> +<frameset cols="225, *"> + <noframes> + <a href="sax-2.1.html">Perl SAX 2.1 Binding</a> + </noframes> + <frame name="idx" id="idx" src="sax-2.1-idx.html" /> + <frame name="cnt" id="cnt"src="sax-2.1.html" /> +</frameset> + Index: sax-2.1.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sax-2.1.html 25 Oct 2004 09:27:14 -0000 1.4 +++ sax-2.1.html 11 Jan 2005 14:34:29 -0000 1.5 @@ -1,381 +1,405 @@ -<!-- $Id$ --> -<html> -<head> -<title>Perl SAX 2.1 Binding</title> -</head> -<body> - -<h1>Perl SAX 2.1 Binding</h1> - -<p>SAX (Simple API for XML) is a common parser interface for XML -parsers. It allows application writers to write applications that use -XML parsers, but are independent of which parser is actually used.</p> - -<p>This document describes the version of SAX used by Perl modules. -The original version of SAX 2.0, for Java, is described at <a -href="http://sax.sourceforge.net/">http://sax.sourceforge.net/</a>.</p> - -<p>There are two basic interfaces in the Perl version of SAX, the -parser interface and the handler interface. The parser interface -creates new parser instances, starts parsing, and provides additional -information to handlers on request. The handler interface is used to -receive parse events from the parser. This pattern is also commonly -called "Producer and Consumer" or "Generator and Sink". Note that the -parser doesn't have to be an XML parser, all it needs to do is provide -a stream of events to the handler as if it were parsing XML. But the -actual data from which the events are generated can be anything, a Perl -object, a CSV file, a database table... -</p> - -<p>SAX is typically used like this: - -<pre> - my $handler = MyHandler->new(); - my $parser = AnySAXParser->new( Handler => $handler ); - $parser->parse($uri); -</pre></p> - -<p>Handlers are typically written like this: - -<pre> - package MyHandler; - - sub new { - my $type = shift; - return bless {}, $type; - } - - sub start_element { - my ($self, $element) = @_; - - print "Starting element $element->{Name}\n"; - } - - sub end_element { - my ($self, $element) = @_; - - print "Ending element $element->{Name}\n"; - } - - sub characters { - my ($self, $characters) = @_; - - print "characters: $characters->{Data}\n"; - } - - 1; -</pre></p> - -<h2>Basic SAX Parser</h2> - -<p>These methods and options are the most commonly used with SAX -parsers and event generators.</p> - -<p>Applications may not invoke a <tt>parse()</tt> method again while a -parse is in progress (they should create a new SAX parser instead for -each nested XML document). Once a parse is complete, an application -may reuse the same parser object, possibly with a different input -source.</p> - -<p>During the parse, the parser will provide information about the XML -document through the registered event handlers. Note that an event that -hasn't been registered (ie that doesn't have its corresponding method in -the handler's class) will <b>not</b> be called. This allows one to only -get the events one is interested in. -</p> - -<p>If you generate SAX events, data are required to be passed to -handler methods with all properties defined in this document -unless otherwise specified. -</p> - -<p><a name="parseURI"/> -<dl><dt><b><tt class='function'>parse_uri</tt></b>(<var>uri</var> [, <var>options</var>])</dt> -<dd> -Parses the XML instance identified by <var>uri</var> (a system -identifier). <var>options</var> can be a list of options, value pairs -or a hash (reference). Options include <tt>Handler</tt>, features and properties, -and advanced SAX parser options. <tt>parse_uri()</tt> returns the result -of calling the <tt>end_document()</tt> handler. The options supported -by <tt>parse_uri()</tt> may vary slightly if what is being "parsed" isn't -XML. -</dd></dl></p> - -<p><a name="parseFile"/> -<dl><dt><b><tt class='function'>parse_file</tt></b>(<var>stream</var> [, <var>options</var>])</dt> -<dd> -Parses the XML instance in the already opened <var>stream</var>, an -IO::Handler or similar. <var>options</var> are the same as for <tt -class='function'>parse()</tt>. <tt>parse_file()</tt> returns the result -of calling the <tt>end_document()</tt> handler.</dd></dl></p> - -<p><a name="parseString"/> -<dl><dt><b><tt class='function'>parse_string</tt></b>(<var>string</var> [, <var>options</var>])</dt> -<dd> -Parses the XML instance in <var>string</var>. <var>options</var> are -the same as for <tt class='function'>parse()</tt>. -<tt>parse_string()</tt> returns the result of calling the -<tt>end_document()</tt> handler.</dd></dl></p> - -<p><a name="parse"/> -<dl><dt><b><tt class='function'>parse</tt></b>([<var>options</var>])</dt> -<dd> -This is a generic method that calls one of the above methods based on -the <tt>Source</tt> option. <var>options</var> can be a list of -options, value pairs or a hash (reference).</dd></dl> -</p> - -<p> -<dl><dt><b><tt>Handler</tt></b></dt> -<dd> -The default handler object to receive all events from the parser. -Applications may change <tt>Handler</tt> in the middle of the parse -and the SAX parser will begin using the new handler -immediately. The <a href="sax-2.1-adv.html">Advanced SAX</a> document -lists a number of more specialized handlers that can be used should you -wish to dispatch different types of events to different objects. -</dd></dl></p> - -<h2><a name="BasicHandler">Basic SAX Handler</a></h2> - -<p>These methods are the most commonly used by SAX handlers.</p> - -<p><a name="startDocument"/> -<dl><dt><b><tt class='function'>start_document</tt></b>(<var>document</var>)</dt> -<dd> -Receive notification of the beginning of a document.</p> - -<p>The SAX parser will invoke this method only once, before any other -methods (except for <tt>set_document_locator()</tt> in advanced SAX -handlers). - -No properties are defined for this event (<var>document</var> is -empty).</dd></dl></p> - -<p><a name="endDocument"/> -<dl><dt><b><tt class='function'>end_document</tt></b>(<var>document</var>)</dt> -<dd> -Receive notification of the end of a document. - -<p>The SAX parser will invoke this method only once, and it will be -the last method invoked during the parse. The parser shall not invoke -this method until it has either abandoned parsing (because of an -unrecoverable error) or reached the end of input.</p> - -<p>No properties are defined for this event (<var>document</var> is -empty).</p> - -The return value of <tt>end_document()</tt> is returned by the -parser's <tt>parse()</tt> methods.</dd></dl></p> - -<p><a name="startElement"/> -<dl><dt><b><tt class='function'>start_element</tt></b>(<var>element</var>)</dt> -<dd> -Receive notification of the start of an element. - -<p>The Parser will invoke this method at the beginning of every -element in the XML document; there will be a corresponding -<tt>end_element()</tt> event for every <tt>start_element()</tt> event (even when the -element is empty). All of the element's content will be reported, in -order, before the corresponding <tt>end_element()</tt> event.</p> - -<var>element</var> is a hash reference with these properties: - -<blockquote> -<table> -<tr><td><b><tt>Name</tt></b></td> -<td>The element type name (including prefix).</td></tr> -<tr><td><b><tt>Attributes</tt></b></td> -<td>The attributes attached to the element, if any.</td></tr> -</table> -</blockquote> - -If namespace processing is turned on (which is the default), these -properties are also available: - -<blockquote> -<table> -<tr><td><b><tt>NamespaceURI</tt></b></td> -<td>The namespace of this element.</td></tr> -<tr><td><b><tt>Prefix</tt></b></td> -<td>The namespace prefix used on this element.</td></tr> -<tr><td><b><tt>LocalName</tt></b></td> -<td>The local name of this element.</td></tr> -</table> -</blockquote> - -<tt>Attributes</tt> is a reference to hash keyed by JClark namespace -notation. That is, the keys are of the form "{NamespaceURI}LocalName". -If the attribute has no NamespaceURI, then it is simply "{}LocalName". -Each attribute is a hash reference with these properties: - -<blockquote> -<table> -<tr><td><b><tt>Name</tt></b></td> -<td>The attribute name (including prefix).</td></tr> -<tr><td><b><tt>Value</tt></b></td> -<td>The normalized value of the attribute.</td></tr> -<tr><td><b><tt>NamespaceURI</tt></b></td> -<td>The namespace of this attribute.</td></tr> -<tr><td><b><tt>Prefix</tt></b></td> -<td>The namespace prefix used on this attribute.</td></tr> -<tr><td><b><tt>LocalName</tt></b></td> -<td>The local name of this attribute.</td></tr> -</table> -</blockquote> -</dd> -</dl> -</p> - -<p><a name="endElement"/> -<dl><dt><b><tt class='function'>end_element</tt></b>(<var>element</var>)</dt> -<dd> -Receive notification of the end of an element. - -<p>The SAX parser will invoke this method at the end of every element -in the XML document; there will be a corresponding <tt -class='function'>start_element()</tt> event for every <tt -class='function'>end_element()</tt> event (even when the element is -empty).</p> - -<var>element</var> is a hash reference with these properties: - -<blockquote> -<table> -<tr><td><b><tt>Name</tt></b></td> -<td>The element type name (including prefix).</td></tr> -</table> -</blockquote> - -If namespace processing is turned on (which is the default), these -properties are also available: - -<blockquote> -<table> -<tr><td><b><tt>NamespaceURI</tt></b></td> -<td>The namespace of this element.</td></tr> -<tr><td><b><tt>Prefix</tt></b></td> -<td>The namespace prefix... [truncated message content] |