xsl-list
[Top] [All Lists]

Can you break one node tree into two?

2005-01-31 14:36:28
Hello,

I'm trying to take some XML such as:

<RootEle xmlns="">
  <Letter>
      <From/>
      <To/>
      <Address/>
      <Subject/>
      <Body/>
  </Letter>
</RootEle>

And I would like my XSLT to output:

<RootEle xmlns="">
   <Letter>
       <From/>
       <To/>
       <Address/>
   </Letter>
</RootEle>
<RootEle xmlns="">
    <Letter>
        <Subject/>
        <Body/>
    </Letter>
</RootEle>

Basically I want to say as soon as I see the Address node I want to
break it out and everything above it into one node tree and everything
below it into a second node tree.  The nodes could be anything, but if
an Address node is passed to me, I need to break the node tree into two.

I am think I need to do something with the xsl:copy-of and the
xsl:for-each, but my xslt knowledge is very limited and attempting to
use this is not creating anything near what I had hoped for.

If it isn't possible to return two node trees (which I suspect it
isn't),  how would I make it look like: <NewRoot>
  <RootEle xmlns="">
    <Letter>
       <From/>
       <To/>
       <Address/>
    </Letter>
  </RootEle>
  <RootEle xmlns="">
    <Letter>
        <Subject/>
        <Body/>
    </Letter>
  </RootEle>
</NewRoot>

Thank you,
Becky

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