tests/insn/copy/copy-3702.xsl
author Michael Kay <mike@saxonica.com>
Fri, 08 Aug 2014 12:25:05 +0100
changeset 591 9e5ff3068934
permissions -rw-r--r--
New test case copy-3702 (Saxon bug report)
591
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     1
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     2
               xmlns:f="http://www.w3.org/2005/Atom"
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     3
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     4
               version="2.0">
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     5
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     6
   <!-- This stylesheet is a repro of Saxon bug 2123. It is designed to check
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     7
     that the in-scope namespaces of a copied node are correct. The particular
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     8
     use of a pseudo-recursive function to create the copy is designed to take
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
     9
     Saxon down a particular path where the copy is a virtual copy of the original
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    10
     node rather than a physical copy -->
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    11
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    12
   <xsl:template match="/">
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    13
      <p><xsl:value-of select="f:firstType(.,1)/in-scope-prefixes(.)" separator="|"/></p>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    14
   </xsl:template>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    15
   
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    16
   <xsl:function name="f:firstType">
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    17
     <xsl:param name="doc" as="node()"/>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    18
     <xsl:param name="which" as="xs:integer"/>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    19
     <xsl:copy-of select="($doc/*/*)[$which]"/>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    20
     <xsl:if test="$which lt 100">
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    21
       <xsl:sequence select="f:firstType($doc, 120)"/>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    22
     </xsl:if>  
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    23
   </xsl:function>
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    24
9e5ff3068934 New test case copy-3702 (Saxon bug report)
Michael Kay <mike@saxonica.com>
parents:
diff changeset
    25
</xsl:stylesheet>