Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] String to XML inside an XSLT

From: Josh Twist <jtwist@--------------->
To:
Date: 5/1/2002 7:28:00 AM
This is a bit of a funny one... 
I have, for example, the following XML (muchos simplified) 

<nodes> 
	<node> 
		&lt;childnode&gt;value&lt;/childnode&gt; 
	</node> 
</nodes> 

This is a little unfortunate but unavoidable as the data is a string and the
xml object builder can't tell the difference between a normal string and one
that should be real XML. Only the XSLT knows this (long story). 

What I need to do is parse this in XSLT as normal and access the XML and
it's values, children, attributes etc stored in the string. For example the
Xpath might read "/nodes/node/childnode" I've tried putting it in variables
with and without output-escaping disabled and so on without success:

XSLT 

<xsl:variable name="myStringXML"> 
	<xsl:value-of select="/nodes/node"/> 
</xsl:variable> 

<xsl:for-each select="$myStringXML/childnode"> <!-- Errors here - says
$myStringXML does not evaluate to a node set -->
	<xsl:value-of select="."/> 
</xsl:for-each> 

Anybody know of a way to do this? Even thought the <xsl:value-of
select="/nodes/node"/> returns the value without the &lt;s etc it's still a
string. What I need is somekind of xml() function that turns a string into a
real nodeset. 

We're using MSXML3. Any help would be greatly appreciated.

Josh

The information in this e-mail and any attachment(s) is confidential and may be legally privileged. This e-mail is intended solely for the addressee. If you are not the addressee, dissemination, copying or other use of this e-mail or any of its content is strictly prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail and any copies. E-mails and unencrypted attachments are scanned for all known viruses. Always scan e-mail attachments for viruses before opening them. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender.

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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent