Re: [xsl] result-document, QNames, AVT's, format-attribute and use-character-maps attribute

Subject: Re: [xsl] result-document, QNames, AVT's, format-attribute and use-character-maps attribute
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Thu, 14 Dec 2006 14:14:26 +0100 (CET)
Abel Braaksma wrote:

  Hi

>     <xsl:result-document href="xyz.xml" format="{ 'test' }">
>           ....sequence....
>     </xsl:result-document>
> Error: Invalid QName {{'test'}}see XTDE1460

  I can reproduce the problem with Saxon 8.8.0.4J.  I think
this is a bug, by my understanding of the following verses:

  [XSLT20] '19.1

    [ERR XTDE1460] It is a non-recoverable dynamic error if
    the effective value of the format attribute is not a
    valid lexical QName, or if it does not match the
    expanded-QName of an output definition in the
    stylesheet.

  [XSLT20] '5.1

    [Definition: A lexical QName is a string representing a
    QName in the form (NCName ":")? NCName, that is, a local
    name optionally preceded by a namespace prefix.]

    [Definition: A string in the form of a lexical QName may
    occur as the value of an attribute node in a stylesheet
    module, or within an XPath expression contained in such
    an attribute node, or as the result of evaluating an
    XPath expression contained in such an attribute
    node. The element containing this attribute node is
    referred to as the defining element of the QName.]

  There, it is not clearly stated that applies to AVT too.
But a little bit further in the same section, there is:

    [ERR XTDE0290] Where the result of evaluating an XPath
    expression (or an attribute value template) is required
    to be a lexical QName, then [...]

  So I think the intention is clear "{ 'test' }" is a valid
value for @format.

> is gone when using the following workaround: 
> 1) format = " string ( 'test' ) "
> 2) format = " xs:QName ( 'test' ) "

  I guess you mean:

    format = "{ string ( 'test' ) }"
    format = "{ xs:QName ( 'test' ) }"

> Q3: Though an serialization can be mapped with a character
> map, is anyone aware of a similar function with
> "importing" data? Like, with the doc()/document()
> functions, or, better yet, with the unparsed-text() entry?
> Or should I stick with extension functions? (reason: I
> want to strip or replace unparsable bytes from the input
> stream before it gets to the XSLT processor, which would
> reject any \x00 and, depending on version, other control
> characters).

  If I'm right, this is not permitted by XML.  So it is the
XML parser that will generate the error, before the XSLT
processor can see the input.

  Regards,

--drkm




















	

	
		
___________________________________________________________________________ 
Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! 
Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses 
http://fr.answers.yahoo.com

Current Thread