Re: [xsl] Use of ampersands in name value pairs of a url

Subject: Re: [xsl] Use of ampersands in name value pairs of a url
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 23 Apr 2004 11:05:20 +0100
  The problem is with the query string of the url (the bit after the ?).
  Afaik, name-value pairs need to separated ampersands, such as:

  ?one=value1&two=value2&three=value3

That's what the URL has but like any string, to put that into an XML file
or HTMl file you have to quote the &.

Some legacy browsers try to be kind by not enforcing that you quote the
& but that's not kind, only confusing.

If you type the above into a location/address bar it has to be as above,
but if you type it into a src attribute it has to be 


?one=value1&amp;two=value2&amp;three=value3

Otherwise the document it in is not valid (or not well formed)

  I know that url escaping allows for %26 to be used instead of ampersands
 - but apparently not for the separator, this needs to be an actual
  ampersand.

Yes, you don't want url escaping here, that would be used to get a &
_into_ the value rather than be a separator.


  What is the usual technique to create the query string in xsl?

Just go with the flow and let XSLT force you into doing the right thing.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread