reformatting only a part of the XML using XSL

Discussion in 'XML' started by unaveen, Mar 17, 2008.

  1. unaveen

    unaveen

    Joined:
    Mar 17, 2008
    Messages:
    2
    A generic XSL that can re-fromat a given node no matter where it is placed

    Hi all ,
    The problem is as under :
    I can have an XML in which the initial tags can be in any order.
    I am just interested in refomatting only a known node..But i do not necessarily know the previous nodes at all.
    So kindly tell me a way to do that..
    As an example here is a sample XML file:

    <nds dtdversion="2.0">
    <output>
    <instance class-name="TEST_ME" event-id="0" src-dn="P000045">
    <association>TST_ME/P000045</association>
    <attr attr-name="LAStNAme">
    <value>Safin</value>
    </attr>
    <attr attr-name="PHONES">
    <value>
    <component name="PHONETYPE">BUSN</component>
    <component name="PHONE">12345678</component>
    </value>
    <value>
    <component name="PHONETYPE">CELL</component>
    <component name="PHONE">23123412</component>
    </value>
    <value>
    <component name="PHONETYPE">HOME</component>
    <component name="PHONE">342345234532</component>
    </value>
    <value>
    <component name="PHONETYPE">PGR</component>
    <component name="PHONE">441232352</component>
    </value>
    </attr>
    <attr attr-name="ID">
    <value>P000045</value>
    </attr>
    </instance>
    <status level="success" type="general">
    <description>Query completed successfully.</description>
    </status>
    </output>
    </nds>


    I am just concerned about reformatting the PHONES node and its child nodes and i know how to do that!
    I just want the rest of the xml to be just copied normally without hard-coding
    any previous or next node values.

    So all i want is
    <Xsl General copy-code ></Xsl>
    <my reformat code>
    <Xsl General copy code></Xsl>


    Thanks
    Naveen
    Last edited: Mar 17, 2008
    unaveen, Mar 17, 2008
    #1
    1. Advertising

  2. unaveen

    unaveen

    Joined:
    Mar 17, 2008
    Messages:
    2
    Hi guys,
    I dint receive any replies to my previous post..
    "Is it so simple a thing to do.
    I am relatively new to XSL ( 1 day) and needed some help..
    thanks
    -naveen
    unaveen, Mar 18, 2008
    #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. Curt
    Replies:
    3
    Views:
    1,870
    Sahil Malik
    Jun 18, 2004
  2. schaf@2wire.ch
    Replies:
    1
    Views:
    3,598
    A. Bolmarcich
    May 27, 2005
  3. Draz

    XML text reformatting

    Draz, Jul 25, 2005, in forum: XML
    Replies:
    0
    Views:
    382
  4. anywherenotes@gmail.com

    How to select only specific rows from xml using xsl

    anywherenotes@gmail.com, Feb 6, 2009, in forum: XML
    Replies:
    1
    Views:
    1,144
    Martin Honnen
    Feb 6, 2009
  5. Anthony
    Replies:
    0
    Views:
    95
    Anthony
    Jan 13, 2006
Loading...

Share This Page