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

XALAN does not handle document('') as expected to carr

Subject: XALAN does not handle document('') as expected to carry out anin-stylesheet look-up
From: mark.clare@xxxxxxxxxxxx
Date: Thu, 1 Nov 2001 19:08:21 +0000
xalan commandline param name value
Hi

In order to sort items by date where we are provided with the date in dd
mmm yyyy format (e.g. 03 Jan 2001) I wanted to convert the MMM value to a
number which can be sorted.

I used the approach where I embedded a look-up within the stylesheet and
then used the document('') function to look up the month in the table to
get the number to sort by (see code segment below).

This works fine when I run XALAN from the command line.  However my
application applies the template after reading the XSL transform from a
database and then applying it to a document.  When this occurs XALAN
appears to be attempting to obtain a document from the file server when my
understanding was that the document('') function means that the lookup
table can be held within the stylesheet itself.

Does anyone know if this is a known feature or have I missed something
here?  Your help is appreciated.

Thanks

Mark Clare

 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version
="1.0" xmlns:m ="urn:non-null-namespace">
...................

<m:month name="Jan" value="1" />
<m:month name="Feb" value="2" />
<m:month name="Mar" value="3" />
<m:month name="Apr" value="4" />
<m:month name="May" value="5" />
<m:month name="Jun" value="6" />
<m:month name="Jul" value="7" />
<m:month name="Aug" value="8" />
<m:month name="Sep" value="9" />
<m:month name="Oct" value="10" />
<m:month name="Nov" value="11" />
<m:month name="Dec" value="12" />
................
.................

<xsl:sort order="ascending" select="substring(dateAdjusted,8,4)" />
<xsl:sort select="document('')/xsl:stylesheet/m:month
[@name=substring(current()/dateAdjusted,4,3)]/@value"
                  data-type="number" order="ascending"/>
<xsl:sort order="ascending" select="substring(dateAdjusted,1,2)" />








This e-mail message is CONFIDENTIAL and may contain legally privileged
information.  If you are not the intended recipient you should not  read,
copy, distribute, disclose or otherwise use the information in this e-mail.
Please also telephone or fax us immediately and delete the message from
your system.  E-mail may be susceptible to data corruption, interception
and unauthorised amendment, and we do not accept liability for any such
corruption, interception or amendment or the consequences thereof.


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


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.