By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

Is it possible to embed/combine XML+XSL?

P: n/a
Hi all,

First-timer here, with a question about composing XML and XSL. I have
a need to send one XML file with NO external server references to an
end-user browser window; i.e., I would like to be able to do something
like having the href in the "xml-stylesheet" declaration be a "local"
reference, something like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="#Local_xsl"?>
....

Only I can't find a place to put the XSL so it could be referenced in
this way. Is it even possible?

So far as I can see from reading tutorials and faq's everywhere, no one
ever discusses an ability to combine both the XML and the XSL into one
stream sent to the end-user browser. Everyone seems to AssUMe you can
just put a remote URI in the href and get the XSL from a server
somewhere. I need to be able to NOT use a remote URI or to go back to
the server for any information, all must be contained in a single
stream sent to the browser.

If I am approaching this from the wrong direction, please point me in
the right one. RTFM's, pointers to info, etc. all appreciated.

Peter

May 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Uhm... If you're just going to send a single file, why not process the
file through the XSL stylesheet _before_ sending it -- either on demand
in the server, or by storing and serving the styled copy? (I've seen
setups that do both, and in fact more of those than client-side
stylesheets, since until relatively recently client-side styling wasn't
supported by enough clients that anyone would consider relying on it
unless they were writing both ends of the process.)
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 24 '06 #2

P: n/a
Unfortunately, the server in this case also has no styling capability.
Not yet, anyway. I can generate the XML doc (which has the data the
application is returning to the end-user's browser) and I can craft the
XSL doc to present it the way the user wants to see it, but I can't
store the XSL on the server due to server maintainer recalcitrance
(i.e., human factors).

In the meantime, I need to get the application out there, so I'm
looking for a way around the human factors.

The only other solution I've come up with so far is an XHTML doc (and
embedded CSS2 for styling) with an XML data island for the data. It
will work, but I was hoping to "prove" the XSL solution.

If you have any other ideas, I'd appreciate hearing them.

Peter

May 24 '06 #3

P: n/a
pjfarley3 wrote:
Unfortunately, the server in this case also has no styling capability.
Not yet, anyway. I can generate the XML doc (which has the data the
application is returning to the end-user's browser) and I can craft the
XSL doc to present it the way the user wants to see it, but I can't
store the XSL on the server due to server maintainer recalcitrance
(i.e., human factors).
I'm still sorta confused. If you could manage to embed the XSL into the
XML, as your original proposal suggested, you must be obtaining it from
somewhere. The same task ought to be able to apply the XSL to the XML as
easily as embedding it.

But... OK, let's assume you can't install an XSLT processor on the
server end, for whatever reason. What you've requested is possible, at
least theoretically. See
http://www.w3.org/TR/1999/REC-xslt-1...ng-Stylesheets
Of course this requires that the DTD or schema which defines your XML
allows the XSL elements to appear.


In the meantime, I need to get the application out there, so I'm
looking for a way around the human factors.

The only other solution I've come up with so far is an XHTML doc (and
embedded CSS2 for styling) with an XML data island for the data. It
will work, but I was hoping to "prove" the XSL solution.

If you have any other ideas, I'd appreciate hearing them.

Peter

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 24 '06 #4

P: n/a
Depending on what you're doing, and whether the client supports it,
another approach might be

http://www.w3.org/TR/1999/REC-xslt-1...ent-stylesheet
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 24 '06 #5

P: n/a
> See
http://www.w3.org/TR/1999/REC-xslt-1...edding-Stylesh...
Of course this requires that the DTD or schema which defines your XML
allows the XSL elements to appear.


Excellent! I believe this is exactly what I was looking for.

Thank you very much!

Peter

May 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.