[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Converting embedded URLs int hot links via XSL


Subject: RE: [xsl] Converting embedded URLs int hot links via XSL
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Mon, 19 Apr 2004 09:30:34 +0000

tokenize seems about right, to find the preceding and following strings,
which may then be used in substring before and after to extract the needed
string.

but saxon 7.9.1 seems not to match using

<xsl:template match="/vs/url">
  <xsl:message>
  <xsl:for-each select="tokenize (.,
'(http|https|ftp)://((([a-z_0-9\-]+)+(([:]?)+([a-z_0-9\-]+))?)(@+)?)?(((((([
0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))).(((([0-1])?([0-9])?[0-9])
|(2[0-4][0-9])|(2[0-5][0-5]))).(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-
5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))))|((([a-z
0-9\-])+.)+([a-z]{2}.[a-z]{2}|[a-z]{2,4})))(([:])(([1-9]{1}[0-9]{1,3})|([1-5
]{1}[0-9]{2,4})|(6[0-5]{2}[0-3][0-6])))?(/)?$')">
    <xsl:value-of select="."/><xsl:text>
    ========
</xsl:text>
  </xsl:for-each>
</xsl:message>

</xsl:template>

only printing out the full string.

Well, bug or should be used differently? Only M. Kay can tell.



I'm also curious how I might add (escape) the single or double quotes prior
to the
url in the example.
http://www.w3.org/TR/xmlschema-2/#nt-Punctuation seems not to include these?



Can't help you there - regular expressions par se gives no special meaning to single nor double quotes, so it is an issue in XSLT - and I expect you to be better at that, than me.



regards DaveP



Regards, Ragulf Pickaxe :-)

_________________________________________________________________
Fe alle de nye og sjove ikoner med MSN Messenger http://www.msn.dk/messenger


Current Thread
Keywords