diff options
author | Anatol Belski <ab@php.net> | 2014-04-01 10:08:08 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-04-01 10:08:08 +0200 |
commit | fca1501ed6ab2018cc114899fe8fc1f203befb6b (patch) | |
tree | 30903181e364c8d2ad3567c7699c241762b87fb0 /ext | |
parent | 3cb056f523d470a677a1c7fc186ce2720fece535 (diff) | |
download | php-git-fca1501ed6ab2018cc114899fe8fc1f203befb6b.tar.gz |
added test for bug #53965
Diffstat (limited to 'ext')
-rw-r--r-- | ext/xsl/tests/53965/collection.xml | 13 | ||||
-rw-r--r-- | ext/xsl/tests/53965/collection.xsl | 11 | ||||
-rw-r--r-- | ext/xsl/tests/53965/include.xsl | 7 | ||||
-rw-r--r-- | ext/xsl/tests/bug53965.phpt | 27 |
4 files changed, 58 insertions, 0 deletions
diff --git a/ext/xsl/tests/53965/collection.xml b/ext/xsl/tests/53965/collection.xml new file mode 100644 index 0000000000..a3039cd101 --- /dev/null +++ b/ext/xsl/tests/53965/collection.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<collection> + <cd> + <title>Fight for your mind</title> + <artist>Ben Harper</artist> + <year>1995</year> + </cd> + <cd> + <title>Electric Ladyland</title> + <artist>Jimi Hendrix</artist> + <year>1997</year> + </cd> +</collection>
\ No newline at end of file diff --git a/ext/xsl/tests/53965/collection.xsl b/ext/xsl/tests/53965/collection.xsl new file mode 100644 index 0000000000..5474f863ec --- /dev/null +++ b/ext/xsl/tests/53965/collection.xsl @@ -0,0 +1,11 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:include href="include.xsl"/> + + <xsl:param name="owner" select="'Nicolas Eliaszewicz'"/> + <xsl:output method="html" encoding="iso-8859-1" indent="no"/> + <xsl:template match="collection"> + Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection! + <xsl:apply-templates/> + </xsl:template> +</xsl:stylesheet>
\ No newline at end of file diff --git a/ext/xsl/tests/53965/include.xsl b/ext/xsl/tests/53965/include.xsl new file mode 100644 index 0000000000..4a01296705 --- /dev/null +++ b/ext/xsl/tests/53965/include.xsl @@ -0,0 +1,7 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="cd"> + <h1><xsl:value-of select="title"/></h1> + <h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> + <hr /> + </xsl:template> +</xsl:stylesheet>
\ No newline at end of file diff --git a/ext/xsl/tests/bug53965.phpt b/ext/xsl/tests/bug53965.phpt new file mode 100644 index 0000000000..8de777ed63 --- /dev/null +++ b/ext/xsl/tests/bug53965.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #53965 (<xsl:include> cannot find files with relative paths when loaded with "file://") +--SKIPIF-- +<?php +if (!extension_loaded('xsl')) die("skip Extension XSL is required\n"); +?> +--FILE-- +<?php + +$base = 'file://' . dirname(__FILE__) . DIRECTORY_SEPARATOR . '53965'; + +$xml = new DOMDocument(); +$xml->load($base . DIRECTORY_SEPARATOR . 'collection.xml'); + +$xsl = new DOMDocument(); +$xsl->load($base . DIRECTORY_SEPARATOR . 'collection.xsl'); + +$proc = new XSLTProcessor; +$proc->importStyleSheet($xsl); + +echo $proc->transformToXML($xml); +?> +--EXPECTF-- +Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection! + + <h1>Fight for your mind</h1><h2>by Ben Harper - 1995</h2><hr> + <h1>Electric Ladyland</h1><h2>by Jimi Hendrix - 1997</h2><hr> |