You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2001/03/07 02:43:03 UTC

Proposed conformance test: variable47

I have a proposed conformance test.  I reviewed my email from Shane
awhile back as to where to put these proposed tests but I'm still
unclear so I'm just including it here for now.  It seems like we should
have a directory like

  xml-xalan/java/test/tests/contrib/conf
and
  xml-xalan/java/test/tests/contrib-gold/conf-gold

but I didn't want to add directories to this part of the hierarchy on my
own.  Shane, it seems like you should be the one to add the directories
under contrib since that seems to be your "baby".

Anyway, here are the details:

---------------------- start variable47.xml ----------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<b>
  <a>One</a>
  <a>Two</a>
</b>
---------------------- end   variable47.xml ----------------------------

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

  <!-- FileName: variable47 -->
  <!-- Document: http://www.w3.org/TR/xslt -->
  <!-- DocVersion: 19991116 -->
  <!-- Section: 11 Variables and Parameters -->
  <!-- Purpose: Ensure that the default value is properly recalculated
for each node in a
                node-set. -->
  <!-- Creator: Jens Lautenbacher <jt...@schlund.de>, Gary L Peskin
(garyp@firstech.com) -->

  <xsl:template match="b">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="a">
    <xsl:param name="num"><xsl:value-of select="./text()"/></xsl:param>
    * <xsl:value-of select="$num"/> (<xsl:value-of select="./text()"/>)
  </xsl:template>

</xsl:stylesheet>
---------------------- end   variable47.xsl ----------------------------

---------------------- start variable47.out ----------------------------
<?xml version="1.0" encoding="UTF-8"?>

  
    * One (One)
  
  
    * Two (Two)
     <<Note:  there are two blanks on this last line -- Don't include
this note>>
---------------------- end   variable47.out ----------------------------

Gary