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
Sushant PrabhuSubject: How to ignore non required parent tags
Author: Sushant Prabhu
Date: 23 Nov 2006 07:59 PM
Hi All

Currently I am in the process of converting a xml file into another.

The source xml file has numerous parent tags but I do not need all the parents info in my destination xml file.

I have a source xml file which is something like this

*******************************************************

<topparent>
<parent>
<parent-name>
GALAXY
</parent-name>

<child id ="1">
all other xml tags sub child ones
</child>
</parent>
</topparent>

*******************************************************

Now I have written an xsl which is something like this

<xsl:template match="child"> ALL XSL PROCESSING </xsl:template>

What I intend to do is just trap all tags wid node child & only retrieve tat info which is happening properly.
But somehow the parent-name is also getting printed in my output file which I want to ignore. I have no clue how it gets printed even when I do not exactly have a flow included for it in my xsl file.

Do post your thoughts


Regards

Posttop
James DurningSubject: How to ignore non required parent tags
Author: James Durning
Date: 24 Nov 2006 10:21 AM
You still need to catch those elements, or they will output their text nodes by default.
<xsl:template match="*"/>

 
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.