Re: html entities
| From: | Rob Richards | Date: | Sat, 19 Jul 2003 12:36:00 +0000 |
| Subject: | Re: html entities | ||
| References: | 1 2 3 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-169@lists.php.net to get a copy of this message | ||
Currently none of the HTML dump functions (as in the old domxml) are
implemented in DOM. These are nice to haves but not current priorities.
If you are not setting the encoding method in the xsl output, then you will
need to handle it after the fact.
You can change the encoding of the resulting document (see inline code for
addition).
NOTE: To do this, please grab a recent snap. A recent fix for memory
corruption when using some of the document properties was made.
From: Kevin Waterson
> This one time, at band camp, Derick Rethans <derick@php.net> wrote:
>
> > It's mostly the sign of the start of a two-byte Unicode character. Did
> > you set the output encoding to UTF-8?
>
> ahh, this must be it, it is set in the xsl, I assumed it would be default
with
> the new dom. This is what I have...
>
> // create new xsltprocessor
> $proc = new xsltprocessor();
> // create new domDocument
> $dom = new domDocument;
> // create new domDocument
> $dom2 = new domDocument;
> // load domDocument from string
> $dom2->loadxml($xmlstring);
> // load domDocument from string
> $dom->load('my.xsl');
> // import stylesheet from domDocument
> $proc->importStylesheet($dom);
> // create domDocument from transformation (returns domDocument)
> $result = $proc->transformToDoc($dom2);
/*************** BEGIN Change document encoding for output
******************/
$result->encoding = "HTML";
/*************** END Change document encoding for output ******************/
> // output domDocument xml to string
> print $result->savexml();