|
Posted by SM on 02/06/07 21:03
On Feb 6, 3:49 pm, Umberto Salsi <s...@icosaedro.italia> wrote:
> "SM" <servandomont...@gmail.com> wrote:
> > $dom = new DOMDocument('1.0');
>
> $dom = new DOMDocument('1.0', 'iso-8859-1")
>
> Best regards,
> ___
> /_|_\ Umberto Salsi
> \/_\/ www.icosaedro.it
Thanks for the quick answer.
I've try using it and it gives me an error. I mean, If i don't put the
character á then its ok but if i put the character á then i get
errors.
I´ve simplified my code so it fits in 20 lines... easier to test.
Here it is:
<?php
//set the outpout content type as xml
header ('Content-Type: text/xml');
//create the DOM document
$dom = new DOMDocument('1.0', 'ISO-8859-1');
// create the root <discography> element
$discography = $dom->createElement('discography');
$dom->appendChild($discography);
//create the <cd> element and append it as a child of <discography>
$cd = $dom->createElement('cd');
$discography->appendChild($cd);
//create the <title> element for the <cd>
$title = $dom->createElement('title');
$titleText = $dom->createTextNode('á');
$title->appendChild($titleText);
//append the <title> to <cd>
$cd->appendChild($title);
//build the XML structure in a string variable
echo $dom->saveXML();
?>
Im not sure whats wrong?
Thanks again
SM
[Back to original message]
|