I am using XSL to transform a resource
attribute, it will check whether or not it contains "urn:ISBN"
. If it does, then it will need to get the ISBN number value, and return it as an Amazon search query. For example
resource="urn:ISBN:0752820907"
then change into
http://www.amazon.com/gp/search/ref=sr_adv_b/?field-isbn=0752820907
The problem is, I don't know how to perform string matching, and also string copying using XSL. Please help, thanks.
update
below is my XSL code, it still couldn't produce the result I want. The hyperlink generated is intended to be placed on a column of a table
<td style="background-color: #F7F6F3">
<xsl:choose>
<xsl:when test="*/@rdf:resource">
<xsl:if test="starts-with(text(),'urn:ISBN')">
<xsl:variable name="ISBN" select="substring-after(text(),'urn:ISBN:')"/>
<xsl:value-of
select="concat ('http://www.amazon.com/gp/search/ref=sr_adv_b/?field-isbn=',$ISBN)"/>
</xsl:if>
</xsl:when>
</xsl:choose>
</td>
the data I am working on is RDF in XML format.
the usual representation involving books is rel="foaf:interest" resource="urn:ISBN:0752820907"