Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2013, 07:46 AM
Authorized User
 
Join Date: Mar 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Martin,

I dont have version 2.0 when i want to get the same output with version 1.0 what logic I should use.



Thanks in advance


Sarala
 
Old March 11th, 2013, 08:31 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Use what has been suggested, namely the identity transformation template
Code:
<xsl:template match="@* | node()">
  <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
  </xsl:copy>
</xsl:template>
plus a template that ensure the elements you want to remove are not copied, namely
Code:
<xsl:template match="ItemMaster/Item[ItemId = /Transmission/Items/ItemId]"/>
so putting these together results in
Code:
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  
<xsl:strip-space elements="*"/>
<xsl:output indent="yes"/>

<xsl:template match="@* | node()">
  <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="ItemMaster/Item[ItemId = /Transmission/Items/ItemId]"/>

</xsl:stylesheet>
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old March 11th, 2013, 08:37 AM
Authorized User
 
Join Date: Mar 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot Martin

Sarala





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT output to HTML - xml element text should look exactly as laid out in xml element DjGogga XSLT 4 July 21st, 2011 05:39 PM
Folder deletion with XML Config Peroni Beginning VB 6 5 January 16th, 2008 08:11 PM
Urgent:XSLT element value selection and condition amhicraig XSLT 1 December 4th, 2007 07:57 PM
hi please help me on xml deletion karthikc85 XML 1 October 10th, 2006 06:09 AM
Converting XML to XML (making element mandatory) boondocksaint20 XSLT 8 April 28th, 2006 10:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.