Subject: | Base URIs: mention in no case will any <a href="..."> be altered |
On
XML::LibXML::Parser
at
URI /parser, html, reader/
In case of parsing strings or file handles, XML::LibXML doesn't
know about the base uri of the document. To make relative
references such as XIncludes work, one has to set a base URI, that
is then used for the parsed document.
please add:
In no case will any <a href="..."> be altered, nor will any <base />
tags be added, when outputting with toString(), etc. The same
holds true for any $baseuri or base_uri mentioned here.
Example:
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use XML::LibXML;
my $doc = XML::LibXML->new->parse_html_string( '<a href="/bla">oo</a>',
{ URI => 'http://example.com' } );
print $doc->URI(), "\n";
$_ = $doc->toString(1);
print;
s/.*DOCTYPE.*\n//m;
my $doc2 = XML::LibXML->new->parse_string( $_, 'http://example.org' );
print $doc2->toString(1);