From: Petr C. <pci...@us...> - 2005-03-15 16:11:56
|
Update of /cvsroot/perl-xml/sax-perl-org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6297 Modified Files: changes-2.1.html changes-2.1.xml sax-2.1-adv.html sax-2.1-idx.html sax-2.1.html Log Message: Index: changes-2.1.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes-2.1.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- changes-2.1.html 11 Feb 2005 09:05:24 -0000 1.5 +++ changes-2.1.html 15 Mar 2005 16:11:43 -0000 1.6 @@ -12,8 +12,7 @@ API is in progress. Comments should be sent to Perl-XML mailing list (per...@li...). </p> - <b>Open issues</b>: <a href="#I9">I9</a>, <a href="#I10">I10</a>, <a href="#I14">I14</a> - <h2>Changes from Perl SAX 2.0</h2> + <b>Open issues</b>: none<h2>Changes from Perl SAX 2.0</h2> <p class="change"> <b>Change <a name="C1">C1</a> </b> @@ -106,6 +105,36 @@ The spec states explicitly that the value of input source Encoding property has a higher priority than encoding specified in an XML declaration. </p> + <p class="change"> + <b>Change <a name="C11">C11</a> + </b> + <i> [resolves issue <a href="#I9">I9</a>]</i> + <br /> + The following text has been added to the InputSource definition: + "String - The character or byte string of this input source. + The SAX parser will ignore this if there is also a byte stream or + a character stream specified, but it will use the string in preference + to opening a URI connection itself. If the UTF-8 flag of the string is turned + on, the effect is as if the Encoding property is set to UTF-8." + The order properties are checked in agrees with the current XML::SAX::Base + implementation (v0.12): CharacterStream, ByteStream, String, SystemId. + </p> + <p class="change"> + <b>Change <a name="C12">C12</a> + </b> + <i> [resolves issue <a href="#I10">I10</a>]</i> + <br /> + In addition to streams, the parse_file() method also accepts system paths + to prevent possible confusion arising from the name of this method. + </p> + <p class="change"> + <b>Change <a name="C13">C13</a> + </b> + <i></i> + <br /> + The Features section has changed. All features have values of 1 or 0; the + section lists some common features. + </p> <h2>Issues</h2> <p class="applied"> <b>Issue <a name="I1">I1</a> @@ -218,10 +247,10 @@ (to have the UTF-8 flag on). <br /> </p> - <p class="none"> + <p class="applied"> <b>Issue <a name="I9">I9</a> </b> - <i> status: open, resolution: none</i> + <i> status: closed, resolution: applied [resolved as change <a href="#C11">C11</a>]</i> <br /> Input sources don't have a String property defined though the parse_string() method exists and use it. Current XML::SAX::Base version @@ -240,10 +269,10 @@ The order of properties to be checked has to be determined. <br /> </p> - <p class="none"> + <p class="applied"> <b>Issue <a name="I10">I10</a> </b> - <i> status: open, resolution: none</i> + <i> status: closed, resolution: applied [resolved as change <a href="#C12">C12</a>]</i> <br /> parse_file() is meant to accept streams in Perl SAX, while other modules (such as XML::LibXML and XML::Parser) accept system paths for @@ -294,16 +323,17 @@ specified in an XML declaration. <br /> </p> - <p class="none"> + <p class="denied"> <b>Issue <a name="I14">I14</a> </b> - <i> status: open, resolution: none</i> + <i> status: closed, resolution: denied</i> <br /> Parsers report an error when the parse() method is called and no input source (Source option) is provided, regardless on the method's argument. <br /> - Suggestion: Parsers should try to call the parse_uri() with the provided - argument. Only if there is no argument available the error is issued. + Suggestion: not to apply. It will be sufficient to provide a better error + message from XML::SAX::Base (e.g. to suggest than one may likely want to + call parse_uri() or parse_string() instead of parse().) <br /> </p> </body> Index: changes-2.1.xml =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/changes-2.1.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- changes-2.1.xml 11 Feb 2005 09:05:25 -0000 1.5 +++ changes-2.1.xml 15 Mar 2005 16:11:43 -0000 1.6 @@ -71,6 +71,27 @@ has a higher priority than encoding specified in an XML declaration. </change> + <change id="C11" issue-ref="I9"> + The following text has been added to the InputSource definition: + "String - The character or byte string of this input source. + The SAX parser will ignore this if there is also a byte stream or + a character stream specified, but it will use the string in preference + to opening a URI connection itself. If the UTF-8 flag of the string is turned + on, the effect is as if the Encoding property is set to UTF-8." + The order properties are checked in agrees with the current XML::SAX::Base + implementation (v0.12): CharacterStream, ByteStream, String, SystemId. + </change> + + <change id="C12" issue-ref="I10"> + In addition to streams, the parse_file() method also accepts system paths + to prevent possible confusion arising from the name of this method. + </change> + + <change id="C13" issue-ref=""> + The Features section has changed. All features have values of 1 or 0; the + section lists some common features. + </change> + </change-list> <issue-list> @@ -176,7 +197,7 @@ </para> </issue> - <issue id="I9" status="open" resolution="none" change-ref=""> + <issue id="I9" status="closed" resolution="applied" change-ref="C11"> <para> Input sources don't have a String property defined though the parse_string() method exists and use it. Current XML::SAX::Base version @@ -199,7 +220,7 @@ </para> </issue> - <issue id="I10" status="open" resolution="none" change-ref=""> + <issue id="I10" status="closed" resolution="applied" change-ref="C12"> <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 @@ -249,14 +270,15 @@ </para> </issue> - <issue id="I14" status="open" resolution="none" change-ref=""> + <issue id="I14" status="closed" resolution="denied" change-ref=""> <para> Parsers report an error when the parse() method is called and no input source (Source option) is provided, regardless on the method's argument. </para> <para> - Suggestion: Parsers should try to call the parse_uri() with the provided - argument. Only if there is no argument available the error is issued. + Suggestion: not to apply. It will be sufficient to provide a better error + message from XML::SAX::Base (e.g. to suggest than one may likely want to + call parse_uri() or parse_string() instead of parse().) </para> </issue> Index: sax-2.1-adv.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1-adv.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sax-2.1-adv.html 11 Feb 2005 09:05:25 -0000 1.6 +++ sax-2.1-adv.html 15 Mar 2005 16:11:43 -0000 1.7 @@ -140,7 +140,7 @@ <p>Features can be passed as options when creating a parser or calling a <tt>parse()</tt> method. They may also be set using the -set_feature(). +<var>set_feature()</var> method. </p> <pre> @@ -159,53 +159,70 @@ </pre> <p> - When performing namespace processing, Perl SAX parsers always provide - both the raw tag name in <tt>Name</tt> and the namespace names in - <tt>NamespaceURI</tt>, <tt>LocalName</tt>, and <tt>Prefix</tt>. - Therefore, the - "<tt>http://xml.org/sax/features/namespace-prefixes</tt>" Feature is - ignored. + Perl SAX supports Features described in the SAX spec as well as new + ones defined for Perl. The features taken over from Java SAX have + URLs startting with <tt>http://xml.org/sax/features/</tt> and + Perl-specific features start with + <tt>http://xmlns.perl.org/sax/</tt>. Note that features are things + that are supposed to be <strong>turned on</strong>, and thus should + normally be off by default, especially if the parser doesn't support + turning them off. There may be, for good reasons, exceptions to this + rule, for example the + <tt>http://xml.org/sax/features/namespaces</tt> feature. </p> <p> - Also, Features are things that are supposed to be <strong>turned - on</strong>, and thus should normally be off by default, especially if - the parser doesn't support turning them off. Due to backward - compatibility problems, the one exception to this rule is the - "<tt>http://xml.org/sax/features/namespaces</tt>" Feature which is on by - default and which a number of parsers may not be able to turn off. Thus, - a parser claiming to support this Feature (and all SAX2 parsers must + These are some features Perl SAX drivers may support: +</p> + +<dl> +<dt class="prop">http://xml.org/sax/features/namespaces</dt> +<dd> A value of 1 indicates namespace URIs and unprefixed local names + for element and attribute names will be available. This feature is on by + default and a number of parsers may not be able to turn it off. Thus, + a parser claiming to support this feature (and all SAX2 parsers must support it) may in fact only support turning it on. See <a href="sax-2.1.html#nsProcessing">Namespace Processing</a> for - more details. -</p> + more details.</dd> +</dl> -<p>??? - In addition to the Features described in the SAX spec - itself, a number of new ones may be defined for Perl. An example of - this would be http://xmlns.perl.org/sax/node-factory which - when supported by the parser would be settable to a NodeFactory object - that would be in charge of creating SAX nodes different from those that - are normally received by event handlers. See - <a href='http://xmlns.perl.org/'>http://xmlns.perl.org/</a> (currently - in alpha state) for details on how to register Features. -</p> +<dl> +<dt class="prop">http://xml.org/sax/features/namespace-prefix</dt> +<dd>This feature is ignored as Perl SAX parsers always provide both + the raw tag name in Name and the namespace names in NamespaceURI, + LocalName, and Prefix.</dd> +</dl> -<p> - The read-only <tt>http://xmlns.perl.org/sax/version</tt> feature is - used to advertise a version of Perl SAX supported by a driver. For - drivers supporting the version of Perl SAX described in this document, - <tt>$parser->get_feature('http://xmlns.perl.org/sax/version')</tt> must - return <tt>2.1</tt>. Drivers supporting earlier versions of Perl SAX - can return <tt>1.0</tt> or <tt>2.0</tt>. -</p> +<dl> +<dt class="prop">http://xml.org/sax/features/xmlns-uris</dt> +<dd> Controls whether the parser treats namespace declaration + attributes as being in the <tt>http://www.w3.org/2000/xmlns/</tt> + namespace. By default, Perl SAX conforms to the original "Namespaces + in XML" Recommendation, which explicitly states that such attributes + are not in any namespace. Setting this optional flag to 1 makes the + Perl SAX events conform to a later backwards-incompatible revision + of that recommendation, placing those attributes in a namespace.</dd> +</dl> -<p> - The features <tt>http://xml.org/sax/handlers/LexicalHandler</tt> and - <tt>http://xml.org/sax/handlers/DeclHandler</tt> advertise if a - driver supports optional lexical and declaration handlers. Their - values are either 1 or 0. -</p> +<dl> +<dt class="prop">http://xmlns.perl.org/sax/version-2.1</dt> +<dd>This read-only feature is used to tell if a driver supports + version 2.1 of Perl SAX interface. Only drivers supporting the + version of Perl SAX described in this document have this feture set + on.</dd> +</dl> + +<dl> +<dt class="prop">http://xmlns.perl.org/sax/lexicalHandler</dt> +<dd>Tells if a driver supports optional lexical handler. Parsers may + not be able to set this feature.</dd> +</dl> + +<dl> +<dt class="prop">http://xmlns.perl.org/sax/declHandler</dt> +<dd>Tells if a driver supports optional declaration handler. Parsers may + not be able to set this feature.</dd> +</dl> <p> The following methods are used to get and set features: @@ -251,11 +268,6 @@ when the SAX parser does not recognize the feature name and <tt>XML::SAX::Exception::NotSupported</tt> when the SAX parser recognizes the feature name but cannot set the requested value. - -<p> -This method is also the standard mechanism for setting extended handlers, -such as "<code>http://xml.org/sax/handlers/DeclHandler</code>". -</p> </dd></dl></p> @@ -298,24 +310,35 @@ <dt class="prop">SystemId</dt> <dd>The system identifier (URI) of this input source. -<p>The system identifier is optional if there is a byte stream or a -character stream, but it is still useful to provide one, since the +<p>The system identifier is optional if there is a byte stream, a +character stream or a string, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a -connection to the URI only if there is no byte stream or character -stream specified).</p> +connection to the URI only if there is no byte stream, character +stream or string specified).</p> <p>If the application knows the character encoding of the object pointed to by the system identifier, it can register the encoding using the <tt>Encoding</tt> property.</p> </dd> +<dt class="prop">String</dt> +<dd>The character or byte string of this input source. + +<p>The SAX parser will ignore this if there is also a byte stream or +a character stream specified, but it will use the string in preference +to opening a URI connection itself.</p> + +<p>If the UTF-8 flag of the string is turned on, the effect is as if +the Encoding property is set to UTF-8.</p> +</dd> + <dt class="prop">ByteStream</dt> <dd>The byte stream for this input source. <p>The SAX parser will ignore this if there is also a character stream -specified, but it will use a byte stream in preference to opening a -URI connection itself.</p> +specified, but it will use a byte stream in preference to using a +string or opening a URI connection itself.</p> <p>If the application knows the character encoding of the byte stream, it should set the <tt>Encoding</tt> property.</p> @@ -325,7 +348,7 @@ <dd>The character stream for this input source. <p>If there is a character stream specified, the SAX parser will -ignore any byte stream and will not attempt to open a URI connection +ignore any byte stream or string and will not attempt to open a URI connection to the system identifier.</p> <p>Note: A CharacterStream is a file-handle that does not need any encoding Index: sax-2.1-idx.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1-idx.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sax-2.1-idx.html 11 Feb 2005 09:05:25 -0000 1.7 +++ sax-2.1-idx.html 15 Mar 2005 16:11:44 -0000 1.8 @@ -10,6 +10,7 @@ border:1px solid #777777;} div.title {font-size:16px; font-weight:bold; float:left; padding:0px 0px 0px 2px;} + div.subtitle {float:left; font-style:italic; padding:0px 0px 0px 2px;} div.item {padding: 1px 0px 0px 10px; clear:left;} div.right {float:right; padding:0px 5px 0px 0px;} </style> @@ -19,6 +20,7 @@ <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="subtitle">Revision: 2005-03-15</div> <div class="item"> <a href="sax-2.1.html" target="cnt">Introduction</a> </div> @@ -219,7 +221,5 @@ </div> </div> -<div>Revision: 05-02-11</div> - </body> </html> Index: sax-2.1.html =================================================================== RCS file: /cvsroot/perl-xml/sax-perl-org/sax-2.1.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sax-2.1.html 11 Feb 2005 09:05:25 -0000 1.6 +++ sax-2.1.html 15 Mar 2005 16:11:44 -0000 1.7 @@ -118,7 +118,10 @@ <dd> Parses the XML instance in the already opened <var>stream</var>. The stream can be either a file handle, a glob reference or a sub-class of -IO::Handle. <var>options</var> are the same as for <tt class='function'>parse()</tt>. +IO::Handle. In addition to <var>streams</var>, the <tt>parse_file</tt> +method also accepts <var>system paths</var> (as <tt>parse_uri</tt> +method does) to prevent possible confusion caused by the name of this method. +<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> |