RE: How is this part of the XSLT specification to be interpreted?

Subject: RE: How is this part of the XSLT specification to be interpreted?
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Wed, 21 Jun 2000 14:02:35 +0100
Building on David Carlisles stylesheet, to make it a *bit* more
obvious what's going on :-)


I can see the principles he's using, but I can't say that its particularly
elegant.

I think I'd rather see some java class that processed stuff in the 
doc namespace. Then at least it would look better.

Regards DaveP


xml======
<?xml version='1.0'?>
<xxx xmlns="http://SourceDocument";>
  <b a="2">
    <x:c xmlns:x="http://AnotherNamespace"/>
  <c>text</c>
  </b>
</xxx>
xsl=========

<?xml version='1.0'?>
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
 version="1.0"

extension-element-prefixes="doc"
  exclude-result-prefixes="main x"
  xmlns:doc="http://Documentation.com";
  xmlns:main="http://SourceDocument";
  xmlns:x="http://AnotherNamespace";
                >

<xsl:output method="xml" indent="yes"/>


<xsl:template match="main:xxx">
  <doc:template>
    <xsl:fallback><doc>
      This template matches the  "<xsl:value-of select="name()"/>"
element.</doc>
    </xsl:fallback>
  </doc:template>
  <doc:select>
    <xsl:fallback><doc>The next elements to be processed are
grandchildren</doc>
    </xsl:fallback>
  </doc:select> 
  <xsl:apply-templates select="*/*"/>
 <doc:select>
    <xsl:fallback>&#x0a;&#x0a;The next elements to be processed are children
of the "<xsl:value-of select="name()"/>" element
    </xsl:fallback>
  </doc:select> 
  <xsl:apply-templates select="main:b"/>

</xsl:template>


<xsl:template match="x:c">
  <doc:template>
    <xsl:fallback>
      <doc>  <emph>This</emph> template matches 
       and copies c element nodes in the <xsl:value-of
select="namespace-uri()"/> namespace
	<xsl:copy-of select="."/>&#x0a;</doc>
    </xsl:fallback>`
  </doc:template>
</xsl:template>

<xsl:template match="main:b">
  <doc:template>
    <xsl:fallback><doc> The attribute value is set to: <xsl:value-of
select="@a"/></doc>
  </xsl:fallback>
</doc:template>
Normal processing <xsl:value-of select="@a"/> End normal processing.
</xsl:template>


</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread