A suggestion for handling DOE
"rdcpro" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
I know this is an ancient painful thread, but I must comment on it. Most of the "I need this feature" comments posted in bug 98168 regarding disable-output-escaping result from a lack of understanding how XSLT works. And I understand that serializing the entire tree then reparsing it might have performance issues. But suppose you only serialize nodes that have the DOE attribute set, reparse them, then import the node back into the result tree? The performance hit would then be the responsibility of the developer that uses DOE, and wouldn't affect every page. I don't buy the defense that "There is nothing that you can do with disable-output-escaping that you can't do without it". With Moz the way it is, I don't see a way to produce a result tree that contains a bold tag given input XML like: <question><![CDATA[How do I <b>get this into the result tree</b>?]]></question> Of course, if I had control of the XML, I could do it easily. But the fact is, we often must work with XML from another system, and have no control or say over it. And "filing a evangelism bug on their broken code" isn't a solution either. There's nothing broken about the above example--The input data is not guaranteed to be well-formed by XML standards, but the result tree isn't guaranteed to be well formed either, if you follow the rule on <xsl:output method="html"/>. In the FAQ, it's said that this feature is only useful for RSS feeds. I might add there is a *boatload* of legacy XML in content management systems that use just this approach (Interwoven Teamsite, for example). It seems to me that parsing a single node in the result tree (and not the entire result tree), and importing back into the DOM tree wouldn't be much of a hit. And the bozos that use it to produce: <xsl:if test="amIDoneWithThisRowYet"> <xsl:text disable-output-escaping="yes"></tr><tr><xsl:text> will just have to live with lousy performance and unmaintainable code. Regards, Mike Sharp