views:

52

answers:

1

I have just recently (like 2 days) started using XSLT documents with XML. I understand the basics and am able to generate a formatted document using an .XML document that references a separate .XSLT document.

My question, as in the subject, is "Is it possible to create a SINGLE, composite document that contains both the XML data and XSLT processing/formatting/styling and displays as formatted HTML?"

I am writing a desktop application in which I need to generate a formatted document on the fly from XML stored in the database. I want to do this without creating or referencing any actual physical files. I will generate a text string containing the XML/XSLT document and feed this to a WebBrowser component for formatted display.

Hopefully what I want to do doesn't totally go against the whole XML/XSLT methodology.

Any information, direction or suggestions will be greatly appreciated.

+3  A: 

What you are describing is called embedded stylesheets:

http://www.w3.org/TR/xslt#section-Embedding-Stylesheets

To answer your question, yes it is possible, but you have to check your processor's documentation to see if it's supported.

Max Toro
Hi Max. Thank you so much for your reply and, indeed, for answering my question.Unfortunately, as I believe you alluded to, it appears that IE does not support embedded stylesheets. I found the following workaround: http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/201002/msg00301.htmlHowever, it requires reference to ApplyEmbeddedStylesheet.xsl; which defeats my intent of having a single, self-sufficient file--if I have to reference an external file, I might as well deploy and reference my own .xsl.Thank you again!!Jonathan Weekes