[xml] XHTML Doc serialization and meta element



I ran into a situation on a double free on a node and tracked down the issue to serializing an XHTML document. xmlDocContentDumpOutput calls htmlSetMetaEncoding for XHTML documents which ends up altering the internal document by freeing the meta element and adding its own. Same thing happens with xmlNodeDumpOutput and htmlSaveFileFormat as well. Though htmlDocDump and htmlSaveFile don't mess with the meta element.

Problem with this is if a meta element already exists, I don't see why it should be altering the origional doc at all (which is something I do not want to happen). Also, it ends up forcing the content to be text/html when the origional document had set it to application/xhtml+xml. Now according to the specs (http://www.w3.org/TR/xhtml-media-types/), when using this media type, the http-equiv should not be included (W3C definition of should not) , so origional document is wrong in that respect, but this then means the meta tag should not automatically be added by the library either when the document is to be served as that media type.

It basically comes down to it would be one thing if the serialized version of the tree were altered - would have to think about wether it really was an issue or not - but I don't think an internal document should be altered during a serialization.

Thoughts?

Rob






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