[jdom-interest] CDATA data (followup with more info)

Malachi de AElfweald malachi at tremerechantry.com
Fri Nov 8 20:24:37 PST 2002

Ok, I am a little confused....

The page you referred to says this:

PIs are not part of the document's character data, but must be passed through to the application. The 
PI begins with a target (PITarget) used to identify the application to which the instruction is 
directed. The target names "XML", "xml", and so on are reserved for standardization in this or future 
versions of this specification. The XML Notation mechanism may be used for formal declaration of PI 
targets. Parameter entity references are not recognized within processing instructions.

So, according to the spec you sent me, it says that the
XMLDecl is a reserved PI, using "XML"/"xml" as the target application.


11/7/2002 9:25:53 PM, "Bradley S. Huffman" <hip at a.cs.okstate.edu> wrote:

>Malachi de AElfweald writes:
>> Actually, not quite.
>> the xml version declaration is a processor instruction.
>No, it just looks like one, but it's not.
>Go directly to the specification (http://www.w3.org/TR/REC-xml).
>Productions 16 & 17 (the two productions for PIs) are:
>  [16] PI ::= '<?' PITarget ( S (Char* - (Char* - (Char* '?>' Char*)))? '?>'
>  [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
>Production 17 explicitly prohibits 'xml' in any form from being the target
>for a PI, ergo <?xml version="1.0" ?> cannot be a processing instruction.
>In fact the only production it matches is production 23 for a XML declaration.
>  [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
>> First link under google search for `xml "processing instruction" tutorial`
>> brings up:
>> http://www.javacommerce.com/tutorial/xmlj/pi.htm
>I'd say the actual specification would be a more authoritative source.
>> All processing instructions, including the XML declaration, begin with <? and
>>  end with ?>.
>Yes they both begin with <? and end with ?>, then again apples and oranges
>both grow on trees, but they are not the same. Likewise the XML declaration
>and PI's are not the same.
>A couple more differences are the XML declaration, if it exists, must be the
>first item in the document and the document can contain only one.  In 
>contrast, there can be any number of PIs in a document, they don't have to
>be unique, and they can occur in any order.
>To control your jdom-interest membership:

More information about the jdom-interest mailing list