Hi Nathan,
Creating a map is a good idea. For e.g. you may
create a XML file "map.xml" which captures the mapping
information, something like below --
<map>
<same what="name">
<A>firstName</A>
<A>fName</A>
<A>nameFirst</A>
</same>
<!--
..other mappings
-->
</map>
You can use *document() function* in your XSLT to read
your main XML and the mapping XML.
Another solution i can think is -- you may capture all
possible options(lets say for "first name") within
your XSLT with *or (|) statements*. Then you will not
need the mapping XML file.
Regards,
Mukul
--- Nathan Shaw <n8_shaw(_at_)yahoo(_dot_)com> wrote:
Hi all,
I am working on a project where I will be receiving
different xml documents that contain essentially the
same content and vary only slightly in nomenclature.
For example, one document uses <firstName>, while
another uses <fName>, while yet another uses
<nameFirst>. They all "mean" the same thing and have
the same data, but are expressed differently.
To avoid having to write a separate xslt
transformation for each document, I have been
looking
into creating a map that would tie together
differing
elements and attributes in the xml documents I
receive
to my end document's elements and attributes, thus
allowing me to only write one xslt transformation
using the map.
Has anyone done anything like this before? I have
seen
a presentation on it by Joshua Fox, but his method
uses middleware. I am looking for a pure xslt
solution
here.
Thanks all.
--Nathan
=====
------------------------------------------------------------
Nathan Shaw
Web Applications Developer & Real Estate Investor
http://www.iaffectProperties.com
------------------------------------------------------------
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site
design software
http://sitebuilder.yahoo.com
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list