vibha has asked for the wisdom of the Perl Monks concerning the following question:
my $doc = XML::LibXML->new->parse_file ($file);
my $dtd = $doc->internalSubset;
my $dtd_str = $dtd->toString(1,1);
#Some code here to modify the dtd path, which I donot have yet -but even without this the below does not work
$dtd = XML::LibXML::Dtd->parse_string($dtd_str);
$doc->setInternalSubset($dtd);
The parse_string line thows an error
Entity: line 1: parser error : Content error in the external subset
<!DOCTYPE pageItem SYSTEM "http://webdev.kodak.com/global/mul/business/docimagin
^
Entity: line 1: parser error : Content error in the external subset
<!DOCTYPE pageItem SYSTEM "http://webdev.kodak.com/global/mul/business/docimagin
^
Please help! Is the $dtd_str not in the right format? I have tried to find help about the format of input to parse_string but failed.
Basically I need to change the DTD paths in some xml files.
I figured if the above works I can do that easily.
But :(
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::LibXML update DTD/DOCTYPE in xml file
by ssk (Initiate) on Dec 23, 2005 at 13:13 UTC |