P
Philippe Poulard
Hi,
I need to define inside my stylesheet some xml structured datas, like
this (this example works) :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:data="*** Datas ***"
exclude-result-prefixes="data">
<data:foo bar="data"/>
<xsl:template match="/">
<!-- XSLT stuff here -->
<xsl:template>
</xsl:stylesheet>
unfortunately, the content of my data structure contains values with
brackets and dollars, like this :
<data:foo bar="{$data}"/>
when i create the template, i catch the following exception :
javax.xml.transform.TransformerException:
org.apache.xml.utils.WrappedRuntimeException: Could not find variable
with the name of data
because the xslt unmarshaler think that it is an attribute value
template; however, it is not, because present outside any context
handable by some xslt features such as output production or variable
computation; it is only valid xml data, and i want to retrieve this data
as it is written !
it is not clear in the spec that such a particular case should not be
evaluate as an AVT (if anybody knows, tell me)
i don't think it have to, because this part of the document is not for
the xslt processor, and can't be handled by it (i think); escaping with
{{ and }} has sense only for real AVT and would corrupt my datas, so it
is not acceptable
the only way to avoid this is to declare a variable of that name in the
scope of the data, like this :
<xsl:variable name="data"/>
<data:foo bar="{$data}"/>
baaah ! i don't want to declare false variables for my thousand datas
i really think it's a bug
do you think there is a lack in the spec ?
do you think this is a bug in apache ?
--
Cordialement,
///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
I need to define inside my stylesheet some xml structured datas, like
this (this example works) :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:data="*** Datas ***"
exclude-result-prefixes="data">
<data:foo bar="data"/>
<xsl:template match="/">
<!-- XSLT stuff here -->
<xsl:template>
</xsl:stylesheet>
unfortunately, the content of my data structure contains values with
brackets and dollars, like this :
<data:foo bar="{$data}"/>
when i create the template, i catch the following exception :
javax.xml.transform.TransformerException:
org.apache.xml.utils.WrappedRuntimeException: Could not find variable
with the name of data
because the xslt unmarshaler think that it is an attribute value
template; however, it is not, because present outside any context
handable by some xslt features such as output production or variable
computation; it is only valid xml data, and i want to retrieve this data
as it is written !
it is not clear in the spec that such a particular case should not be
evaluate as an AVT (if anybody knows, tell me)
i don't think it have to, because this part of the document is not for
the xslt processor, and can't be handled by it (i think); escaping with
{{ and }} has sense only for real AVT and would corrupt my datas, so it
is not acceptable
the only way to avoid this is to declare a variable of that name in the
scope of the data, like this :
<xsl:variable name="data"/>
<data:foo bar="{$data}"/>
baaah ! i don't want to declare false variables for my thousand datas
i really think it's a bug
do you think there is a lack in the spec ?
do you think this is a bug in apache ?
--
Cordialement,
///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------