Re: Stumped on why a field isn't showing up
I'm trying to learn XSL(-FO), so I'm still beating my head against the wall.
...<xsl:template match="/"> <fo:root font-family="Courier" font-size="12pt">
<xsl:template match="chapter"> <fo:page-sequence master-reference="manuscript-body"> <fo:static-content flow-name="xsl-region-before"> <fo:block text-align="right" space-before="1in" end-indent="1.5in"> <xsl:value-of select="/novel/heading"/> / <fo:page-number/>
Here you use an absolute XPath, which will get you the string value of /novel/heading, something you probably expect.
<fo:flow flow-name="xsl-region-body" line-height="1.5"> <xsl:apply-templates select="novel/author"/>
However, at this point you use a relative XPath (no slash "/" in format). This means the processor will try to walk it down from the context node, which is most likely a /novel/chapter node. I suppose these nodes don't have a novel child, and you wont get to the /novel/author node anyway. You want to use <xsl:apply-templates select="/novel/author"/> <xsl:apply-templates select="/novel/address"/> here.
You should probably think about restructuring your processing logic. In many cases it's considered "bad style" to grab parts outside the subtree starting at the currently processed node. A way to avoid this is to use template parameters, they have their own set of drawbacks though.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format