RE: XML transformation

 
Gary,
 
XSLT is very powerful and I would use is as the language of choice
given the scenario you have described. Once you try to do this in C++
you will be faced with having to use an XML parser and then loading
your source document into something like DOM. Some of these APIs
are quite complex, and that's before you start to work on the actual problem
of converting the documents.
 
XSLT eliminates the need for a lot of this boiler plate code and leaves
you to concentrate on the rules of doing the transformation.
We use XSLT to generate both Java and Visual Basic code from WSDL
(an XML based API description language) and it is more then powerful enough 
to handle that task. 
 
The main implication of XSLT being a functional language is that once you
assign
a value to a variable it cannot be modified. This means that you where you
are
probably used to writing for loops in C++ you will have to write recursive
algorithms
in XSLT. This can take a bit of getting used to, but it is worth the effort.
My advice
is get a good book on the subject.
 
If you will forgive a product plug: we provide an XSLT Mapper which
allows you to load source and result schema into two tree representations
and create XSLT by dragging source nodes to result nodes. 
You can get it at: http://www.capeclear.com/products/capestudio/
<http://www.capeclear.com/products/capestudio/> 
 
James.
 
Cape Clear Software Limited.
61 Fitzwilliam Lane
Dublin 2
Ireland
Email : james.pasley@capeclear.com <mailto:james.pasley@capeclear.com> 
Switchboard : + 353 (1) 2419900
Direct line : + 353 (1) 2419957
Fax : + 353 (1) 2419901
www : www.capeclear.com

 

 

-----Original Message-----
From: Gary Robertson [mailto:gazinyork@hotmail.com]
Sent: Tuesday, December 04, 2001 3:06 PM
To: xmlschema-dev@w3.org
Subject: XML transformation


I'm sorry if this question is a little bit on the edge of what this list 
covers - it's just I know that there are some XSLT gurus on here
and it is to do with conversion between W3C schemas.
 
I have an XML document that complies with one schema and I 
want to convert it so it complies with another. I understand the 
semantics of both schemas and the transformations I wish to
achieve. Will I, in all cases (and given a good knowledge of XSLT) 
be able to freely convert from one to another e.g omit elements 
conditionally on values of others, combine elements and attributes
and anything else whacky and arbitrary. What I'm really asking is:
will I be able to do everything that I could do in C++ with XSLT. 
 
I'm prompted to ask this question because I heard that XSLT 
is a functional language but I don't know what the practical 
implications of this are. Does it mean that it is Turing 
incomplete like XML schema language? If so, does this mean
that there are certain things I cannot do and if so what sorts of 
things.
 
Does anybody know of any tools that ease or partly automate 
the process of producing transformation stylesheets; I've heard
that XSLT is pretty hard to get started with.
 
thanks
Gaz
 

Received on Tuesday, 4 December 2001 10:42:09 UTC