How to handle the space between different components through CSS?

Is there a way to handle the space between different components. For example, the subhead after the footnotes needs 10 pts whereas the same subhead comes after the list requires 15 pts.  

Parents
  • Shahnawaz,

    The real problem here is that XPP only sees a limited part of the complete context of an XML element.
    It can check the ancestors of an element but not the preceding-siblings or preceding elements like you can do with XPath in XSLT.
    And this means that you will have to revert to workarounds like the one Chris has suggested (setting/checking a named or number register.

    I do want to point out another possibility though.
    But this will only work in a total blackbox environment or where the operators are not allowed to change the XML structure.
    In that case what I prefer to do is use an XSLT transformation table at input that adds an attribute that holds the name of the preceding element (and while you are there add another attribute that captures the name of the following element). You can do that to every element or to specific elements, your choice.
    This will make the incoming XML richer so that you can ask XPP to react differently depending on the preceding element.

    PS: for all the attributes that I add at import, I use a name that starts with a capital X, like Xpreceding = "list". This makes it easier to filter these attributes out on the way out again (just in case you need to export that final XML again)

  • Here is a sample XSLT that will add the Xpreceding attribute to each element that has a preceding-sibling element:

        
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
        <xsl:template match="*" priority="1.0">
            <xsl:copy>
                <xsl:copy-of select="@*"/>
                <xsl:if test="preceding-sibling::*">
                    <xsl:attribute name="Xpreceding">
                        <xsl:value-of select="name(preceding-sibling::*[1])"/>
                    </xsl:attribute>
                </xsl:if>
                <xsl:apply-templates/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="node()">
            <xsl:copy>
                <xsl:copy-of select="@*"/>
                <xsl:apply-templates/>
            </xsl:copy>
        </xsl:template>
    </xsl:stylesheet>
    
Reply Children
No Data