Re: Developer Question [DOMDocument]

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

 



On Mon, 2009-10-05 at 01:45 -0700, Michael A. Peters wrote:

> I'm hoping someone who knows the answer to this question is on this list.
> 
> I need to modify either libxml2 and/or php DOMDocument to make a small 
> change.
> 
> Issue - saveHTML() function predates html5 (which isn't even finalized 
> yet) and thus does not know about it's tags.
> 
> the source element is new in html5 and may not have any children, so 
> when using saveHTML() from DOMDocument, it should NOT add a closing 
> </source> tag (it should be handled the same way the param element is 
> handled). It does the right thing with saveXML() where it properly self 
> closes the tag, but it does not do the right thing with saveHTML().
> 
> I suspect it is a minor easy to do change, but I don't even have the 
> foggiest idea where to look in the source to make a patch.
> 
> It's not all that big of a deal, but I would like my server to spit out 
> the correct code without me having to pass it through preg_replace.
> 
> Thanks for any suggestions on where/how to define that tag in the source.
> 
> Michael A. Peters
> 

I've not had a look at DOMDocument myself, having only used DomDocument
before (there's a slight difference in the capitalisation of the 2nd and
3rd letters which made it a pain in the proverbial to work with at
first!) but I would assume that if it might offer a method by which you
could specify certain self closing tags. This would be necessary at
least internally, to differentiate between things like <param/> which
can be self closing and <script> which can't (even though the latter
might only be referencing an external .js file and have no inline code!)

If not, then I'd do a file find on the code for any files containing the
text 'param' for example, to see if that leads you to the right place.

You may have problems doing this on a Windows XP system, as I believe
the search function in that OS has some weird behavior with text files
that it recognises as being scripts based on the file extension. I know
it does that for asp files, but not too sure with php ones.


Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux