Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Selecting everything "before" and "after" a specific node

From: Emmanuel B&#xE9;gu&#xE9; <eb@---------->
To:
Date: 4/2/2009 11:29:00 AM
Hello,

I did see your message on the xep mailing list and the
answer by G. Ken Holman, and I offered to send the
stylesheet I had made that does just that (currently
based on an element name for the break, not an
attribute value).

I find it's a complicated problem that I don't think
can be explained easily (not by me anyway ;-)

I'm sending the stylesheet to you in a separate
message.

If you run the stylesheet on a slightly modified version
of your source (Z instead of E when i=9):

<A i="1">
	<B i="2">
		<C i="3"/>
		</B>
	<B i="4">
		<C i="5">
			<D i="6"/>
			<D i="7">
				<E i="8"/>
				<Z i="9" msg="get me out of here!"/>
				<E i="10"/>
				</D>
			<D i="11"/>
			</C>
		<C i="12"/>
		</B>
	</A>


you get the following result:

<root>
   <A i="1">
      <B i="2">
         <C i="3"/>
      </B>
      <B i="4">
         <C i="5">
            <D i="6"/>
            <D i="7">
               <E i="8"/>
            </D>
         </C>
      </B>
   </A>
   <Z i="9" msg="get me out of here!"/>
   <A i="1">
      <B i="4">
         <C i="5">
            <D i="7">
               <E i="10"/>
            </D>
            <D i="11"/>
         </C>
         <C i="12"/>
      </B>
   </A>
</root>

Regards,
EB

> -----Original Message-----
> From: Paul Harvey [mailto:paul_harv_2@xxxxxxxxx]
> Sent: Thursday, April 02, 2009 1:07 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Selecting everything "before" and "after" a specific node
>
>
>
> Hi,
> Ibve searched and posted on another list, but have not found an
> answer to this problemb&
> I have XML like this...
>
> <A i=b1b>
>       <B i=b2b>
>             <C i=b3b/>
>       </B>
>       <B i=b4b>
>             <C i=b5b>
>                   <D i=b6b/>
>                   <D i=b7b>
>                         <E i=b8b/>
>                         <E i=b9b msg="get me out of here!"/>
>                         <E i=b10b/>
>                   </D>
>                   <D i=b11b/>
>             </C>
>             <C i=b12b/>
>       </B>
> </A>
> And I need to break it out into 3 nodesets, delimited by the <E
> i=b9b msg="get me out of here!"/> such that Ibd end up with...
> <ROOT>
>        <BEFORE>
>         <A i=b1b>
>                   <B i=b2b>
>                         <C i=b3b/>
>                   </B>
>                   <B i=b4b>
>                         <C i=b5b>
>                               <D i=b6b/>
>                               <D i=b7b>
>                                     <E i=b8b/>
>                               </D>
>                         </C>>
>                   </B>
>         </A>
>        </BEFORE>
>        <PULLED_OUT>
>             <E id=b9b msg="get me out of here!"/>
>        </PULLED_OUT>
>        <AFTER>
>         <A i=b1b>
>                   <B i=b4b>
>                         <C i=b5b>
>                               <D i=b7b>
>                                     <E i=b10b/>
>                               </D>
>                               <D i=b11b/>
>                         </C>
>                         <C i=b12b/>
>                   </B>
>         </A>
>        </AFTER>
> </ROOT>
>
> Any suggestions as to how Ibd go about that?
> I've spent some time with preceding and following axis, and some
> other conditions, but this has not got me where I need to get as yet.
>
> Thanks so much,
>
> Paul


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent