Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Can I select parent element while creating element using ?

From: bhushan.kharabe@-----.---
To: NULL
Date: 8/9/2006 10:16:00 AM

Hi,
I am stuck in problem involving transformation where the tree structure
of the target is different than the tree structure of the source.

My input xml looks like

<?xml version="1.0" encoding="utf-8" ?>
<tree>
  <treeInfo></treeInfo>
  <fruitInfo id="1"></fruitInfo>
  <fruitInfo id="2"></fruitInfo>
</tree>

My target xml should look like

<?xml version="1.0" encoding="utf-8" ?>
<tree>
  <treeInfo>
    <fruits>
      <fruitInfo id="1"></fruitInfo>
      <fruitInfo id="2"></fruitInfo>
    </fruits>
  </treeInfo>
</tree>

How can I achieve this transformation using XSLT?

I have tried but the closest output I am able to get is

<?xml version="1.0" encoding="UTF-8"?>
<tree>
  <treeInfo/>
  <fruits>
    <fruitInfo id="1"/>
    <fruitInfo id="2"/>
  </fruits>
</tree>

Any ideas how I can achieve my goal??


Thanks in advance for all the help.

Regards,
Bhushan



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