xsl-list
[Top] [All Lists]

Re: Problem turning a xml string into a proper tree

2004-02-03 10:30:11
I have tried :

<xsl:variable name="v" select="xalan:nodeset('&lt;entity&gt;hallo&lt;/entity&gt;')"/>
<xsl:value-of select="$v"/>

                   this returns <entity>hallo </entity>



Michael Kay wrote:

I have a template that  receives a parameter  that way:
   <xsl:with-param name="paramString">
       <params>
           <param att="att1" name="name11">value1</param>
           <param att="att2" name="name12">value2</param>

               .........
         </params>
   </xsl:with-param>

What I'd like to is to retrieve the value of <xsl:value-of select="$paramString/param[n]/@name" />

To do that in XSLT 1.0 you need the node-set() extension:

select="xx:node-set($paramString)/param[n]/@name"


What it more if i make <xsl:value-of select="$paramString"/> it should return value1value2 but it returns <params>
           <param att="att1" name="name11">value1</param>
           <param att="att2" name="name12">value2</param>

               .........
         </params>
this means xalan treats it as a string instead of a tree as I'd like to.


<xsl:value-of select="$paramString"/>

should indeed return the string "value1value2". I'm very surprised if it
returns a string containing angle brackets. You need to show us a
complete stylesheet that demonstrates the problem.

Michael Kay


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






AVISO LEGAL
Este mensaje de correo electrónico y sus documentos adjuntos están dirigidos
exclusivamente a los destinatarios especificados. Puede contener información
confidencial o legalmente protegida. No hay renuncia a la confidencialidad o
privilegio por cualquier transmisión errónea. Si usted no es el destinatario
indicado, le rogamos que lo elimine y se lo comunique al remitente. No debe,
directa o indirectamente, usar, revelar, distribuir, imprimir o copiar ninguna de las partes de este mensaje. Si siendo destinatario de este mensaje no consintiera el uso de correo electrónico, rogamos nos lo comunique inmediatamente.
Bancoval,S.A. y sus filiales no serán responsables de las opiniones o
informaciones incluidas en este mensaje salvo cuando el remitente esté autorizado para establecer que dichas opiniones proceden de Bancoval,S.A
y sus filiales.

DISCLAIMER
Addressee/s identified herein. It may contain confidential or legally privileged information. No confidentiality privilege is waived or lost
by any mistransmission. If you are not the intended recipient, please
immediately delete it and notify the sender. You must not, directly or
indirectly, disclose, distribute, print, or copy any part of this message.
If you are the addressee of this message and do not consent to the use of
e-mail, please communicate it to us immediately. Bancoval, S.A. and its
subsidiaries are not responsible for the opinions or information included
in this message except when the sender is authorised to state them to be the
views of Bancoval, S.A and its subsidiaries.


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