View Single Post
  #10 (permalink)  
Old November 22nd, 2007, 06:29 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

The good old default namespace strikes again.
Code:
<xsl:stylesheet    version="1.0" xmlns:x="http://www.w3.org/1999/xhtml"   xmlns="http://www.w3.org/1999/xhtml"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    xmlns:exslt="http://exslt.org/common"  extension-element-prefixes="exslt">

  <xsl:output    indent="yes"    method="xml"    encoding="UTF-8"    omit-xml-declaration="yes"    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>

  <xsl:template match="/">
    <html>
      <head>
        <title>                test            </title>
      </head>
      <body>
        <xsl:call-template name="select">
          <xsl:with-param name="options">
            <option>
              <name>1</name>
              <value>test1</value>
            </option>
            <option>
              <name>2</name>
              <value>test2</value>
            </option>
          </xsl:with-param>
        </xsl:call-template>
      </body>
    </html>
  </xsl:template>
  <xsl:template name="select">
    <xsl:param name="options" />
    <xsl:for-each select="exslt:node-set($options)/*">
      <p>
        <xsl:copy-of select="x:name"/>
      </p>
      <b>
        <xsl:copy-of select="x:value"/>
      </b>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>
See first post in this forum category for more information on default namespaces if you need it.

I think you also want
Code:
exclude-result-prefixes="exslt"
rather than
Code:
extension-element-prefixes="exslt"
--

Joe (Microsoft MVP - XML)
Reply With Quote