S
Stan R.
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"?>
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.)
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.
Maybe it's just the way I'm used to doing things when programming and
such, but it seems perfectly logical to want to keep the actual xml data
in one place, and have style-related stuff take place outside it, so it
can be styled in multiple fashions, for multiple purposes, like, for
example, have one XLST style sheet for html output, and another for
plain text, and maybe another for man or pod (shell) output. And not
just output, as XSLT can be used to transform into other types of xml
documents, as well as other forms of documents altogether.
Am I correct in surmising that the xslt, in the way it seems to be
normally included in the main xml file you're working with, seems to
have taken this aspect on fro mthe likes of HTML, which normally inlcude
CSS (either externally or inline) in the html file you're working with?
Because for the sheer power XML seems to hold, this doesn't look like
best approuch imho.
Is there a reason they didn't go with a more normalized approuch; that
is, you have your xml source in one file, different stylesheets in other
files, and a 3rd tier files that actually include/use both the xml
source i nquestion, and the stylesheet.
In other words, a structure like the following:
mydata.xml
mydata_style_html.xsl
mydata_style_text.xsl
mydata_style_rss.xsl
mydata_style_foo.xsl
mydata_style_bar.xsl
mydata_output_html.xml
mydata_output_text.xml
mydata_output_rss.xml
mydata_output_foo.xml
mydata_output_bar.xml
In this setup, you have your source in one file, and your style sheets,
each one specifying a different way of display the source data in
mydata.xml.
While it seems to me that while you would be able to, in the "output"
xml files, be able to include a style sheet (ie: <?xml-stylesheet
type="text/xsl" href="mydata_style_html.xsl"?> ), I don't see a way to
include another xml file in a similar way.
What I'm really looking for is something like this, in, say,
`mydata_output_html.xml` :
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-include type="text/xml" href="mydata.xml"?> <!-- <--- (example
only) -->
<?xml-stylesheet type="text/xsl" href="mydata_style_html.xsl"?>
Where that is the only contents of the output file.
Thanks for any insight on this, I'm extreamly curious
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"?>
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.)
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.
Maybe it's just the way I'm used to doing things when programming and
such, but it seems perfectly logical to want to keep the actual xml data
in one place, and have style-related stuff take place outside it, so it
can be styled in multiple fashions, for multiple purposes, like, for
example, have one XLST style sheet for html output, and another for
plain text, and maybe another for man or pod (shell) output. And not
just output, as XSLT can be used to transform into other types of xml
documents, as well as other forms of documents altogether.
Am I correct in surmising that the xslt, in the way it seems to be
normally included in the main xml file you're working with, seems to
have taken this aspect on fro mthe likes of HTML, which normally inlcude
CSS (either externally or inline) in the html file you're working with?
Because for the sheer power XML seems to hold, this doesn't look like
best approuch imho.
Is there a reason they didn't go with a more normalized approuch; that
is, you have your xml source in one file, different stylesheets in other
files, and a 3rd tier files that actually include/use both the xml
source i nquestion, and the stylesheet.
In other words, a structure like the following:
mydata.xml
mydata_style_html.xsl
mydata_style_text.xsl
mydata_style_rss.xsl
mydata_style_foo.xsl
mydata_style_bar.xsl
mydata_output_html.xml
mydata_output_text.xml
mydata_output_rss.xml
mydata_output_foo.xml
mydata_output_bar.xml
In this setup, you have your source in one file, and your style sheets,
each one specifying a different way of display the source data in
mydata.xml.
While it seems to me that while you would be able to, in the "output"
xml files, be able to include a style sheet (ie: <?xml-stylesheet
type="text/xsl" href="mydata_style_html.xsl"?> ), I don't see a way to
include another xml file in a similar way.
What I'm really looking for is something like this, in, say,
`mydata_output_html.xml` :
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-include type="text/xml" href="mydata.xml"?> <!-- <--- (example
only) -->
<?xml-stylesheet type="text/xsl" href="mydata_style_html.xsl"?>
Where that is the only contents of the output file.
Thanks for any insight on this, I'm extreamly curious