RE: [xsl] Tramsform XML through mapping schemas using XSL

Subject: RE: [xsl] Tramsform XML through mapping schemas using XSL
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 27 Nov 2002 09:53:28 -0000
It sounds to me as if you should treat your "configuration file" as a
high-level description of a stereotyped transformation, and use it to
generate a specific XSLT stylesheet for a particular transformation. You
can do this stylesheet generation in XSLT, of course.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Alistair Power
> Sent: 27 November 2002 00:10
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Tramsform XML through mapping schemas using XSL
> 
> 
> Hi,
> 
> Just trying to work out whether I can transform xml by 
> mapping schemas 
> against each other using XSL, and thought I'd pick your brains for 
> ideas/suggestions/be told that it's impossible and I'm a fool 
> for even 
> trying it :P
> 
> My problem is that I have a simple valid xml (generated from a 
> relational database which I don't have access to!), along with a 
> corresponding schema A which it adheres to, and I want to 
> transform it 
> into a different slightly more nested xml document, which validates 
> against schema B. Both schemas are different enough so that certain 
> element values in the source schema A might become attribute 
> values in 
> schema B, and vica-versa. 
> 
> I know the exact mappings between the data in the source and target 
> schema. What I ideally want to achieve is to store the mappings in a 
> configuration xml file, and write a series of (generic?) XSL 
> templates 
> that get called based on iteration through the mapping file 
> plus source 
> xml file, and after a bit of magic output my target xml file, 
> conformant 
> to schema B.
> 
> Now I could just write a straight transformation that took the source 
> and transformed it, but I will be using different schemas in 
> the future 
> with different data and mappings, so wanted to try and 
> approach this in 
> a more generic fashion, with possible deference to the two schemas.
> 
> So my questions are:
> 1. Do you think this is feasible through the use of just XSL? 
> 2. Is it feasible to match nodes against data from a config file, and 
> pass the resultant chosen node into a config defined 
> transformation (say 
> calling a specific template)?
> 
> Apologies if the scenario description is a bit vague, but this is 
> currently an idea in my head, and I am not sure whether this is 
> something that would be better solved programatically with 
> the support 
> of XSL or through XSL alone. 
> 
> Thoughts/comments/ideas much appreciated...
> Thanks,
> Alistair
> 
> Alistair Power
> alistair.power@xxxxxxxxx
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread