tags:

views:

202

answers:

4

Hello,

As I understand it, using XSL to generate documents has two parts:

1) An XML document which references an XSL stylesheet 2) An XSL stylesheet

Let's say that I want to generate a document using XSL, and then send it to a friend. Without relying on the stylesheet being available on the internet, and without including the stylesheet as a separate file, how can I send him the document as a single file and have it just work?

I suppose ideally I'd like to send the "transformed" output, not the XML or XSL itself. Can this be done?

A: 

possibly... You could try viewing the page in a web browser, and viewing source. Otherwise, your're probably using the wrong format.

Nico Burns
+3  A: 

You have a two options:

  1. Do as you suggest and send your friend the transformed document (the output of the xml/xsl transformation)
  2. Embed the xml/xsl in a single file as per the xslt spec (link text)

If you're not sure if your friend will be able to process the xml/xsl file himself, then you are really only left with option 1

Chris Gow
Heya - didn't know about the embedded option! +1
Stobor
A: 

XSLT can be run from a remote workstation via a web browser, but that requires the stylesheet (.xsl) to be available on the internet.

OMG Ponies
+2  A: 

You need an xslt processor. This takes xml and xsl files and process them into their output (typically html, text, or xml). Some common ones are:

You can then take the output html, text, or xml file, and pass that on to your friend.

Stobor