maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Ewins <Brian.Ew...@btinternet.com>
Subject Re: XDoc Transform of non http links
Date Thu, 05 Dec 2002 15:29:31 GMT
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

Michael.J.Brown@jpmorgan.com 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:turbine-maven-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-maven-user-help@jakarta.apache.org>
> 
> 


Mime
View raw message