Topic: xml and xslt how to reference Pages that link to <a href="https://ozoneasylum.com/backlink?for=28830" title="Pages that link to Topic: xml and xslt  how to reference" rel="nofollow" >Topic: xml and xslt  how to reference\

 
Author Thread
clarkepeters
Obsessive-Compulsive (I) Inmate

From:
Insane since: Jan 2007

IP logged posted posted 01-14-2007 16:56 Edit Quote

My understanding of xslt is that the xslt stylesheet is referenced from the xml file i.e.

myfile.xml (used basically as a data file)

code:
<?xml version="1.0" >
<?xml-stylesheet type="text/xsl" href="mystylesheet1.xsl"?>
<person><name>joe</name></person>
etc..
</xml>



My question is this, what if you have several thousands of xml files to convert (myfile2.xml, myfile3.xml etc..) using a single xslt stylesheet. Will you have to go into each of the xml files to add the line:

code:
<?xml-stylesheet type="text/xsl" href="mystylesheet1.xsl"?>


That seems so wrong. Am I missing something? Would you use a host xml or xhtml file or something to somehow reference and combine the xml and associated xslt? I just don't get it.

Also, the same would hold true if I had a single xml file that I wanted to tranform using different stylesheets under different situations (mystylesheet1.xml, mystylesheet2.xml, etc..) . So each time I want to use a different stylesheet I'll havet to modify the href in the xml file? this can't be right. I'm sure I'm missing something here.
I can't seem to find a tutorial or other example on the web to help me sort this out.
If you know a good tutorial on this, or would like to comment yourself, I'd appreicate it.

jainanki
Obsessive-Compulsive (I) Inmate

From: Philadelphia, PA.
Insane since: Dec 2007

IP logged posted posted 12-21-2007 21:06 Edit Quote

Try using Apache cocoon pipelines. I am drafted into a project where we are using it.

We are passing all the page requests through one such pipeline, which redirects them to appropriate servlets, which in turn return xml data in the response object.
cocoon takes that response object, and automatically applies the mentioned xslt on it and returns the html to the browser.

Does it help?



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu