This is the mail archive of the xsl-list@mulberrytech.com mailing list .
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Honestly, this is baffling. Please test very carefully (using the same XPath expressions in your for-each select) to confirm that it's the presence or absence of the <body> node that makes the difference. There's no way in XSLT it should; it does not change the context for the evaluation of any expressions.Regarding the namespace I am using, one of the reasons I have not moved to the newer namespace is that I cannot seem to make an output stylesheet look very nice using the http://www.w3.org/1999/XSL/Transform namespace. Perhaps, someone could give me suggestions with this problem: The biggest issue I have is when I try to define the body of the stylesheet. In the example below, I have a couple simple xsl commands, and I've defined a body with a background color. Normally, I would get a list of all the "metadata/idinfo/citation/citeinfo/onlink" elements, followed by the "metadata/idinfo/citation/citeinfo/origin" element. However, once I have entered the "<body>" tag, every xsl command following the for-each command end up blank - the "metadata/idinfo/citation/citeinfo/origin" will not appear in the result, and I get no processing errors. If the "<body>" tag and it's closing tag "</body>" are removed from the code below, then everything works fine, but I'm stuck with unformatted results.
If you're targetting web display, write XSLT that creates HTML (for now). At present FOs are still being used mainly to generate print output (e.g. in PDF).I've tried looking at formatting objects in XSL, but haven't been able to get anything to work yet.
If you're not getting your values reported, it's probably because this XPath returns no nodes. Does your source look more or less like<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <HTML> <body bgcolor="#cccccc"> <xsl:for-each select="metadata/idinfo/citation/citeinfo/onlink">
This should be (position() != last())<xsl:value-of select="." /> <xsl:if test="current()[(position() != last())]">
From the design of this stylesheet, it also looks like you might want to do a bit of homework on templates. You don't really need them for this simple application, but you will.<br/> </xsl:if> </xsl:for-each> <xsl:value-of select="metadata/idinfo/citation/citeinfo/origin"/> </body> </HTML> </xsl:template> </xsl:stylesheet>
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |