Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: I've read up on XML, but how to really use it?? >Thread Next - Re: I've read up on XML, but how to really use it?? Re: I've read up on XML, but how to really use it??To: NULL Date: 6/1/2006 10:02:00 PM 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, a > la: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <?xml-stylesheet type="text/xsl" href="test.xsl"?> If you want to try and have it rendered in the browser, yes. Or if you simply want to record for others the location of a stylesheet. > 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.) In theory, yes, but not practically. > This would seem to make more sense to me, as you would have one file > containing your xml data, and thne have seperate xml files, each > including the main.xml, but different XSLT files. But then you'd have three separate copies of your document to maintain. That way madness lies. Why not just put three xml-stylesheet Processing Instructions into one copy of main.xml? Browsers don't honour that, at the moment, AFAIK, despite having been asked to support variant stylesheets for the best part of a decade. > Say, you have one template for html output, and another for plain text, > and another for some other format. > > From everything I've found online thus far, it seem including xml files > in other xml files isn't a very clear topic, but it seems to me it > should be an essential part if you want to keep things seperate and > organized, unless I'm really missing something here. No-one has ever asked to do it. The alternative is to have your three stylesheets, but run them on a dummy 1-line XML file, and use the document('main.xml') function to reference your main document, so that it gets included for processing. In XLST2, you don't even need the dummy file. ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
