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
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: