xsl-list
[Top] [All Lists]

[xsl] XSL 2.0 - value-of - xml:space="preserve"

2008-04-03 19:42:16
Hi,

I have the following in a template. I have copied it directly from the
template without removing indentation spaces (I don't use tabs):

      <script type="text/JavaScript" xml:space="preserve">
...
        <xsl:variable name="acknowledge">
          <xsl:choose>
            <xsl:when test="$task-type=5">3</xsl:when>
            <xsl:otherwise>1</xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
          document.getElementById("status").value=<xsl:value-of
separator="" select="$acknowledge"/>;

     </

The above produces:

          document.getElementById("status").value=
          1
        ;

This is being output with xsl:result-document:

<xsl:result-document href="{$out-path}" encoding="UTF-8" indent="no"
method="xml">
...

The problem is the xml:space on the script element. If removed, it
renders as (I) expected. If xml:space="preserve" is present on the
script element, is the result above expected behavior?

thanks,
-Rob

p.s. I haven't looked into this too deeply, but I put an as attribute
with a schema type (yes, I declared the namespace):
<xsl:variable name="acknowledge" as="xs:integer">
and my page rendered empty. ?


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--