Re: [xsl] document() source

Subject: Re: [xsl] document() source
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 31 Oct 2005 11:44:57 GMT
> That's good then, another +1 for XSLT 2.0 - It's been racking them up recently.

actually mostly that is available in 1.0 as well. Use document() rather
than doc() and omit the escaping function.  With the typical clarity of
most of the URI specification it isn't really clear if you need to
escape explictly. The actual URI needs to be escaped when it is passed
"down the wire" to a URI handler, but within a document it may (or may
not) be covered by the following text in the XML spec



  System identifiers (and other XML strings meant to be used as URI
  references) MAY contain characters that, according to [IETF RFC 2396]
  and [IETF RFC 2732], must be escaped before a URI can be used to
  retrieve the referenced resource. The characters to be escaped are the
  control characters #x0 to #x1F and #x7F (most of which cannot appear
  in XML), space #x20, the delimiters '<' #x3C, '>' #x3E and '"' #x22,
  the unwise characters '{' #x7B, '}' #x7D, '|' #x7C, '\' #x5C, '^' #x5E
  and '`' #x60, as well as all characters above #x7F. Since escaping is
  not always a fully reversible process, it MUST be performed only when
  absolutely necessary and as late as possible in a processing chain. In
  particular, neither the process of converting a relative URI to an
  absolute one nor the process of passing a URI reference to a process
  or software component responsible for dereferencing it SHOULD trigger
  escaping. When escaping does occur, it MUST be performed as follows:

The question being, is the argument of document() an "other XML strings
meant to be used as URI references" If it is, you don't need to
explictly escape the system SHOULD (ie it may, or may not, but on a
good day, it might) do the esacping automatically.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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