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
David NSubject: Outputing the actual XML issue.
Author: David N
Date: 07 Jun 2006 11:47 AM
Here's what I'm trying to do:

I have 2 possible input XML documents.

If
1:

<X>
<A>12345</A>
<B>54321</B>
</X>

Then Output

<Z>
<V>12345</V>
<W>54321</W>
</Z>

My stylesheet already does this. No help needed here. But:

If

2:

<Y>
<A>12345</A>
<B>54321</B>
</Y>

Then Output:

<Y>
<A>12345</A>
<B>54321</B>
</Y>

Basically, if the document is encapsulated by <Y>, I need to output a copy of the document as it is. I've tried:

<xsl:for-each select="/Y">
<xsl:value-of select="current()"/>
</xsl:for-each>

But the output looks like:

12345
54321

I get all the data to output, but the tags don't come with it. Is there an easy way to output the data with their tags? Any help would be very appreciated.

David

Postnext
Minollo I.Subject: Outputing the actual XML issue.
Author: Minollo I.
Date: 07 Jun 2006 01:42 PM
You may want to do:

<xsl:for-each select="/Y">
<xsl:value-of select="copy-of(.)"/>
</xsl:for-each>

Postnext
David NSubject: Outputing the actual XML issue.
Author: David N
Date: 07 Jun 2006 01:52 PM
Thank you so much. I ended up doing this:

<xsl:for-each select="/Y">
<xsl:copy-of select="."/>
</xsl:for-each>

I really appreciate it!

David.

Posttop
Minollo I.Subject: Outputing the actual XML issue.
Author: Minollo I.
Date: 07 Jun 2006 02:10 PM
Sorry, of course; I typed without turning on the brain first.

 
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.