- From: Kevin Smathers <kevin.smathers@hp.com>
- Date: Tue, 21 Oct 2003 08:45:20 -0700
- To: "Butler, Mark" <Mark_Butler@hplb.hpl.hp.com>
- Cc: "'www-rdf-dspace@w3.org'" <www-rdf-dspace@w3.org>
Thans for the instant tutorial; I'll use that.
Butler, Mark wrote:
>Hi Kevin,
>
>At the SIMILE-core telecon you were after sources of information about XSLT.
>The obvious source is Michael Kay's book publishe by Wrox Press titled
>"XSLT: Programmers Reference". I also found a series of articles published
>by XML.com on XSLT very helpful - see
>
>http://www.xml.com/pub/a/2002/03/20/xpath2.html
>http://www.xml.com/pub/a/2002/04/10/xslt2.html
>
>http://www.xml.com/pub/a/2003/05/07/tr.html
>http://www.xml.com/pub/a/2003/10/01/tr.html
>http://www.xml.com/pub/a/2003/09/03/trxml.html
>http://www.xml.com/pub/a/2003/08/06/tr.html
>http://www.xml.com/pub/a/2003/07/09/xslt.html
>http://www.xml.com/pub/a/2003/06/04/tr.html
>
>Beware XSLT 2.0 has changed since the 2002 articles so they are slightly
>misleading.
>
>One the phone, you said you were struggling to convert XML elements to
>references? I'm guessing you mean you want to convert something like this
>
><MyObject>
> <topic>thetopicterm</topic>
><MyObject>
>
>to this
>
><MyObject>
> <topic>
> <rdf:Description
>rdf:about="http://example.com/data/topicterms#thetopicterm"/>
> <rdfs:label>thetopicterm</rdfs:label>
> </topic>
></MyObject>
>
>then you can use some XSLT like this:
>
><xsl:template match="MyObject">
> <MyObject>
> <xsl:if test="not(normalize-space(./topic)='')">
> <topic>
> <rdf:Description>
> <xsl:attribute
>name="rdf:about">&namespace;topicterms#<xsl:value-of
>select="./topic"/></xsl:attribute>
> <rdfs:label><xsl:value-of
>select="./topic"/></rdfs:label>
> </rdf:Description>
> </topic>
> </xsl:if>
> </MyObject>
></xsl:template>
>
>Although note you need to define namespace at the top using an entity
>definition e.g.
>
><!ENTITY namespace 'http:/example.com/data'>
>
>Any questions please let me know?
>
>Dr Mark H. Butler
>Research Scientist HP Labs Bristol
>mark-h_butler@hp.com
>Internet: http://www-uk.hpl.hp.com/people/marbut/
>
>
--
========================================================
Kevin Smathers kevin.smathers@hp.com
Hewlett-Packard kevin@ank.com
Palo Alto Research Lab
1501 Page Mill Rd. 650-857-4477 work
M/S 1135 650-852-8186 fax
Palo Alto, CA 94304 510-247-1031 home
========================================================
use "Standard::Disclaimer";
carp("This message was printed on 100% recycled bits.");
Received on Tuesday, 21 October 2003 11:46:55 UTC