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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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?

   
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.