xsl-list
[Top] [All Lists]

Problem with generating references.

2005-07-05 05:57:07

Hi,
I am facing the problem to create the references to the elements. See the
following example XML file.
<A1>
         <B1/>
         <B2>
                  <C1></C1>
                  <C2>
                           <D1/>
                  </C2>
         </B2>
</A1>
I want to write an XSL file which results in XML file. The transformation
should be like this..
Note : For the nodes in the above xml file, no attribute is there to
identify uniquely (No ids are there. But in the result tree, I want unique
id for each element so that I can identify each element uniquely).

1. Divide the elements into groups.
2. While dividing, create the references to the elements in the current
group which are going to be placed in another group.

I want the output XML like this...
<A-Group>
         <A1>
                  <reference id="(id of B1)" />
                  <reference id="(id of B2)" />
         </A1>
</A-Group>
<B-Group>
         <B1/>
         <B2>
                  <reference id="(id of C1)" />
                  <reference id="(id of C2)" />
         </B2>
</B-Group>
<C-Group>
         <C1/>
         <C2>
                  <reference id="(id of D1)" />
         </C2>
</C-Group>
<D-Group>
         <D1/>
</D-Group>

Can any one give me the XSL code for this....

Thanks
Ch. Laxmi Narayana Babu
OSI Technologies


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