[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Questioning XSL

  • From: Paul Prescod <paul@p...>
  • To: "'XML Developers' List'" <xml-dev@i...>
  • Date: Fri, 21 May 1999 12:23:45 -0500

Re: Questioning XSL
Miles Sabin wrote:
> 
> No, but do they have to be part of the *language*?
> 
> Wouldn't a hypothetical DOM level X with direct support
> for XSL style queries not address most of these issues?

I asked for:

> XSL's optimized mix of "polymorphic dispatch", pattern 
> matching and convenient template description.

You've given me only pattern matching. In JavaScript, Python or Perl I
would have to write the polymorphic dispatch engine myself and likely
write my output templates in some weird non-XML syntax:

make( "HTML" ) or write( "<HTML>" ) or something.

I spend most of my programming time in a scripting language. I have
already helped design two or three XML/SGML processing packages for that
scripting language. It is my considered opinion that it is *not* the same
unless the scripting language is designed from the ground up to handle
XML: (Omnimark, Balise, DSSSL).

I mean it is theoretically possible that there is a language out there
that just naturally fits XSL-style-processing, but it sure isn't
Javascript. There is a huge amount of information in a simple rule like:

<xsl:template match="B">
   <BOLD><xsl:apply-templates/></BOLD>
</xsl:template>

The script-language equivalent would be something like:

pattern = compilePattern( "B" )
function B_template( current_node ){
	make_group( 
		make_element( "BOLD", 
			dispatch_children( current_node )))
}

xsl_engine.add( pattern, B_template )

Now I fully expect to write code like this in the future. There is a
Python library like this under development already. But I don't believe
that this is as simple to learn as XSL because first you have to learn the
intricacies of a scripting language ("oh, functions can be arguments?")
and then you have to learn the intricacies of the library. You could have
learned XSL directly in less time.

And even so, this code is less amenable to optimization than XSL code is
because you have the full dynamicity of the programming language to deal
with.
-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

Alabama's constitution is 100 years old, 300 pages long and has more than
600 amendments. Highlights include "Amendment 393: Amendment of Amendment
No.  351", "Validation of Laws Regulating Court Costs in Randolph County",
"Miscegenation laws", "Bingo Games in Russell County", "Suppression
of dueling".  - http://www.legislature.state.al.us/ALISHome.html

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.