1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-08 21:42:07 +03:00

- libxslt/preproc.c: removed a warning on xsl:transform

- tests/docs/Makefile.am tests/docs/array.xml tests/general/Makefile.am
  tests/general/array.out tests/general/array.xsl: added a new
  test fround in xsl-dev
Daniel
This commit is contained in:
Daniel Veillard
2001-06-14 08:09:43 +00:00
parent bb3b8786f9
commit 2e5b47750a
7 changed files with 47 additions and 0 deletions

24
tests/general/array.xsl Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- filename: test.xsl created on: 2001 Jun 14 01:35:21 +0200 (CEST) last modified: 2001 Jun 14 01:47:18 +0200 (CEST) (c) 2001 by Goetz Bock <bock@blacknet.de>
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:local="data local to this file" version='1.0'>
<xsl:output method="text" />
<local:benefit>
<local:period ID='12M'>1</local:period>
<local:period ID='18M'>2</local:period>
<local:period ID='24M'>3</local:period>
<local:period ID='2Y' >4</local:period>
<local:period ID='5Y' >5</local:period>
</local:benefit>
<xsl:template match="/">
<xsl:text>First we try to find the value for "12M" (should be 1): </xsl:text>
<xsl:value-of select="document('')//local:benefit/local:period[@ID='12M']"/>
<xsl:text>&#xA;Now we define a variable $BP to be "18M".</xsl:text>
<xsl:variable name="BP">18M</xsl:variable>
<xsl:text>&#xA;$BP is defined as: </xsl:text>
<xsl:value-of select="$BP" />
<xsl:text>&#xA;Now we try to find the value for $BP (should be 2): </xsl:text>
<xsl:value-of select="document('')//local:benefit/local:period[@ID=$BP]"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:transform>