The regular expression is /^[A-Za-z][a-zA-Z0-9+.-]*:/ (the production for 'scheme' + ':'). From section 3 of the spec, "Relative URI references are distinguished from absolute URI in that they do not begin with a scheme name.".

On JDK1.4 I reckon you should be able to just replace .startsWith("http") with .matches("^[a-zA-Z][a-zA-Z0-9+.-]*:"). But of course that wouldnt work for everybody...

-Baz

[EMAIL PROTECTED] wrote:
Hi,

We've just found a slight limitation of the xdoc transform template
site.dvsl when transforming to hyperlinks.  If the protocol is anything
other than http or https, the relative path is prepended to the link.  This
breaks any links such as mailto: or in our case, notes:.

Can I suggest a minor change - that we check for the presence of a ':'
rather than http?  I know this is quick and dirty, but should work in most
cases.  I'm not sure how you would make this match a regular expression
using the real URI syntax http://www.ietf.org/rfc/rfc2396.txt !

Cheers,

     Mike

302c302
<   #if( $item.attrib("href").startsWith("http") || $item.attrib
("href").startsWith("/site") )
---

 #if( $item.attrib("href").indexOf(":") != -1 )


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to