XML to XML using XSLT

Discussion in 'XML' started by dandagopi, Aug 18, 2011.

  1. dandagopi

    dandagopi

    Joined:
    Aug 18, 2011
    Messages:
    1
    Hi i need to convert the xml to xml

    inut xml is

    <associds>
    <associd>
    <associdentifierValue>12345</associdentifierValue>
    <associdtype>AAA</associdtype>
    </associd>
    <associd>
    <associdentifierValue>24688</associdentifierValue>
    <associdtype>BBB</associdtype>
    </associd>
    </associds>

    expected out is if child element value is BBB - i need to remove the whole element in associd.

    <associds>
    <associd>
    <associdentifierValue>12345</associdentifierValue>
    <associdtype>AAA</associdtype>
    </associd>
    </associds>


    XSLT is given below, but it is removing only associdtype is BBB , i need to remove entire parent. i need as soon as possible.. Thanks in advance.


    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:dp="http://www.datapower.com/extensions"
    extension-element-prefixes="dp"
    exclude-result-prefixes="dp">

    <xsl:eek:utput method="xml"/>

    <!-- Confidential#1 access-denied fields-->

    <xsl:template match="associdtype[.='BBB']">
    </xsl:template>
    <!-- Rest of the response fields are allowed to pass from service output -->

    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    dandagopi, Aug 18, 2011
    #1
    1. Advertising

  2. dandagopi

    chr158ooth

    Joined:
    Sep 16, 2011
    Messages:
    2
    Has anybody manage to do this but using XSL:FO?

    I am wanting to achieve the same results, but output to a PDF.
    chr158ooth, Sep 16, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    640
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,661
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    614
    Laurens
    Jan 26, 2004
  4. sneill@mxlogic.com
    Replies:
    2
    Views:
    708
    Henry S. Thompson
    Oct 19, 2005
  5. dar_imiro@hotmail.com
    Replies:
    4
    Views:
    659
    dar_imiro@hotmail.com
    Dec 13, 2005
Loading...

Share This Page