Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
perl-XML-LibXSLT
perl-XML-LibXSLT-wrongtest.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-XML-LibXSLT-wrongtest.diff of Package perl-XML-LibXSLT
--- t/10functions.t +++ t/10functions.t @@ -1,5 +1,5 @@ use Test; -BEGIN { plan tests => 33 } +BEGIN { plan tests => 31 } use XML::LibXSLT; { @@ -86,56 +86,6 @@ } } -{ - # testcase by Elizabeth Mattijsen - my $parser = XML::LibXML->new; - my $xsltproc = XML::LibXSLT->new; - - my $xml = $parser->parse_string( <<'XML' ); -<html><head/></html> -XML - my $xslt = $parser->parse_string( <<'XSLT' ); -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:foo="http://foo" - version="1.0"> -<xsl:template match="/html"> - <html> - <xsl:apply-templates/> - </html> -</xsl:template> -<xsl:template match="/html/head"> - <head> - <xsl:copy-of select="foo:custom()/foo"/> - <xsl:apply-templates/> - </head> -</xsl:template> -</xsl:stylesheet> -XSLT - - my $aux = <<'XML'; -<bar> - <y><foo>1st</foo></y> - <y><foo>2nd</foo></y> -</bar> -XML - { - XML::LibXSLT->register_function( - ('http://foo', 'custom') => sub { $parser->parse_string( $aux )->findnodes('//y') } - ); - my $stylesheet = $xsltproc->parse_stylesheet($xslt); - my $result = $stylesheet->transform($xml); - ok ($result->serialize,qq(<?xml version="1.0"?>\n<html xmlns:foo="http://foo"><head><foo>1st</foo><foo>2nd</foo></head></html>\n)); - } - { - XML::LibXSLT->register_function( - ('http://foo', 'custom') => sub { $parser->parse_string( $aux )->findnodes('//y')->[0]; }); - my $stylesheet = $xsltproc->parse_stylesheet($xslt); - my $result = $stylesheet->transform($xml); - ok ($result->serialize,qq(<?xml version="1.0"?>\n<html xmlns:foo="http://foo"><head><foo>1st</foo></head></html>\n)); - } -} - { my $parser = XML::LibXML->new; my $xsltproc = XML::LibXSLT->new;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor