Chris Leishman wrote:
On Friday, April 11, 2003, at 01:42 PM, Kip Hampton wrote:
It does change it, though. Your patched version always returns a DOM instance, the current version serializes the result to a string using the XSLT processor's output_string( $result ) if the current process is $last_in_chain. The difference is that the latter *alters* the output based on options that may be set in an <xsl:output/> element in the stylesheet itself. The last stylesheet in my test suite had

Ok....thats annoying! Can someone tell me how XSLT embeds the desired output format into the DOM, so that when XML::LibXSLT::output_string($result) is called, it knows to serialize in a specific manner?

Well, it may be seen as annoying (and I for one hope that mode='html' will cease to be useful soon enough) but it's done as per the spec and it thus won't go away (besides, I don't really see an alternative solution...).


The info isn't stored in the DOM, it's stored in the stylesheet object. $xslt->output_string() looks that up and uses its own serialisation code instead of libxml's.

Then to create something suitable to my site, I might apply some XSLT to convert to XHTML. But if I wanted to include some dynamic stuff - eg. a 'Welcome <logged in user>' or even a form like 'Add new entry to blog', then I'd want to convert from the original RSS to an XSP page that could output XHTML containing the user details and perhaps the results of processing the parameters in the request...

I can certainly see situations where there is no initial data source and thus one is generated entirely dynamically via XSP based on the request parameters or similar - but I would've thought it more common to have some initial XML to work with.

There's nothing "wrong" with your approach, but you are using XSP to produce XHTML, and the latter /may/ contain styling information. Producing styled output from XSP is imho a bad idea which is why, in the process you describe, starting from an initial document I might do FooML(source) -> XSLT(adds some XSP elements) -> XSP(processes XSP stuff) -> XSLT(styles).


In such cases, what I've done is XSP(does dynamic stuff *and* includes the real content, usually from path info) -> XSLT(styles).

Maybe I'm just being a content purist though ;-)

I am, and I tend to have http://foo.org/src/foo/bar.xml to access the content in itself (with no decoration) and http://foo.org/cms.xsp/foo/bar.xml to get the page people want to see.


--r



Reply via email to