Re: [Q] for PHP4.0 + DOM XML function using
| From: | Carl W. Brown | Date: | Thu, 24 Aug 2000 06:45:16 +0000 |
| Subject: | Re: [Q] for PHP4.0 + DOM XML function using | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-63@lists.php.net to get a copy of this message | ||
±èµ¿Çö,
The problem with the PHP XML is that it uses the Expat XML code which is
based on the Latin1 codepage.
You might be able to use a separate euc-kr -> Unicode -> utf-8 converter.
The utf-8 functions in expat and PHP also only work for Latin1. However
once it is in utf-8 the xml parser might work.
I have an answer for PHP-3 but I have not upgraded my code to PHP-4 yet.
Carl
"±èµ¿Çö" <kimdh@nice.co.kr> wrote in message
news:01e301c005a9$ad7c72c0$28d5eacb@kimdh...
> HI?
>
> First I'm sorry.
> I have a problem Using PHP4.0 + libxml2.2.2 (DOM XML function) with xml
doc.
> Because I don't have any references, I don't know what to do.
> Could you help me?
>
> I'm a Korean.
>
> I want to use Korean langage XML doc.
> I love to managing that xml doc with PHP4.0 + DOM XML function.
>
> I succeeded in using PHP4.0+DOM XML function with English XML Doc.
> But I have a problem using PHP4.0+DOM XML function with Korean XML Doc.
>
> When Element name is Korean or PCDATA is Korean or ATTLIST is Korean ,
> Using PHP4.0 + DOM XML function displayed &#xx character within Korean
Language.
>
> There is no error libxml2.2.2 by author of libxml2.2.2.
> What shall i do ?
>
> --------------------------------------------------------------------------
------
>
> Source Like this:
> <html>
> <head></head>
> <body bgcolor="#ffffff">
> <pre>
> <?
> $doc = new_xmldoc("1.0");
> $root = $doc->add_root("questions");
> $root->setattr("version","1");
>
> $one = $root->new_child("Áú¹®µé","");
> $one->setattr("Áú¹®¹øÈ£","1");
> $one->new_child("³»¿ë","libxml-2.0.0 ? À» ¾î¶»°Ô
> ¾ò³ª¿ä?");
> $one->new_child("answer","You can download the latest release of libxml
either as a source archive o
> r RPM package from http://xmlsoft.org/. The current version is
libxml2-2.2.1.");
>
> $two = $root->new_child("question","");
> $two->setattr("number","2");
> $two->new_child("text","2. how to configure PHP4 ?");
> $two->new_child("answer","DIR is the libxml install directory (if you
just use --with-dom it defaul
> ts to /usr), I needed to use --with-dom=/usr/local");
>
> $three = $root->new_child("question","");
> $three->setattr("number","3");
> $three->new_child("text","3. how to use DOM XML function ?");
> $three->new_child("answer","Read this document source for a simple
example.");
>
> print(htmlspecialchars($doc->dumpmem()));
> ?>
> </pre>
> </body>
> </html>
>
>
> --------------------------------------------------------------------------
------
>
> Display Like this in IE5.0 :
> <?xml version="1.0"?>
> <questions version="1">
> <Áú¹®µé Áú¹®¹øÈ£="1">
> <³»¿ë>libxml-2.0.0 ? ; ¾¾î¶»°Ô ¾ò³ª¿ä?</³»¿ë>
> <answer>You can download the latest release of libxml either as a source
archive or RPM package from http://xmlsoft.org/. The current
version is
libxml2-2.2.1.</answer>
> </Áú¹®µé>
> <question number="2">
> <text>2. how to configure PHP4 ?</text>
> <answer>DIR is the libxml install directory (if you just use --with-dom
it defaults to /usr), I needed to use --with-dom=/usr/local</answer>
> </question>
> <question number="3">
> <text>3. how to use DOM XML function ?</text>
> <answer>Read this document source for a simple example.</answer>
> </question>
> </questions>
>
>
> --------------------------------------------------------------------------
------
>
> Thanks .
>
>