Re: [xml] DOM modifying XML without permission



Hi Rob,

I'm using PHP 5.1 and libxml2 2.6.17, I can't find any documentation
on these options. Could you provide pointers? (I assume because they
are libxml2 options, it's still relevant to this list).

Kind regards,
Aidan

On 7/19/05, Rob Richards <rrichards ctindustries net> wrote:
Question should have gone to the php general list.

To answer the question though, resolveExternals property is also adding
the default attributes into the tree. This property is not part of specs
and behavior as is for those coming from domxml in PHP 4. In PHP 5.1
(libxml2 2.6.0+ required), you can pass the libxml parser options (2nd
optional argument) when calling the load methods to get finer grain
control over the loading of the document.

Rob

Aidan Lister wrote:

Hello list,

I'm not sure if this is the correct place to ask this question, please
feel free to redirect me if this is the case.

I've noticed that when using (libxml2) DomDocument::load(), the XML
loaded (simple docbook xml with DTD specified) does not match the XML
entered.

A specific example of this is the addition of 'float="0"' to
<figure>'s. <figure id="foobar"> is loaded, but <figure id="foobar"
frame="0"> is output with DomDocument::saveXml().

A quick look at the docbook spec,
http://www.docbook.org/tdg/en/html/figure.html, shows that frame="0"
is a default value. That's nice, but why does Dom feel the need to add
it to my XML? Can I disable it?







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]