Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Removing child nodes via XSLT or Xpath - newbie question

From: jhoge123@-----.---
To: NULL
Date: 10/3/2005 7:28:00 AM
I have an XML document that contains more information than I need for a
particular application. The structure is as follows:

<root>
 <category ID = "1">
   <product ID="1" />
   <product ID="2" />
 </category>
 <category ID = "2">
   <category id ="3">
    <product ID ="3"/>
   </category>
   <category id ="4">
    <product ID ="4"/>
   </category>
 </category>
</root>

What I want to do is populate a menu with all category nodes, but
remove all of the product nodes. I tried using "/root/category" as an
xpath, but that selects teh entire category node, along with the
product child nodes that I don't want.

Do I need to use XSLT first to remove the unwanted nodes?

Any help would be greatly appreciated.

Thanks,
John



transparent
Print
Mail
Like It
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