dmarston    2002/09/11 11:27:38

  Added:       test/tests/conf/axes axes130.xsl axes129.xsl axes130.xml
                        axes129.xml
  Log:
  New cases for attribute as context node
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/conf/axes/axes130.xsl
  
  Index: axes130.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
  
    <!-- FileName: axes130 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.2 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test for 'self::' axis on an attribute -->
  
  <xsl:output method="xml" encoding="UTF-8" indent="yes" />
  
  <xsl:template match="/">
    <out>
      <xsl:for-each select="//center">
        <xsl:apply-templates select="@*"/>
      </xsl:for-each>
    </out>
  </xsl:template>
  
  <xsl:template match="@*">
    <xsl:choose>
      <xsl:when test="self::node()">
        <any-node>true</any-node>
      </xsl:when>
      <xsl:otherwise>
        <any-node>false</any-node>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:choose>
      <!-- FALSE: principal node type of self is element -->
      <xsl:when test="self::*">
        <any-elem>true</any-elem>
      </xsl:when>
      <xsl:otherwise>
        <any-elem>false</any-elem>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="self::text()">
        <any-text>true</any-text>
      </xsl:when>
      <xsl:otherwise>
        <any-text>false</any-text>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:choose>
      <!-- FALSE: principal node type of self is element -->
      <xsl:when test="self::center-attr">
        <named>true</named>
      </xsl:when>
      <xsl:otherwise>
        <named>false</named>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/axes/axes129.xsl
  
  Index: axes129.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
  
    <!-- FileName: axes129 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 2.2 Axes -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Check the namespace axis starting from an attribute; should be empty 
-->
  
  <xsl:output method="xml" encoding="UTF-8" indent="yes" />
  
  <xsl:template match="/">
    <out>
      <xsl:apply-templates/>
    </out>
  </xsl:template>
  
  <xsl:template match="doc">
      <xsl:apply-templates select="@*"/>
  </xsl:template>
  
  <xsl:template match="doc/@*">
    <ns-count attr="{name(.)}" count="{count(namespace::*)}"/>
  </xsl:template>
  
  <xsl:template match="text()"/><!-- To suppress empty lines -->
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/conf/axes/axes130.xml
  
  Index: axes130.xml
  ===================================================================
  <?xml version="1.0"?>
  <north>
    <center center-attr="here">
       <south/>
    </center>
  </north>
  
  
  1.1                  xml-xalan/test/tests/conf/axes/axes129.xml
  
  Index: axes129.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  <docs xmlns:test="http://tester.com";>
    <doc x="x" test:y="y" jad:z="z" xmlns:jad="http://administrator.com"/>
  </docs>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to