RE: xsl self-documentation - weave

Subject: RE: xsl self-documentation - weave
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Tue, 27 Jun 2000 12:50:07 +0100
With the summary below then, suggest we split the problem
into the two domains,
the 'weave' solution and
the 'trace' solution.

Perhaps id which is being referred to by the subject heading?

I take particlular note of your comment that 'trace' is much
more often used than 'weave'.

Since perhaps the weave solution is already partly in hand
with the solutions offered, perhaps that's the one to focus
on initially?

I'll add an example below from Norm Walsh's stylesheets.

Unsure how Norm uses them, but I'm guessing he's weaving
rather than tracing.

Regards, DaveP

1. from param.xsl

<xsl:variable name="html.stylesheet"></xsl:variable>

<doc:variable name="html.stylesheet" xmlns="">
<refpurpose>Name of the stylesheet to use in the generated HTML</refpurpose>
<para>The name of the stylesheet to place in the HTML
tag, or the empty string to suppress the stylesheet <sgmltag>LINK</sgmltag>.

and 2. from xref.xsl

<doc:template name="xpointer.idref" xmlns="">
<refpurpose>Extract IDREF from an XPointer</refpurpose>
<para>The <function>xpointer.idref</function> template returns the
ID portion of an XPointer which is a pointer to an ID within the current
document, or the empty string if it is not.</para>
<para>In other words, <function>xpointer.idref</function> returns
<quote>foo</quote> when passed either <literal>#foo</literal>
or <literal>#xpointer(id('foo'))</literal>, otherwise it returns
the empty string.</para>

<xsl:template name="xpointer.idref">
  <xsl:param name="xpointer">http://...</xsl:param>
    <xsl:when test="starts-with($xpointer, '#xpointer(id(')">
      <xsl:variable name="rest" select="substring-after($xpointer,
      <xsl:variable name="quote" select="substring($rest, 1, 1)"/>
      <xsl:value-of select="substring-before(substring-after($xpointer,
$quote), $quote)"/>
    <xsl:when test="starts-with($xpointer, '#')">
      <xsl:value-of select="substring-after($xpointer, '#')"/>
    <!-- otherwise it's a pointer to some other document -->

 XSL-List info and archive:

Current Thread