xerces-p-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Orsatti <orsa...@istar.fr>
Subject setEncoding function
Date Thu, 30 Oct 2003 17:31:36 GMT
Hi

An other problem that I face.
I can't set the encding to "ISO-8859-1"
It is always "UTF-16"
Why ?

My code is:
my $impl = 
XML::Xerces::DOMImplementationRegistry::getDOMImplementation("LS");
#### Create a DOM writer
my $serializer = $impl->createDOMWriter();
$serializer->setEncoding("$XML::Xerces::XMLUni::fgISO88591EncodingString");

my $dt = eval{$impl->createDocumentType('PhysicalEntity', 'no', 
'PhysicalEntity.dtd')};
($@) and die ($@);

my $doc = eval{$impl->createDocument('', 'PhysicalEntity',$dt)};
($@) and die ($@);

$doc->setEncoding("\*XML::Xerces::XMLUni::fgISO88591EncodingString");
my $str = $serializer->writeToString($doc);

print STDERR "\n\n$str\n\n";

and I have the result:

<?xml version="1.0" encoding="UTF-16" standalone="no" ?><!DOCTYPE 
PhysicalEntity PUBLIC "no" "PhysicalEntity.dtd"><PhysicalEntity/>

I have try alse set ActualEncoding but it change nothing

thanks for your help

Christian



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org


Mime
View raw message