XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
peleg kSubject: getting an xml from an inner node
Author: peleg k
Date: 15 May 2007 04:47 PM
Originally Posted: 15 May 2007 04:48 PM
i have xml like this :
<root>
<sub1>
....
</sub1>
<data>
<xml1>
<x1>aaa</x1>
<x2>bbb</x2>
</xml1>
</data>
</root>
and i am trying to get from the above xml the "xml1" xml.
i do this by :

[CODE]
<xsl:template match="xml1">
<xsl:variable name="Value2">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:value-of disable-output-escaping="yes" select="translate ( $Value2, ' &#xD;&#xA;', '')"/>
</xsl:template>
[/CODE]

but instead of getting the xml1 in 1 line i recive only the nodes value like :
aaabbb

later on i got some help and got XSL file that suppose to do the work.
the proble is that i recive from on one xml an xml but on the other i recive :
Access is denied. Error processing resource 'file:///C:/temp/peleg.xsl'.

any idea why?
(i have attched the 2xml+xsl)
i checked and thee is no diffrence maybe some else will know why?

thnks in advance
peleg


Unknowntemp.zip
2 xml+1xsl

Posttop
Elias HuterSubject: getting an xml from an inner node
Author: Elias Huter
Date: 16 May 2007 03:11 AM
If you want the value + the tags you have to you use xsl:copy instead of xsl:value-of.

Heres a template of how to do it:

<xsl:template match="/">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>

<xsl:template match="@*|node()" mode="copy">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>

For me both XML files work, maybe you should try to move your files to a different path, best simply to C:\ to be sure that's not where the error comes from?

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.