XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Jerry JanofskySubject: Newbie XPath Question
Author: Jerry Janofsky
Date: 03 Aug 2006 12:31 PM
I am trying to use the XPath function "escape-uri". I keep getting the error 'Function "escape-uri" does not exist (or is invalid XSL). Is this because Stylus Studio is not up to date enough? Is there anything I can do?

Your help will be appreciated

Postnext
Ivan PedruzziSubject: Newbie XPath Question
Author: Ivan Pedruzzi
Date: 03 Aug 2006 12:54 PM
Jerry,

Which Stylus Studio edition and build are you running?
In which editor you are trying to use "escape-uri"?

Ivan Pedruzzi
Stylus Studio Team

Postnext
Jerry JanofskySubject: Newbie XPath Question
Author: Jerry Janofsky
Date: 03 Aug 2006 01:02 PM
Ivan,

I am using XML Professional Edition 2006, Release 3, Build 653c.

I'm not sure what you mean by "which editor"? I have a scenario that transforms an XML document with XSLT. In the XSLT I have:

<xsl:value-of select="escape-uri(name/firstname, true())"/>

at which I get the error. I can use other functions like "count()". It seems like it doesn't understand this one.

Jerry

Postnext
Ivan PedruzziSubject: Newbie XPath Question
Author: Ivan Pedruzzi
Date: 03 Aug 2006 01:08 PM

escape-uri is a XPath 2.0 function you have to set the attribute "version" of your XSLT to "2.0" in order to use it.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Jerry JanofskySubject: Newbie XPath Question
Author: Jerry Janofsky
Date: 03 Aug 2006 01:55 PM
OK, how do I set it to version 2? In the help I see

"Querying in the Text View of a Sample Document
Stylus Studio provides support for both XPath 1.0 and 2.0. You control the version you want Stylus Studio to use to process your XPath using the v.1 and v.2 buttons in the XML Editor tool bar. The default XPath used is version 1.0. "

The image from the help is not here, but I don't see the buttons it is talking about?

Sorry about these newbie questions.

Jerry

PS. Is that a sailboat you are standing on in your picture?



Postnext
(Deleted User) Subject: Newbie XPath Question
Author: (Deleted User)
Date: 03 Aug 2006 02:10 PM
Hi, Jerry. In Stylus Studio 2003, we introduced the XPath Query Editor. Currently, XPath 2.0 is supported by default, but XPath 1.0 constructs will still be valid. There is no way to explicitly specify the XPath version.

The documentation you are referring to is out of date and will be corrected for the next release. I apologize for any confusion.

The online help should provide more information (press F1 when the focus is within the XPath Query Editor), or you can look here:

http://www.stylusstudio.com/docs/v2006R3/d_xpath8.html#wp1719426

In addition, a video tutorial showing this new feature will be available shortly.

Hope this helps.

David Foster
Stylus Studio Team

Postnext
Ivan PedruzziSubject: Newbie XPath Question
Author: Ivan Pedruzzi
Date: 03 Aug 2006 05:02 PM

Jerry,

Before adding any additional confusion.

My understanding is that you are:

- working on a XSLT transformation, correct?
- trying to use the escape-uri function in your XSLT, correct?
- you are getting an error when trying to execute, correct?

If the above is true open your XSLT in Stylus Studio, at the begging of the file you should have something like the following

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

Change version="1.0" to version="2.0", now your stylesheet is XSLT 2.0
and you can invoke escape-uri.

Keep in mind that only few XSLT processors support XSLT 2.0 that may became important when you have to deploy your transformation.


Ivan Pedruzzi
Stylus Studio Team

Postnext
Jerry JanofskySubject: Newbie XPath Question
Author: Jerry Janofsky
Date: 07 Aug 2006 11:50 AM
Ivan,

Sorry for the delay, but I am still having trouble with escape-uri. I think it must be a problem with Saxon. I am processing with Saxon 8.7.1 in stylus studio.

Here is my input XML:

<?xml version="1.0"?>
<test>
<uri>www.test.com/s p a c e s/</uri>
</test>



Here is my XSLT:

<?xml version='1.0'?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:value-of select="test/uri" />
<xsl:value-of select="escape-uri('test/uri', true())"/>
</xsl:template>
</xsl:stylesheet>


I keep getting "unknown system function". Can you see anything I am doing wrong? Is there another version 2 processor?

Thanks for all your effort to help so far.

Jerry J


Postnext
Ivan PedruzziSubject: Newbie XPath Question
Author: Ivan Pedruzzi
Date: 07 Aug 2006 12:16 PM

The following should do what you are looking for

encodes characters according to the URI escaping rules
http://www.ietf.org/rfc/rfc3986.txt


<?xml version='1.0'?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:value-of select="concat(test/uri, ' --> ', encode-for-uri(test/uri))"/>
</xsl:template>
</xsl:stylesheet>

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
Jerry JanofskySubject: Newbie XPath Question
Author: Jerry Janofsky
Date: 07 Aug 2006 12:23 PM

That works well, thank you!

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

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