Subject: RE: Find node-set from string
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 29 Nov 2006 14:20:49 -0000
|
> My purpose is to convert between different XSD/XML formats by
> means of a mapping file generated from a database (i.e. a
> reference data library), hence the data from the input file
> shall be transformed to corresponding elements in the output
> file according to defined criterias. The mapping file itself
> can be constructed as needed from the db output.
> So far it seems to be easiest to store the "full path"
> (A/B/C) of the data elements in db, and map between them like:
> <mappings>
> <map>
> <format_1>message/header/from</format_1>
> <format_2>notification/originator</format_2>
> </map>
How are you planning to handle namespaces?
I can see how you would use this to rename elements, if format_2 were a
simple element name. I can't see how you intend to use the full path in
format_2.
>
> Q2: Are there better strategies / methods for solving this
> kind of problem?
> (Not limited to what's sketched above.)
>
I think that for this kind of problem, generating a stylesheet might be a
better approach than saxon:evaluate. It ends up being more extensible if you
want to add features like translating data values or grouping adjacent
values.
Come to my talk at XML 2006 next week on meta-stylesheets...
Michael Kay
http://www.saxonica.com/
|