Re: [PHP-XML-DEV] html entities

[email protected] ("Rob Richards")
Newsgroups php.xml.dev
Message-ID <[email protected]>
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 <[email protected]> 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();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.