Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - Is it possible to embed/combine XML+XSL?

 
Thread Tools Search this Thread
Old 05-23-2006, 10:48 PM   #1
Default Is it possible to embed/combine XML+XSL?


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



pjfarley3
  Reply With Quote
Old 05-24-2006, 03:10 AM   #2
Joe Kesselman
 
Posts: n/a
Default Re: Is it possible to embed/combine XML+XSL?

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
  Reply With Quote
Old 05-24-2006, 04:43 AM   #3
pjfarley3
 
Posts: n/a
Default Re: Is it possible to embed/combine XML+XSL?

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

  Reply With Quote
Old 05-24-2006, 04:58 AM   #4
Joe Kesselman
 
Posts: n/a
Default Re: Is it possible to embed/combine XML+XSL?

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
  Reply With Quote
Old 05-24-2006, 05:14 AM   #5
Joe Kesselman
 
Posts: n/a
Default Re: Is it possible to embed/combine XML+XSL?

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
  Reply With Quote
Old 05-24-2006, 01:27 PM   #6
pjfarley3
 
Posts: n/a
Default Re: Is it possible to embed/combine XML+XSL?

> 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

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump