[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: processing instruction with 'xml' target

  • From: <juanrgonzaleza@c...>
  • To: <xml-dev@l...>
  • Date: Sat, 23 Sep 2006 06:14:01 -0700 (PDT)

xml target
Chris Burdess said:
> <juanrgonzaleza@c...> wrote:
>> I am not sure if when I write <?xml version="1.0"?> in a doc I am
>> writing
>> a xml declaration or a PI.
>
> If you write it at the start of an XML document it is an XML
> declaration.
>
> If you write it anywhere else it is a well-formedness error,
> including at the start of an external entity since text declarations
> must supply an encoding attribute.

No exactly. According to the spec a <?xml version="1.0"?> at the start is
the XML declaration. According to certain parsers it is *not*. If i am
working with the formal spec ro with a correct implementation of the spec
it is not a PI. If i am working with a wrong implementation from an
incompetent (in own words of Mike here) then it can be a PI. I find more
cool the pragmatic attitude of Kurt Cagle, David Hunter and others when
saying:

<quote>
Actually, no: the XML declaration isn't a PI <they refer here to the
formal spec/>. But in most cases it really doesn't make any difference
whether it is or not, so feel free to look at it as one if you wish.
</quote>

or

<quote>
Trying to get the text of the XML declaration from an XML parser. Some
parsers erroneously treat the XML declaration as a PI, and will pass it on
as if it were, but many will not.
</quote>

I simply remarked that the dogma "the XML declaration is not a PI" can
fail in everyday practice. When i wrote <?xml version="1.0"?> in a doc it
can be a PI for parser W and can be not a PI for parser C.

>> The reply to above question depends of the arbiter used, the formal
>> spec
>> or a real working implementation?
>>
>> Apparently my Mozilla based browser sometimes deals the xml
>> declaration as
>> a PI. I obtain something like
>>
>> <message>
>> xml processing instruction not at start of external entity
>> </message>
>>
>> ... Sorry to say this but I never work with the formal
>> spec, just with real implementations in browsers, tools...
>
> Mozilla error messages are not normative. And just because many
> native English speakers say things like "If I was rich" doesn't make
> such utterances grammatically correct English.

The fact that Mozilla people call it pseudo-pi in technical documentation
(e.g. Doctype sniffing) suggest me that _sometimes_ they may be treating
the XML declaration as a PI of a special class.

> --
> ç?¬ Chris Burdess
>    "They that can give up essential liberty to obtain a little safety
> deserve neither liberty nor safety." - Benjamin Franklin


Juan R.

Center for CANONICAL |SCIENCE)




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.