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

Re: toknize() not working with saxon9

Subject: Re: toknize() not working with saxon9
From: a kusa <akusa8@xxxxxxxxx>
Date: Mon, 15 Mar 2010 13:40:31 -0500
Re:  toknize() not working with saxon9
Hi Michael:

Thank you for your response. I am running saxon 9.1. (command line
java -jar saxon9.jar)

You are right. I tried printing the value of  temp1 and it was blank.
So unparsed-entity-uri() is the culprit. But how do I get around this
problem?

On Fri, Mar 12, 2010 at 5:17 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>
> Start by seeing what the value of $temp1 is with both processors. Also try
> showing the value of static-base-uri() in both cases.
>
> Since your System ID is a relative URI, the chances are it has something to
> do with the way the relative URI is expanded to an absolute URI.
>
> Certainly the problem is much more likely to be with unparsed-entity-uri()
> than with tokenize(), since the former is inherently far more dependent on
> your system environment. Some XML parsers don't even report the information
> that Saxon needs for this function (you don't say anything about how you
are
> running Saxon or which XML parser you are using).
>
> Regards,
>
> Michael Kay
> http://www.saxonica.com/
> http://twitter.com/michaelhkay
>
>
>> -----Original Message-----
>> From: a kusa [mailto:akusa8@xxxxxxxxx]
>> Sent: 12 March 2010 21:50
>> To: xsl-list
>> Subject:  toknize() not working with saxon9
>>
>> Hi
>>
>> I am trying to use tokenize() to grab the name of an entity.
>>
>> Here is my input XML:
>>
>> <!DOCTYPE test [
>> <!ENTITY g1 SYSTEM "123-g1.tif" NDATA CCITT4>]> <test>
>>
>>
>> <image id="g1" res="34" inbr="g1"/>
>> </test>
>>
>> Here is my XSL snippet:
>>
>> <xsl:template match="image">
>>
>>       <xsl:variable name="temp1" select="unparsed-entity-uri(@inbr)"/>
>> <xsl:variable name="temp2" select="tokenize($temp1, '/')[last()]"/>
>>       <graphic>
>>                       <xsl:attribute
>> name="href"><xsl:value-of select="$temp2"/></xsl:attribute>
>>                       <xsl:attribute name="id" select="@id"/>
>> </graphic>
>>
>> </xsl:template>
>>
>> When I run this on an individual file in XML Spy, I get the
>> value of cariable temp2 as '123-g1.tif'. But when I run this
>> using saxon, it is empty.
>>
>> Can anyone help point out what is the issue here?
>>
>> Thanks in advance.

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.