extrapolating attributes to child nodes

Subject: extrapolating attributes to child nodes
From: "Roshan Sharma" <roshansharma@xxxxxxxxxxx>
Date: Thu, 24 Aug 2000 04:24:42 GMT
I want to convert xml as follows:
From:
<set = 5>
 <A>
   <attrib>
      <uid>4</uid>
      <gid>10 </gid>
      <perm> 777 </perm>
   </attrib>

   <B>
     <attrib>
         <uid> 5 </uid>
         <gid> 11 </gid>
         <perm> 444 </perm>
     </attrib>
   </B>
 </A>
 </set=5>
 To:
 <directory name="A" global_id="4:5" gid="10" perm="777" />
 <directory name="B" global_id="5:5" gid="11" perm="444" />

Where global_id=uid:set, and set. Anything other than set and elements under
<attrib> can be safely assumed to be directories. A set is to be listed as
part of global_id in each child node.


I use the following hardcoded xslt such as <xsl:template match="A">..., but
I am seeking more dynamic solution such that it would parse from the root node,
and construct global_id from the <set> and <uid>.


Any suggestion?

 Thanks,
 Rosh





________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread