[PHP] Re: DOMXML Warning

2008-02-13 Thread Nathan Rixham

Miguel J. Jiménez wrote:

Hi, after enabling error reporting with E_ALL I am having this strange
warning while loading a XML:

Warning: DOMDocument::load() [function.DOMDocument-load]: Extra content
at the end of the document in [...]

The code I use is:

$dom = new DOMDocument();
$dom-load(http://example.com/file.xml;);
[...]

If I open the xml uri (with firefox) I get a complete and well formed
xml (nothing strange about it).

With error reporting disabled everything works fine so I am
puzzled :-( Any help will be appreciated.


---
.-.
| Miguel J. Jiménez   |
| Sector Público, ISOTROL S.A.|
| [EMAIL PROTECTED]   |
:-:
| KeyID 0xFFE63EC6 hkp://pgp.rediris.es:11371 |
:-:
| Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.|
| Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).|
| Tlfn: +34 955 036 800 (ext.1805) - Fax: +34 955 036 849 |
| http://www.isotrol.com  |
:-:
| UTM ED-50 X:765205.09 Y:4144614.91 Huso: 29 |
:-:
| Oh no, Number One. I'm sure most will be much more |
| interesting. Let's see what's out there. Engage.   |
|  Capt. Jean-Luc Picard  |
|Star Trek TNG (1x01, Encounter At Farpoint)  |
'-'


check raw the file output by doing:
print_r(file_get_contents(http://example.com/file.xml;));

that should show you exactly what's causing the error.

another possibility is that the site has bot protection on there and is 
redirecting your request to a standard web page.


Alternatively pass the url to the XML file to me and I'll investigate 
for you.


Nathan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: DOMXML support should be added to PHP5

2004-07-25 Thread Scrumpy
[EMAIL PROTECTED] (Jason Barnett) wrote in
news:[EMAIL PROTECTED]: 

 Well you are right that if
 you used the old DOMXML functions in PHP4 that there is no clean way
 to move that code forward without rewriting / supporting two
 infrastructures.  I'm not a core developer but my guess is that they
 didn't mind dropping the support completely because in PHP4 it was all
 tagged as experimental. 

Looking at the two approaches, I preferred using DOMXML and as it was based 
on libxml2  libxslt it seemed to be the better option.

Clearly I've learn't my lesson never to use anything tagged as experimental  
again unless I'm highly competent with that language and if necessary, be 
willing and able to code everything myself.

 It's unfortunate for you, but I think making the change now makes
 sense because of the new DOM / SimpleXML support.

To a 'certain' extent the timing of the change is out of my hands as, like 
the majority of users, my website is hosted on a shared web server whose 
settings are out of my control.

 Perhaps another solution: create a class and call it DomDocument4_3_8
 or something that mimics the method calls / properties of the new
 DomDocument class.  Contact me off list if you need help with this.

Thanks for your offer of help.

Due to my current level of familiarity with PHP, the option best suited to 
me is the second workaround I mentioned in my earlier post i.e. to create 
PHP5 DOM versions of my scripts and a PHP version checking script that also  
then runs either my PHP4 DOMXML or PHP5 DOM scripts.

In order to learn PHP5's DOM function and develop replacement scripts, I'll 
have to find out how I can run both PHP4  5 interpreters with Apache on my 
PC. I have some ideas about how I can manage that ;-)

I don't have a broad knowledge of PHP yet. Up until now I narrowly focused 
on only what I needed to learn to be able to build something specific. That 
helped me to build a basic website templating system using XSLT but the 
vulnerabilities of that narrow approach are now all too obvious.

I hope in the future that other relatively inexperienced PHP users don't 
have to face this same situation.

In the future a transitional approach in PHP to replacing any function 
should be implemented. IMO, that is part of good project/life-cycle 
management.

My hope for the future is that PHP remains accessible and attractive to new 
users. It could be all too easy for the core PHP 'guru' developers to 
become blase about this aspect of the language.

Cheers,
Scrumpy :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: DOMXML support should be added to PHP5

2004-07-25 Thread Christian Stocker
On 25 Jul 2004 12:34:15 -, Scrumpy [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] (Jason Barnett) wrote in
 news:[EMAIL PROTECTED]:
 
  Well you are right that if
  you used the old DOMXML functions in PHP4 that there is no clean way
  to move that code forward without rewriting / supporting two
  infrastructures.  I'm not a core developer but my guess is that they
  didn't mind dropping the support completely because in PHP4 it was all
  tagged as experimental.
 
 Looking at the two approaches, I preferred using DOMXML and as it was based
 on libxml2  libxslt it seemed to be the better option.

I don't get that. The new DOM  and XSL extension is still based on
libxml2 and libxslt. Actually, the whole XML support in PHP 5 is now
based on libxml2 (meaning SimpleXML, ext/xml et al. as well)

 Clearly I've learn't my lesson never to use anything tagged as experimental
 again unless I'm highly competent with that language and if necessary, be
 willing and able to code everything myself.

Transitioning from DOMXML/PHP4 to DOM/PHP5 isn't really that
complicated. You have to change some methods and most if it can be
done with findreplace (for example create_element() to
createElement() ). Some functions are not anymore available in DOM, so
you have to invest a little bit more, but the logic of you're whole
application doesn't have to be changed (one such example is
new_child(), which has to be replaced with createElement/appendChild).

I agree that writing code, which should work on PHP4 and PHP 5 is a
little bit more complicated, but feasible as well (see
http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ for a start
(reposting this link, because I think the first message by me to this
topic didn't made it to the lists..))

  It's unfortunate for you, but I think making the change now makes
  sense because of the new DOM / SimpleXML support.
 
 To a 'certain' extent the timing of the change is out of my hands as, like
 the majority of users, my website is hosted on a shared web server whose
 settings are out of my control.

But he will inform you some time in advance, right? ;)

[...]
 
 In the future a transitional approach in PHP to replacing any function
 should be implemented. IMO, that is part of good project/life-cycle
 management.

It's usually the approach of PHP, but due to the chaotic and
nonstandard API of DOMXML/PHP4, it was decided to make a clear cut and
not invest any time in that, but instead really concentrate on
DOM/PHP5.
Furthermore it was marked (as you realized) experimental, so we warned you ;)

It won't happen again. DOM/PHP5 follows the standards established by
the W3C, so there's  no reason to break backwards compatibility
again... And it's not marked as experimental anymore.

 
 My hope for the future is that PHP remains accessible and attractive to new
 users. It could be all too easy for the core PHP 'guru' developers to
 become blase about this aspect of the language.

Drop your guru conspiracy, please ;) 
The PHP core team is usually very concerned about BC (backwards
compatibility) and as you maybe realized, 99% of PHP 4 scripts run on
PHP 5 without any problems at all. The one big exception is DOMXML,
for the reasons stated above.

chregu


 
 Cheers,
 Scrumpy :)
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: DOMXML support should be added to PHP5

2004-07-25 Thread Scrumpy
[EMAIL PROTECTED] (Christian Stocker) wrote in
news:[EMAIL PROTECTED]: 

 Looking at the two approaches, I preferred using DOMXML and as it was
 based on libxml2  libxslt it seemed to be the better option.
 
 I don't get that. The new DOM  and XSL extension is still based on
 libxml2 and libxslt. Actually, the whole XML support in PHP 5 is now
 based on libxml2 (meaning SimpleXML, ext/xml et al. as well)

The two *PHP4* approaches, the other being Expat + Sablotron.

 Transitioning from DOMXML/PHP4 to DOM/PHP5 isn't really that
 complicated.
[snip]
 I agree that writing code, which should work on PHP4 and PHP 5 is a
 little bit more complicated

A little bit more complicated than isn't really that complicated!

Translating function calls isn't something my current level of PHP can 
readily handle (although I'll work on improving that for the future). 
That's why I mentioned that the approach BEST suited to MY current 
abilities is to have my existing PHP4 DOMXML scripts and new PHP5 DOM 
scripts selected by a PHP version 'sensing' script.

 (see http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/

Thank you. I had seen that but it covers only some of DOMXML's XML 
functions and none of it's XSLT functions.

Of course it's good that Alexandre has published his code and it should be 
of help in the future when I'm learning how to translate function calls.

 To a 'certain' extent the timing of the change is out of my hands as,
 like the majority of users, my website is hosted on a shared web
 server whose settings are out of my control.
 
 But he will inform you some time in advance, right? ;)

Of course! Again, the point is that PHP4 DOMXML scripts will fail on 
webhosts' servers when they replace PHP4 with PHP5, unless a workaround has 
been put in place by each website's maintainer.

 Furthermore it was marked (as you realized) experimental, so we
 warned you ;) 

I accept that based on my level of knowledge of PHP, I made a mistake in 
using an experimental function and didn't sufficiently heed the warning. At 
the time I had naively thought that as DOMXML used the same libraries that 
were going to be used in PHP5's XML/XSLT support, that my code would also 
work in the future PHP5.

My background is not in programming as you might have realised :)

 My hope for the future is that PHP remains accessible and attractive
 to new users. It could be all too easy for the core PHP 'guru'
 developers to become blase about this aspect of the language.
 
 Drop your guru conspiracy, please ;)

Guru is used to highlight that the core developers must be experts.

It's possible that as their level of expertise grows, PHP's complexity 
increases, resulting in a more difficult learning curve for beginners and 
that this is something to guard against.

Cheers,
Scrumpy :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: DOMXML support should be added to PHP5

2004-07-23 Thread Scrumpy
Sorry for the repeated posts. I didn't know that they got queued awaiting 
confirmation of my email address :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: DOMXML support should be added to PHP5

2004-07-23 Thread Jason Barnett
Scrumpy wrote:
Sorry for the repeated posts. I didn't know that they got queued awaiting 
confirmation of my email address :)
Yeah, I was wondering about the reposts.  Well you are right that if you used 
the old DOMXML functions in PHP4 that there is no clean way to move that code 
forward without rewriting / supporting two infrastructures.  I'm not a core 
developer but my guess is that they didn't mind dropping the support completely 
because in PHP4 it was all tagged as experimental.

It's unfortunate for you, but I think making the change now makes sense because 
of the new DOM / SimpleXML support.  These two are largely interchangeable 
because they're just different ways of looking at the same underlying object.

Perhaps another solution: create a class and call it DomDocument4_3_8 or 
something that mimics the method calls / properties of the new DomDocument 
class.  Contact me off list if you need help with this.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: DOMXML...

2003-07-15 Thread Michael Smith
This is not an option for me... I'm writing a CMS and want to be able to 
do things for other users without specific compile options.

-Michael
Russell P Jones wrote:
This may not be what you are looking for, but the DOMXML object since PHP
4.0 works great --- you do have to compile PHP using the --with-dom
For example... If i am dealing with the following structure...

contacts
  contact
  nameRuss/name
  phone919.919.1919/phone
  /contact
  contact
  nameOther/name
  phone912.932.9328/phone
  /contact
/contacts
and the name of this xml file is contacts.xml

I would do the following...

$xmlDoc = domxml_open_file('xml/contacts.xml');
$root   = $xmlDoc-document_element();
$contacts = $root-children();
// this new $contacts file is an array of the xml tree. For example, to
call up the first set of contact info, the info for russ, just use
$contacts[0]
// but there is more. say you want to learn about this contacts[0] node,
such as pull the name russ. First, you have to get all the chirlden of
this node... so you can do...
$node_to_work_with = $contacts[0]-children();

// now this $node_to_work_with is an array with all the children,
including the name, phone, etc. built in + information about these
children. for example...
echo $node_to_work_with[0]-get_content();

// that would print Russ

echo $node_to_work_with[1]-get_content();

// that would print the Phone Number

echo $node_to_work_with[0]-name();

// that would print Name as in the name of the node, which
coincidentally happens to be name...
--Russ



--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: domxml memberfunction not dom compliant??

2003-01-30 Thread Øyvind Vestavik

Thanks for your reply Stefan.

I hadn't really read the manual, had just been working with DOM level 2 in
java before, and the fact that attributes are not children of elements,
puzzled me. But after reading the DOM level 2 spesification, it may seem
that you are right.

To me, the fact that attributes are not children of the element they are
contain within seems to defy the purpose of DOM, which is to represent
the entire document as a tree/trees depending on the documenttype.
This tree should be made up of Node interfaces, and as attributes inherit
from the Node interface (like element, text and so on) it seems odd to me
that the attribute is not part of the dom tree.

But I guess it is easier to rewrite my code according to the
shortcommings in dom than to change DOM level 2 and subsequently to
change the libxml-libraries :-)

vennlig hilsen
Øyvind

On Thu, 30 Jan 2003 [EMAIL PROTECTED] wrote:

 Hello
 As far as I rememeber according to DOM Level 2 Elementnodes contain
 Attributenodes but the Attributenode has no association with its
 Elementnode meaning you can't tell from an Attributenode which Elementnode
 it belongs to unless you remember it in your code. Thus an Attributenode
 is not part of the Domtree as an Elementnode and will not be returned as a
 Child of that Node. The only way to retrieve Attributenodes is by going
 throught the Elementnode and retrieving the attributes explicitly.
 In other words Attributenodes are special nodes which do not get nested in
 the DOMtree as children of their corresponding Elementnode. This leaves
 space for optimizing the DOMTree by inserting a single attributenode for
 multiple Elementnodes. (At least that is what I'm guessing...)

 Please correct me if I'm mistaken

 Stefan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: domxml memberfunction not dom compliant??

2003-01-29 Thread SLanger
Hello
As far as I rememeber according to DOM Level 2 Elementnodes contain 
Attributenodes but the Attributenode has no association with its 
Elementnode meaning you can't tell from an Attributenode which Elementnode 
it belongs to unless you remember it in your code. Thus an Attributenode 
is not part of the Domtree as an Elementnode and will not be returned as a 
Child of that Node. The only way to retrieve Attributenodes is by going 
throught the Elementnode and retrieving the attributes explicitly. 
In other words Attributenodes are special nodes which do not get nested in 
the DOMtree as children of their corresponding Elementnode. This leaves 
space for optimizing the DOMTree by inserting a single attributenode for 
multiple Elementnodes. (At least that is what I'm guessing...)

Please correct me if I'm mistaken

Stefan


[PHP] Re: domxml and setting the DOCTYPE

2002-09-24 Thread Raphael Bauduin

Please, don't tell me I can't set the doctype with php!?
Will I have to user a 3 liner in perl to set the doctype? :(

Raph


Raphael Bauduin wrote:

 Hi,
 
 I'm generating XML files with the domxml functions. Everything works fine,
 but I can't set the !DOCTYPE blah SYSTEM my.dtd.
 
 I tried to add a textnode, but  are translate in lt; gt; quot; :(
 
 
 Thanks for your help.
 
 Raph
 
 
 PS:Having some troubles to send on the ML, I send this through the news
 server (excuse if you get my request two times)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: domxml and setting the DOCTYPE

2002-09-24 Thread Marek Kilimajer

Don't know much about DOM, but it seems you can use dump_mem() to dump 
the xml into a string, and then replace your first line

Raphael Bauduin wrote:

Please, don't tell me I can't set the doctype with php!?
Will I have to user a 3 liner in perl to set the doctype? :(

Raph


Raphael Bauduin wrote:

  

Hi,

I'm generating XML files with the domxml functions. Everything works fine,
but I can't set the !DOCTYPE blah SYSTEM my.dtd.

I tried to add a textnode, but  are translate in lt; gt; quot; :(


Thanks for your help.

Raph


PS:Having some troubles to send on the ML, I send this through the news
server (excuse if you get my request two times)




  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: domxml and setting the DOCTYPE

2002-09-24 Thread Raphael Bauduin

thanks for your answer. I hoped there was a function to specify the doctype 
of the document generated. Apparently there isn't. It's as sad thing as I 
have to create another script just to add the doctype. 

Can someone just confirm me it's not possible with php to do what I want?

I find it strange you can read the doctype but not set it.

Raph

Marek Kilimajer wrote:

 Don't know much about DOM, but it seems you can use dump_mem() to dump
 the xml into a string, and then replace your first line
 
 Raphael Bauduin wrote:
 
Please, don't tell me I can't set the doctype with php!?
Will I have to user a 3 liner in perl to set the doctype? :(

Raph


Raphael Bauduin wrote:

  

Hi,

I'm generating XML files with the domxml functions. Everything works
fine, but I can't set the !DOCTYPE blah SYSTEM my.dtd.

I tried to add a textnode, but  are translate in lt; gt; quot; :(


Thanks for your help.

Raph


PS:Having some troubles to send on the ML, I send this through the news
server (excuse if you get my request two times)




  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Domxml: coping with UTF-16

2002-09-06 Thread Alexandru COSTIN

Hello,
You can try Krysalis to solve your problems.

We have fully implemented UTF-8 support in both XML generation and XSL 
transformation, using a CDATA passthrough technique.

http://www.interakt.ro/products/Krysalis/

As we have developed the site of the Romanian Ministry of ITC using 
Krysalis, we were stuck in a similar problem (both pasting from word and 
non ISO characters). The problems were fully resolved only after we have 
used the MB extension with a full UTF-8 XML/XSL pipeline.

Unfortunately, I don't know if the current released version 1.1.2 has all 
the internationalization features activated, but the 2.0 Lite version (due 
for release at the beginning of November) will surelly support it.


Alexandru

 Hi -
 
 I've built a web-based XML editor using PHP, so that clients can edit
 the sites themselves. The site HTML is generated dynamically via
 Sablotron. The problem is the users are copying-and-pasting from MS
 Word, and putting things like smart quotes and greek characters (one
 site is about maths) into the input boxes. This causes PHP to freak when
 it's trying to store the new content into the XML, and even if PHP
 survives, Sablotron breaks.
 
 I gather I need to set the XML document, XSL file, and stylesheet output
 to be UTF-16, instead of UTF-8. I can't see anything in the domxml
 functions to set encoding, though. Anyone got any ideas?
 
 Thanks,
 
 Gwyn.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: DOMXML...

2002-07-31 Thread Brian McGarvie

the line that gives the error...

Warning: failed to load external entity employees.xml in
C:\Inetpub\wwweloanshop\test\xml.php on line 36
What employees?

is...

$doc = xmldocfile(employees.xml) or die(What employees?);

Lallous [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hmm!

 1)Can you show the code @ line 36 if possible
 2)try to escape the \ (replace every \ with \\)


 Brian McGarvie [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I have a problem with DOMXML...
 
  I installed it and it is showing up in a phpinfo() script...
 
  However when I try a simple example it gives me an error such as:
 
  Warning: failed to load external entity employees.xml in
  C:\Inetpub\wwweloanshop\test\xml.php on line 36
 
  Any hints?
 
  [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
  www.anypurposeloans.com ]
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: DOMXML...

2002-07-31 Thread lallous

hmm!

1)Can you show the code @ line 36 if possible
2)try to escape the \ (replace every \ with \\)


Brian McGarvie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a problem with DOMXML...

 I installed it and it is showing up in a phpinfo() script...

 However when I try a simple example it gives me an error such as:

 Warning: failed to load external entity employees.xml in
 C:\Inetpub\wwweloanshop\test\xml.php on line 36

 Any hints?

 [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
 www.anypurposeloans.com ]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: DOMXML...

2002-07-31 Thread Dan Hardiker

Check that the file employees.xml exists, and try providing it with an
absolute reference rather than relative (eg:
c:\\xmlfiles\\employees.xml). Also check that the xml file renders ok in
Internet Explorer.


 the line that gives the error...

 Warning: failed to load external entity employees.xml in
 C:\Inetpub\wwweloanshop\test\xml.php on line 36
 What employees?

 is...

 $doc = xmldocfile(employees.xml) or die(What employees?);

 Lallous [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hmm!

 1)Can you show the code @ line 36 if possible
 2)try to escape the \ (replace every \ with \\)


 Brian McGarvie [EMAIL PROTECTED] wrote in
 message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I have a problem with DOMXML...
 
  I installed it and it is showing up in a phpinfo() script...
 
  However when I try a simple example it gives me an error such as:
 
  Warning: failed to load external entity employees.xml in
  C:\Inetpub\wwweloanshop\test\xml.php on line 36
 
  Any hints?
 
  [ Brian M McGarvie | www.mcgarvie.net  - www.the-local-guide.com -
 www.anypurposeloans.com ]
 
 





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative Ltd



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: DOMXML in 4.2.0 problems

2002-05-10 Thread Mike P

I am having similar difficulties with DOMXML in php4.2.0.
phpinfo() indicates all is well with the setup...

If you get some response, please share!

Thanks!

Mike
Thalis A. Kalfigopoulos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to get DOMXML to work with PHP4.2.0. I've compiled
with --with-dom and phpinfo() says it's there:
 DOM/XML enabled
 libxml Version 2.4.18
 HTML Support enabled
 XPath Support enabled
 XPointer Support enabled

 The following program though doesn't seem to work:

 $xmlstring='a valid xml document here';
 $domdoc=xmldoc($xmlstring);
 $root=$doc-document_element(); --- throw error

 I get an error regarding the call to DomDocument-document_element(). Also
I'm forced to use xmldoc() instead of the newer domxml_open_mem() because it
is also not recognized. What am I missing?

 thanks in advance,
 Thalis




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: DOMXML and encodings (php4.1.2, libxml2.4.16)

2002-03-24 Thread Stefan Livieratos

Hi

Lucky wrote:
 Hello all, I have a little problem with encodings with libxml2 resp. domxml
 in php.
 
 In our site we're storing articles as XML, ISO-8859-1 encoded (indicated in
 xml-header). Libxml2 is doing all the internal processing in UTF-8, so the
 article gets translated to UTF-8. But when I do an xmltree() on the article,
 all output of libxml is in UTF-8, too, and it's really ugly to read german
 umlauts in UTF-8 in a browser displaying all as ISO-8859-1.
 Is there any way (other than manually do utf8_decode on every part of the
 output, which is _very_ ugly and annoying) to tell php or libxml to output
 things in UTF-8?

No, unfortunately there isn't. Here's a quote from the libxml site 
(http://xmlsoft.org/encoding.html):

... basically the I18N (internationalization) support get triggered 
only during I/O operation, i.e. when reading a document or saving one

Regards,
Stefan Livieratos


-- 

ICS Plus
Internet Consulting + Services
==
Aeussere Brucker Str. 51
D-91058 Erlangen
Germany
==
Tel: +49 9131 127733
Fax: +49 9131 127744
E-mail : [EMAIL PROTECTED]
Web: http://www.icsplus.de
==


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php