RE: [xsl] splitting multiple occurrences of an element within another element

Subject: RE: [xsl] splitting multiple occurrences of an element within another element
From: "Brian Benson" <bbenson@xxxxxxxxxxxx>
Date: Wed, 24 Sep 2003 14:38:32 -0500
Tom,

I have absolutely NO influence over the source xml.

Here is a better example of the source xml that I am working from:
<document>
   <item>
      <table>
         <tablerow>
            <tablecell>
               <par>
                  <doclink>
               </par>
            </tablecell>
         <tablerow>
       <table>
   </item>
</document>

In this sample the dolink is nested deeper than most doclinks that I would
run across, but it could be nested even deeper.

Thanks.




                                                                                                                                                
                      "Passin, Tom"                                                                                                             
                      <tpassin@xxxxxxxxxxxx>            To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>                                             
                      Sent by:                          cc:                                                                                     
                      owner-xsl-list@xxxxxxxxxxx        Subject:  RE: [xsl] splitting multiple occurrences of an element within another element 
                      rrytech.com                                                                                                               
                                                                                                                                                
                                                                                                                                                
                      09/24/2003 02:19 PM                                                                                                       
                      Please respond to xsl-list                                                                                                
                                                                                                                                                




[ Brian Benson]

> Tom,
>
> Thanks for the help.  Sorry, but I forgot to mention that a
> doclink can be
> nested any level of elements deep inside the document.  I
> can't count on it
> being directly under the document.  How can I change your code to find
> doclinks no matter how many levels deep they are.
>
> FYI, the code that I posted, finds all doclinks no matter how
> many levels
> deep they are, but doesn't return other information that I need.

There is no way to tell with without seeing how the doclink elements
that are nested deeper are related to the other information you want to
collect.  That is to say, what are the doclinks nested in?  The solution
might amount to a grouping problem, or something else, but we need more
information.

If you have some influence over the design of the source xml, it would
be useful to change it so that all doclinks are at the same nesting
level.  On the other hand, if it is a case of one document being nested
within another, along with its associated information, only minor
changes would be needed to the code I posted (like changing the select
statement for the variable to '//doclink').  But we have to see more
examples and explanation.

Cheers,

Tom P

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






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


Current Thread