[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem turning a xml string into a proper tree

Subject: Problem turning a xml string into a proper tree
From: susana gonzalez <susana.gonzalez@xxxxxxxxxxx>
Date: Wed, 04 Feb 2004 13:47:46 +0100
parse string to xml
I have already found a solution implementing a java method that takes a String as argument and returs a Node
so that I can call this method in my xslt.
public static Node parse(String xml) {}





Michael Kay wrote:


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>



I can't see how this relates to what you said you were doing earlier..


I'm not sure what xalan:nodeset does when given a string argument; I
expect it creates a tree and makes the string a text node within that
tree, and this is consistent with your output. What it won't do, almost
certainly, is to parse the string on the assumption that it contains
XML.

It would really help if you told us what problem you were trying to
solve, rather than showing us non-working code that represents your
attempt to solve it.

Michael Kay




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







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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.