![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Read the "Locator" attribute from the Book element, in case it is "Yes" ....delete the entire book element, |
#3
| |||
| |||
|
|
Gaurav wrote: Read the "Locator" attribute from the Book element, in case it is "Yes" ....delete the entire book element, With XSLT you can use the identity transformation plus a template preventing that Book[@Locator = 'Yes'] is being processed e.g. xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xsl:template match="@* | node()" xsl:copy xsl:apply-templates select="@* | node()"/ /xsl:copy /xsl:template xsl:template match="Book[@Locator = 'Yes']"/ /xsl:stylesheet -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ |
#4
| |||
| |||
|
|
Thanks Martin. I am fairly new to xml transformation etc.... so transforming the input xml file against the code you mentioned below would do the trick? |
#5
| |||
| |||
|
|
Gaurav wrote: Thanks Martin. I am fairly new to xml transformation etc.... so transforming the input xml file against the code you mentioned below would do the trick? Yes. With the .NET framework 2.0 or later use System.Xml.Xsl.XslCompiledTransform to perform the transformation. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ |
#6
| |||
| |||
|
|
I am using .NET framework 1.1. |
|
I transformed the file against the .xslt and the result is: Carl SaganCosmology |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |