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

Harvey, Paul Paul_Harvey at omb.eop.gov
Mon Mar 30 13:14:34 PDT 2009


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20090330/024892b4/attachment.html>


More information about the Xep-support mailing list