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

RE: Porting own template language to xslt

Subject: RE: Porting own template language to xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 16 Mar 2006 11:16:51 -0000
body language and peter kay
I think that using xsl:for-each is the natural way to do this.

I toyed at one time with adding a construct such as

<xsl:with select="....">

that changes the context node without any iteration semantics, but it's
functionality that for-each already provides so it just seemed like
unnecessary baggage. I think this applies even more to an extension element
which needs to be separately implemented for each processor.

With XQuery I sometimes use the construct:

declare function cc($in as node()) {
$in/(

.... function body with $in as context node ....

)}

This isn't possible in XSLT of course because we don't have full
composability. I'm not all that sure how good an idea it is anyway.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Nils Kaiser [mailto:NilsKaiser@xxxxxx] 
> Sent: 16 March 2006 10:37
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Porting own template language to xslt
> 
> Hi,
> 
> we have been developing a template system similar to xslt 
> some time ago 
> and want to port it to xsl to enhance functionality and 
> become standard 
> compatible. As the language is quite similar to xslt it's 
> should not be 
> that hard. The only problem I have is the following:
> 
> the language we developed has a <region> element where you 
> can specify 
> an xpath. It simply changes the current node while staying in 
> the same 
> template. for example (I converted the other elements to xsl already)
> 
> <template match="/html">
>     <xsl:value-of "head/title"/>
>     <region select="body//div[@class='content']">
>        <xsl:value-of "h1"/>
>     </region>
> </template>
> 
> What is the best way to express a construct like this in xslt? Well I 
> could use a xsl:for-each which matches just the first result, 
> but that 
> looks quite ugly... any suggestions?
> 
> I also thought about coding an extension element to be able 
> to use our 
> region element. But I am not sure what drawbacks I have to face 
> regarding compability to different processors. I can live 
> with the need 
> of writing more than one extension to support the element, 
> but are there 
> any processors that don't support extension elements at all? 
> (At least 
> in java world?)
> 
> Any ideas?
> 
> Thx,
> 
> Nils Kaiser

Current Thread

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
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.