[xep-support] Selecting everything "before" and "after" a given node

From: Harvey, Paul <Paul_Harvey@omb.eop.gov>
Date: Mon Mar 30 2009 - 12:14:34 PST

Hi,

 

This one's got me stumped, but perhaps it's simpler than I think.

 

We have XML something like this (this is very much simplified)

 

<chapter>

      <account>

            <bureau>

                  <fund>

                        <table>...</table>

                  </fund>

                  <fund>

                        <table>...</table>

                  </fund>

            </bureau>

            <bureau>

                  <fund>

                        <table>...</table>

                  </fund>

                  <fund>

                        <table type="BREAK-OUT"><!-- THIS NEEDS TO BE
BROKEN OUT --></table>

                  </fund>

                  <fund>

                        <table>...</table>

                  </fund>

            </bureau>

            <bureau>

                  <fund>

                        <table>...</table>

                  </fund>

            </bureau>

      </account>

      <account>...</account>

</chapter>

 

In our XSL:FO we have (again simplified)

 

...

<fo:flow>

   <xsl:apply-templates/>

</fo:flow>

...

 

But we have a special case now in which the table highlighted above
needs to span two columns. To do this we need to put it in a block which
is a child of the flow.

Our existing template structure deeply nests stuff in blocks, wrappers
and inlines, so we need to be able to break the table out by doing
something along the lines of...

 

...

<fo:flow>

      <xsl:apply-templates select="Nodeset of all nodes before the table
in question"/>

      <fo:block span="all">

<xsl:apply-templates select="//table[@type='BREAK-OUT']"/>

      </fo:block>

<xsl:apply-templates select="Nodeset of all nodes after the table in
question"/>

</fo:flow>

...

 

Conceptually this seems reasonable enough, but in playing around with
various axis (preceding/following/ancestor and unions thereof) I've not
got it yet.

 

Does anyone have any suggestions, or is there a nice idiom for what I'm
trying to do?

 

By the way, the stylesheet is large and complex and I'm hoping to find
away to select what I want and have existing code handle it, with a
minimal of changes to existing code.

 

Thanks very much,

 

Paul

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Mon Mar 30 12:49:19 2009

This archive was generated by hypermail 2.1.8 : Mon Mar 30 2009 - 12:49:24 PST