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.