473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

May 23 '06 #1
5 1298
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
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
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
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Marcel | last post by:
Hello all, I am working on a generic (php) script to produce (X)HTML Forms through XML and XSL based on field-definitions stored in a database. The basic way i did HTML-forms in PHP was like...
2
by: kmunderwood | last post by:
I am having trouble changing the font size when extracting xml into an html web page. I think it can be done so many ways, that my searches bring up examples that I am not familiar with. I am a...
2
by: John Lehmann | last post by:
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
3
by: Martin Olson | last post by:
I'm trying to output valid xhtml 1.0 transitional with xslt -- my question is when dealing with elements that have self-closing tags such as <img /> and <input />... I'm getting closing tags on...
5
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
4
by: Glenn | last post by:
Hi folks, My problem is this... I am having an issue with whitespace between XML tags that occurs when I transform the XSL output to the browser via ASP.NET leaving me with unexpected...
1
by: danc888 | last post by:
I am attempting to write an XSL file to transform the orignal XML document to only show the elements I need. I have a problem though, the XML document contains an xmlns "urn" which when present...
5
by: Kniffel | last post by:
Hi everyone I do a xsl-transformation. And I try to get a Attribute, but I cannot get it. My XML/XSL experience is not very good at the moment. I have something like this: TEST.xml...
1
by: DR | last post by:
What is the fastest possible xsl style sheet to add another <boxnode under <boxes? <foo> <car></car> <boxes> <box id="234" /> <box id="75" /> </boxes> </foo>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.