xsl-list
[Top] [All Lists]

[xsl] XSLT: Transforming one markup to another markup

2006-05-01 20:33:15
Hi!
The X markup needs to be converted into Y markup.
The X markup is as follows:


<class scheme="SAT"> 
   <classitem> 
         <identifier> 
                <name>Sales </name> 
                <code>1234</code> 
         </identifier> 
         <classitem> 
           <identifier> 
                  <name> Tax</name> 
                  <code>5678</code> 
           </identifier> 
         <classitem> 
           <identifier> 
                 <name>Items  </name> 
                 <code>9101</code> 
           </identifier> 
          <classitem> 
             <identifier> 
                <name>Manufacturing </name> 
                <code>1121</code> 
             </identifier> 
           </classitem> 
        </classitem> 
     </classitem> 
    </classitem> 
</class> 

The Y Markup is has follows:

<hier>
  <hierlev role="ancestor">
     <heading>
        <title>Sales</title>
     </heading>

     <hierlev role="ancestor">
        <heading>
           <title> Tax</title>
         </heading>

         <hierlev role="ancestor">
        <heading>
              <title>Items </title>
        </heading>
            <hierlev role="ancestor">
               <heading>
                  <title>Manufacturing </title>
               </heading>
                  <hierlev role="ancestor">
                   <heading>
                        <title>Revised Code </title>
                    </heading>
                </hierlev>
                <hierlev role="me">
                    <heading>
                        <title> Title Value</title>
                     </heading>
                 </hierlev>
            </hierlev>
          </hierlev>
     </hierlev>
   </hierlev>
</hier>

Now two rules for the above conversion:
1)In X markup--The classitem depth is arbitary. 
2)In Y Markup--- always the last hierlev element contains two  hierlev
as children.


Sridhar


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>