[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSLT and external calls


Subject: Re: [xsl] XSLT and external calls
From: "Eugene Kuznetsov" <eugene@xxxxxxxxxxxxx>
Date: Fri, 22 Aug 2003 13:56:22 -0400

> instance a CAS or a Tex2MathML converter) produces. So I was wondering
if
> there are ways of stil having an XSLT stylesheet (maybe with a
proprietary
> extension element that allows me to call specific Java methods or
external	

There are two diametrically opposed directions here. 

1. You view XSLT as just another "scripting platform" deeply embedded
into your particular platform-specific system. You freely extend it
using custom java extensions, VB script, C++ extensions, <script>
elements and so on that perform everything from database queries to
procedural nodeset processing that was too hard (or too slow) to write
in XPath/XSLT. Portability between engines, platforms and applications
of the mappings contained in the XSLT is irrelevant to you. If you need
to talk to a database server for a lookup during the transform, you
write some custom java code, and use "<myname:yourjdbc.ora sql="select *
from bar">..." to access your database. 

2. You think XML/XSLT points to a way for separating XML processing from
platform-specific technologies, and want to be able to reuse and move it
around at will. Whenever possible, you implement transforms as
self-contained, reusable modules that rely on standard XSLT or
well-supported "industry-standard" extensions (EXSLT). If you need to
talk to the outside world to complete a transform, you try to figure out
how to avoid it. If that does not work, you use a document() call to a
URL -- using standard CGI-encoding of parameters. If that does not work,
you use a SOAP call to make a coarse-grained web services request to
your app server. You want to move to a loosely-coupled data processing
architecture, expose all of your data as RESTful XML and/or web
services, and finally unlock your application mappings and logic from
specific platforms. If you map format X to format Y in one application,
you want to reuse that mapping in all of your other applications without
changes. 


So there's more than just a simple programming question here, it's
actually a big fork in the road. Sometimes #1 is OK, but I find that
more often someone wants #2, but pursues #1 "by default." In that case,
like David says, document() call is preferable, especially if you are
doing something relatively simple. Often you can even use an XML file
for "on-the-side" lookups of things like "id->name" mappings needed for
XML ETLs. For more complex queries, our engine provides a syntax for
making SOAP calls from within the transform. Long-term, this too should
become a standard namespace. 


\\ Eugene Kuznetsov, Chairman & CTO
\\ eugene@xxxxxxxxxxxxx
\\ DataPower Technology, Inc. - xml-aware network devices
\\ http://www.datapower.com - XA35 XML Accelerator
 


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



Current Thread
Keywords