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

Re: Document() and &

Subject: Re: Document() and &
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 17 May 2002 16:37:36 +0100
xsl parameters amp
Hi Stuart,

> Josh, the document() function when passed one string parameter
> interprets that string as URI (that is a URL or URN). You do not
> escape characters in a URI using the character entity references
> defined in HTML 4.01 or XML 1.0 (silly goose).
>
> In a URI, a character is escaped as a sequence of hexadecimal byte
> values, each of the form %HH. An ampersand is represented in a URI
> with the sequence '%26' (without the single quote marks). That
> should work for you, but if not, tell me what operating system you
> are working with. Read more about URIs at
> http://www.w3.org/Addressing/.

If I understand what you're saying, it doesn't sound right to me. The
point about escaping characters with the %HH escapes is to escape
URL-significant characters that aren't significant in this particular
URL. For example, if you wanted to submit a form with the value of the
'company' parameter being 'AT&T', then you'd do:

  my.cgi?company=AT%26T

Because the & is significant in a URL (it's used to separate
parameters).
  
But if you had another parameter that you wanted to use in the URL,
then you'd separate that from the first with an ampersand; so if there
was one called 'date' with the value '2002-05-17' then the URL is:

  my.cgi?company=AT%26T&date=2002-05-17

So to get that document, you'd use the XPath:

  document('my.cgi?company=AT%26T&date=2002-05-17')

and of course if that XPath is embedded in some XML, then you need to
escape the ampersand character:

  <xsl:apply-templates
    select="document('my.cgi?company=AT%26T&amp;date=2002-05-17')" />

But maybe I'm being a silly goose too...
    
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.