Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XML and keeping things seperated? >Thread Next - Re: XML and keeping things seperated? Re: XML and keeping things seperated?To: NULL Date: 6/1/2006 4:27:00 AM Stan R. wrote: > One more question if I may. From what I've gathered, usually you include > the XSLT template right into your main xml doc you're working with, > like: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <?xml-stylesheet type="text/xsl" href="test.xsl"?> Yes. > My question is, is it possible to have the main xml doc in one file > (say, main.xml), but have a seperate xml file for the transformations > (include both a XSLT and the main.xml document.) Sort of, but not really how you're thinking. XML "doesn't do" includes. There are various techniques applicable, but they're either not workable, not implemented, or just not commonly used. It's also relatively rare to use the <?xml-stylesheet ... ?> PI. Most XSLT gets transformed on servers (for widespread output device compatibility) rather than getting shipped out as XML with a linked stylesheet and transformed on the final device. So the linkage of content and presentation stylesheet is (in general) done by external non-XSLT scripts calling XSLT engines from outside. If you want to describe this linkage in an XML format then of course you can do so, but most ways of doing it are project-specific and don't use a clearly defined or standardisaed format. You can of course use the PI attached to the document and read this from your script, then use that to indicate the XSLT transform to use. You might also find a look at the XInclude protocol and the Cocoon project to be useful. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
