RE: [xsl] Using external XML to control output of XSLT

Subject: RE: [xsl] Using external XML to control output of XSLT
From: "Sree" <pdx009@xxxxxxxxx>
Date: Thu, 30 Apr 2009 08:15:50 -0700
Another approach for Mr Reed's issue would be, to have an XML file(lets say
the name is FieldsOrder.xml) which gives the order of the fields to display
<root>
	<field order="2">FieldValue</Field>
	<field order="1">FieldValue</Field>
	<field order="3">Field1Value</Field>
</root>

(you can have the user to edit this XML file as per their choice of field
order).
Now in the main XSLT which is transforming the source XML content, you can
read this Field orders with xsl:document element and use this order in the
XSLT to display.

Your issue could be solved very easily with XSLT
Thanks,
Sreeni
-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx] 
Sent: Thursday, April 30, 2009 6:41 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Using external XML to control output of XSLT


This certainly is a case where generating an XSLT stylesheet (or modifying
parts of a stylesheet) is often a useful approach. A stylesheet is just an
XML document, so it's not essentially different from any other
transformation: if you know how to write XSLT, it shouldn't be difficult to
write XSLT that generates XSLT. One thing that makes it a little bit easier
is xsl:namespace-alias.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Michael Reed [mailto:michaelr@xxxxxxxxxxxxxxxx] 
> Sent: 30 April 2009 14:15
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Using external XML to control output of XSLT
> 
> Been researching this scenario and can't find anything to 
> confirm whether it is possible and (if it is possible) how to 
> set it up. The scenario is to use a transform that would be 
> taking data like Name, JobTitle, Company, Phone, etc. The 
> transform's job is to handle the output but I would like to 
> have a separate XML file that controls what fields appear and 
> in what order for the output. So if a user who is not 
> familiar with transforms want to make Company first and then 
> the Name, they could just modify the XML file and it would be 
> independent of the data or transform.
> 
> I thought I had read a long time ago about using a transform 
> to create a transform but have been unable to find the 
> article or intuit the process whereby I could make this happen.
> 
> Thank you for any suggestions,
> Michael Reed

Current Thread