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

Re: Can I access elements in the output tree?

Subject: Re: Can I access elements in the output tree?
From: Peter Paulus <paulus@xxxxxxxx>
Date: Thu, 09 Nov 2000 10:35:18 +0100
xsl output tree
on 11/3/00 7:41 PM, Kay Michael at Michael.Kay@xxxxxxx wrote:

>> The xml-processing instruction (<?xml version='1.0'?> ...
> 
> <?xml version='1.0'?> is an XML declaration, or a text declaration, it is
> not a processing instruction, despite the fact that it uses similar syntax.
> 
>> I tried to insert a <xsl:processing-instruction name='xml'/>
>> into the final
>> output tree just before copying the node-set. This however is
>> not allowed.
> 
> Correct: because processing instructions named "xml" are not allowed, to
> prevent confusion with XML declarations and text declarations.
> 
> Mike Kay
> 
> 
> 
> 
> 
> 
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Looking at http://www.w3.org/TR/xslt#section-XML-Output-Method (section
16.1) some more, it looks like the behavior is within the bounds of the
recommendation. The XML output method renders a wellformed XML external
general parsed entity:

According to http://www.w3.org/TR/2000/REC-xml-20001006#sec-external-ent
(section 4.3.2) rules 77 and 78 the external general parses entity may have
zero or 1 occurence of a pattern ('<?xml' VersionInfo? EncodingDecl S?
'?>')? in an EBNF-context that happens to have received the rulename
TextDecl. 

[77] TextDecl?::= '<?xml' VersionInfo? EncodingDecl S? '?>'
[78]?extParsedEnt?::=?TextDecl? content

That is the TextDecl is optional.

The example was compliant after all.

So, now I'm confused! The xml output always renders an extParsedEnt [78],
while I had the impression that it renders a document [1].

The difference between

[23] XMLDecl?::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

and

[77] TextDecl?::= '<?xml' VersionInfo? EncodingDecl S? '?>'

is in the VersionInfo and SDDecl? rules.

Should I be using the xsl:output parameters to influence the final result?
I.e. By using <xsl:output method='xml' version='1.0' standalone='yes' .../>
I then render the result tree as a document [1]?

Would this then be a contradiction to the fact that the xml output always
renders a extParsedEnt [78]?

Besides that there are the doctype-public and doctype-system attributes in
the xsl:output element. These attributes are relevant to the document [1]
rule, but not the extParsedEnt [78] rule. This strenghtens my perception of
the fact that the xml output method renders a document [1] rather than an
extParsedEnt [78].

And why does the xml output method in one case omit the TextDecl [77] and in
an other insert it? What determines that behavior? Does it depend on Xalan?

With kind regards,
Peter Paulus


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.