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

Re: questions.

Subject: Re: questions.
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 04 Oct 2001 15:39:33 +0200
Re:  questions.
Hi Mihir,

I think here you have a problem of unserstanding XSL. You don't modify the original XML-tree, you create a new one. This is important!! If you really want to "translate" <b> to <x>, you don't need to "delete" <b>, you only need to add <x>.

An example stylesheet:

<xsl:template match="a|c">
  <xsl:copy>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="b">
  <x>
    <xsl:apply-templates/>
    <m></m>
    <n></n>
  </x>
</xsl:template>

Hope this helps,

Joerg


Mihir D. Gore wrote:


but if want to replace node b with node z ie

<a>
	<b>
		<c></c>
	</b>
</a>

is changed to
<a>
	<x>
		<c></c>
		<m></m>
		<n></n>
	<x>
</a>

I can achive this by simply deleting node b and its chilren and adding node
x.
Is there any other way around this?

mihir
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Manu KY
Sent: Thursday, October 04, 2001 2:09 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  questions.


Hi, write xsl:template match = "b"

Manu

hi,
I have a xml file in the form

<a>
       <b>
               <c></c>
       </b>
</a>

I want to add two more children to node b say m and n so that the

resultant

xml looks like this.....

<a>
       <b>
               <c></c>
               <m></m>
               <n></n>
       </b>
</a>

BUT in the xsl file in want to specify the path with respect to node b.
How do i do it?
mihir


--

System Development
VIRBUS AG
Fon +49(0)341-979-7435
Fax +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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



Current Thread
  • questions.
    • Mihir D. Gore - Thu, 4 Oct 2001 01:50:00 -0400 (EDT)
      • Manu KY - Thu, 4 Oct 2001 04:34:17 -0400 (EDT)
        • Mihir D. Gore - Thu, 4 Oct 2001 05:11:23 -0400 (EDT)
          • Jörg Heinicke - Thu, 4 Oct 2001 07:35:18 -0400 (EDT) <=

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.