Applying CSS style to dynamically generated XML

G

galpi

Hi folks,

I'm working on a web application built with Tapestry. I trying to
generate XML dynamically, and apply CSS style to it. I'm able to
generate the XML document and return it to the browser, but I'm unable
to apply style, it seems it's unable to find the css stylesheet.

At the top of the generated XML doc I have :

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="./stylesheets/view.css" type="text/css"?>

If I save the document as an .xml file under the same directory where
../stylesheet lives and load it up in Firefox, it works. Do I need to
specify the fully qualified path ? I'd like to avoid that ...

I understand relative paths in the "href" are relative to the current
document, but what does it mean when the document is dynamically
generated and not saved as a file ?

many thanks,

galpi
 
A

Andrew Thompson

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="./stylesheets/view.css" type="text/css"?>

If I save the document as an .xml file under the same directory where
./stylesheet lives and load it up in Firefox, it works. Do I need to
specify the fully qualified path ? I'd like to avoid that ...

I did'nt realise this was possible until you mentioned it,
but a little Googling suggests an embedded stylesheet
might be your best bet..
<http://www.w3.org/Style/styling-XML#Embedded>

HTH

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top