Ryan Gaffuri said:
I have been skimming through xsl. why would you want to use it? It
seems extremely difficult to maintain and archaic. does it have
functionality that you can't do with a java DOM object or something
like xerxes?
While XSL can be difficult to grasp at first, it's a very powerful
transformation tool. You can do a lot of stuff with little code compared to
crawling the DOM tree yourself.
XSL makes it very practical to essentially not have to worry about the
specific XML that comes into your site.
When you're trying to work with customer data, you both need to agree on a
specific format for that data.
In our case, our team is pretty savvy with things like XML and XSL etc.,
where as many of our customers (who's specialty is their domain, rather than
computers and data processing) don't have as much expertise. So, they are
able to export data using high level tools provided by their vendor, but
which may not exactly meet our import specifications. So, we simply write an
XSL script that converts from their XML format to our XML, and then our XML
loader does the rest.
This kind of filtering is reasonably easy to write save for the most obscene
of circustances (and we never see those as we can direct the customers to
create an XML document that is Close Enough for our purposes).
But the XSL is more compact and mostly easier to use than walking the DOM
ourselves, AND as XSL processing gets better and "smarter", so do our
scripts.
XSL is just Yet Another high level abstraction over a specific domain, and
it's almost always better to work at that high level than not.
And with the Java XSL processors where we can add in our own processing
using Java Classes, it makes it even more powerful. For example, our XSL
scripts not only convert the custom XSL to our internal XML format, but post
messages to JMS queues to move the processing forward.
It's not a Silver Bullet, but it's a great tool worth learning if you work
with XML a lot.
Regards,
Will Hartung
(
[email protected])