[xslt] Re: XML::LibXSLT vs. document("") (fwd)



Slight bug in document("") perhaps?

-- 
<!-- Matt -->
<:->Get a smart net</:->

---------- Forwarded message ----------
Date: Wed, 04 Dec 2002 19:28:43 +0100
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: Matt Sergeant <matt@sergeant.org>
Cc: "perl-xml@listserv.ActiveState.com" <perl-xml@listserv.ActiveState.com>
Subject: Re: XML::LibXSLT vs. document("")

* Matt Sergeant wrote:
>>   It seems to me the current XML::LibXSLT does not support document("")
>> to refer to the current style sheet, e.g.
>>
>>   <xsl:copy-of select = 'document("")' />
>>
>> returns an empty node set. Is this a known limitation of the processor?
>
>No, it should work according to the spec. See the distribution's
>t/07blankdoc.t file, and the large comment about having to use
>callbacks.

Ok, I found the offending part:

  #!perl -w
  use strict;
  use warnings;
  use XML::LibXML;
  use XML::LibXSLT;
  use Data::Dumper;

  my $parser = XML::LibXML->new();
  my $xslt = XML::LibXSLT->new();

  my $source = $parser->parse_file('r.xml');
  my $style_doc = $parser->parse_file(q(e:\ym\example\2\l2l.xslt));
  #                                     ^^^^^^^^^^^^^^^^^^^^^^^^

  my $stylesheet = $xslt->parse_stylesheet($style_doc);

  my $results = $stylesheet->transform($source);

  print $results->toString;

Using a relative path like 'l2l.xslt' or slashes in the path like
'e:/ym/example/2/l2l.xslt' it works, but using the path above,
document("") returns an empty node set, while the rest of the style
sheet works as expected.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]