[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

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
xsl value is set
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.