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.
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.
Is this in item formats or CSS. The answer is yes but the solution will be slightly different.
One solution is to set a number register in the footnotes and then in the sub-head do a test in the sub-head to so if that number register was set to a specific number and then alter the spacing accordingly. Dont forget to then either reset or change the value of the number register.
Well its the same thing - you can set a register in the ::after footnote pseudo element and then test that in the ::before pseudo element of the sub-head.
ok thanx Chris, I will check and let you know incase of any issue
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)
As I am not good in perl although I tried but could not achieve the desired result. Can you please send me the snapshot of the perl coding.
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>