[xslt] <?php ... ?> and <xsl:output method="html">



Hello,

I currently use libxslt to transform XML documents (with significant
HTML as XML) into HTML documents (i.e., using <xsl:output
method="html"/>).  This system has worked quite well for making
templates for webpages.

However, recently I've been needing to generate PHP in addition to
HTML.  Obviously, the problem with this is that <xsl:output
method="html"/> does not terminate processing instructions with a '?'.
I used the search on xmlsoft.org and google, but did not come up with
a good solution to this problem.

I had considered just closing the php processing instruction with an
extra '?', as in:

	<?php ??>

but this feels unclean.  I also considered modifying the program that
uses libxslt to add the '?' to the end of the content of all
processing instructions automatically if the output method of the xslt
was "html", but this also feels unclean.

So, would

	<xsl:output method="php"/>

or

	<xsl:output method="php"
		xmlns:libxsl="http://www.xmlsoft.org/???";
		libxsl:method="php"/>

extensions (that do the same as method="html" except outputs
processing instructions, or even just the php processing instruction,
with a closing '?') be acceptable?  Having looked at the HTMLtree.c
code, I think that an htmlNodeDumpExtendedOutput function could be
added that has control over the PI output and is called by
htmlNodeDumpFormatOutput could work.  Would either extension (or
similar) be accepted if I worked on it?

Alternatively, does anyone else have any suggestions?

Thanks,
-Brett

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail




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