W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: Serialization of PI misses ending question mark

From: Ian Hickson <ian@hixie.ch>
Date: Sat, 19 Sep 2009 22:06:26 +0000 (UTC)
To: "Michael A. Puls II" <shadow2531@gmail.com>
Cc: Krzysztof Maczyński <1981km@gmail.com>, public-html@w3.org
Message-ID: <Pine.LNX.4.62.0909192206010.5185@hixie.dreamhostps.com>
On Sat, 19 Sep 2009, Michael A. Puls II wrote:
> On Sat, 19 Sep 2009 16:45:05 -0400, Ian Hickson <ian@hixie.ch> wrote:
> > On Sat, 19 Sep 2009, Krzysztof Maczy�~Dski wrote:
> > > 
> > > The ED says in section 9.4:
> > > > If current node is a ProcessingInstruction
> > > >
> > > >     Append the literal string <? (U+003C LESS-THAN SIGN, U+003F QUESTION
> > > MARK), followed by the value of current node's target IDL attribute,
> > > followed by a single U+0020 SPACE character, followed by the value of
> > > current node's data IDL attribute, followed by a single U+003E
> > > GREATER-THAN SIGN character ('>').
> > > It should rather say:
> > > > If current node is a ProcessingInstruction
> > > >
> > > >     Append the literal string <? (U+003C LESS-THAN SIGN, U+003F QUESTION
> > > MARK), followed by the value of current node's target IDL attribute,
> > > followed by a single U+0020 SPACE character, followed by the value of
> > > current node's data IDL attribute, followed by the literal string ?>
> > > (U+003F QUESTION MARK, U+003E GREATER-THAN SIGN).
> > 
> > Why? This is simulating PIs from HTML4, not from XML.
> 
> When PIs in the page are parsed into bogus comments, should the resulting
> comment value simulate PIs from HTML4 too by not having the end '?'?
> 
> <?xml-stylesheet type="text/css? href="file.css"?> -> <!--?xml-stylesheet
> type="text/css? href="file.css"--> instead of <!--?xml-stylesheet
> type="text/css? href="file.css"?-->?
> 
> If not, then parse(pi_node_markup_from_source_of_page) will return a different
> bogus comment than parse(real_pi_dom_node.innerHTML). The difference being the
> end '?' in the comment value will be missing from the latter.

If you're only dealing with HTML4-style PIs, there's no trailing ? at all. 
That's only an XML thing.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Saturday, 19 September 2009 22:00:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:48 GMT