This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Can I access elements in the output tree?
- To: <xsl-list at mulberrytech dot com>
- Subject: Re: Can I access elements in the output tree?
- From: Peter Paulus <paulus at neroc dot nl>
- Date: Thu, 09 Nov 2000 10:35:18 +0100
- Reply-To: xsl-list at mulberrytech dot com
on 11/3/00 7:41 PM, Kay Michael at Michael.Kay@icl.com 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