[Home] [By Thread] [By Date] [Recent Entries]
Ken,
I did not realize I could nest <xsl:result-document> constructs. With that in mind, I think I will review the entire stylesheet. Thanks again for your generous gift of time and experience. Mark -----Original Message----- From: G. Ken Holman Sent: Thursday, September 29, 2011 2:12 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Identifying unique attribute values in nested sibling elements At 2011-09-29 13:49 -0700, Mark wrote: (1) Please think of the <Value> attributes as though 'kc-value' were equivalent to 'dollars' and 'h-value' to 'cents' (the l-value mentioned earlier is like those US stamps issued just before a rate change that are expressed as a letter value). <Value> attributes can only appear [ignoring the specific instance values given here] in the following combination: I'll assume you already have pre-validation for that. (2) These <Value> elements would produce this XHTML for the particular target XHTML page:
(3) I need to modify your 'reports' function to accommodate all four possibilities, but do not know enough about XPath to do it. May I bother you one more time to show me how?
<!--common reporting-->
<xsl:variable name="dir">../aval/</xsl:variable>
<xsl:function name="m:report">
<xsl:param name="Stamp"/>
<xsl:for-each select="$Stamp/Value">
<xsl:choose>
<xsl:when test="@l-value">
<!--ignore kc-value and h-value-->
<a href="{$dir}{lower-case(@l-value)}.htm">
<xsl:value-of select="@l-value"/>
</a>
</xsl:when>
<xsl:when test="@kc-value='0'">
<!--ignore kc-value-->
<a href="{$dir}0-{@h-value}.htm">
<xsl:value-of select="@h-value"/>h<xsl:text/>
</a>
</xsl:when>
<xsl:when test="@h-value">
<!--both in play-->
<a href="{$dir}{@kc-value}-{@h-value}.htm">
<xsl:value-of select="@kc-value"/>.<xsl:text/>
<xsl:value-of select="@h-value"/>kc<xsl:text/>
</a>
</xsl:when>
<xsl:otherwise>
<a href="{$dir}{@kc-value}.htm">
<xsl:value-of select="@kc-value"/>kc<xsl:text/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:function>As an aside, the stylesheet transforms the XML into an XHTML page for every <Stamp> element, and to an additional page for each of the different <Formats> elements (there are five optional possibilities).
It is *extremely* easy for me to identify which pages to generate when I am in the context of a <Stamp> element that has certain characteristics (and these characteristics change). I suspect that someone with your sophistication could do it from the context of the <Set> element, but it escapes me how to do it that way. This is why I keep rewriting the suggestions I have received to operate from within the context of a <Stamp> element rather than from within the context of the enclosing <Set> element. Dumb, I know, but I already know how to do it.
I have overrun my daily (weekly!) contribution time for vounteering so will leave it in what I'm sure are your capable hands if you pause to look at the big picture of what you are trying to do. Good luck! . . . . . . . . . . . Ken -- Contact us for world-wide XML consulting and instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|

Cart



