This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: complexe variable


As Xalan said you created a ResultTreeFragment (RTF) with your variable
declaration.

Either
  you avoid this completely

or
  you put the variable in an extra XML file and refer to it via document()

or
  you let it like it is and refer to it via
document('')/*/xsl:variable[@name='jian']

or
  you use an extension function xalan:nodeset() - I don't know if there
is one in Xalan C.

For more information search the spec or the archives of the list for RTF.

Regards,

Joerg

ilyasov jian wrote:
> hello all,
> 
> i have the following stylsheet.
> 
> <?xml version='1.0' encoding='UTF-8' ?>
> <xsl:stylesheet version='1.0' 
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
> 
> <xsl:output method="html"/>
> <xsl:variable name="jian">
>     <suz>suz</suz>
>     <iwa>iwa</iwa>
> </xsl:variable>
> 
> <xsl:template match="/">
>     <xsl:value-of select="$jian/suz"/>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> i was told that it should give 'suz' string, the value of <suz> element 
> inside $jian variable.
> with Xalan i get error like:
> 
> XSLException Type is: XObjectInvalidConversionException
> Message is: Cannot convert a #RESULT_TREE_FRAG to a node set. (Unknown 
> URI, unkn
> own line, unknown column)
> 
> version is :
> TestXSLT version 1.2.0 (Xalan C++ version 1.2.0)
> 
> or when i just put <xsl:value-of select="$jian">
> it, as expected, gives me concatination of 2 child elements('suziwa') of 
> the $jian variable.
> 
> i found nothing in spec.
> 
> please explane
> 
> jian


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]