[XML4Lib] Job opening: XML developer at
TuftsUniversity (UNCLASSIFIED)
Boheemen, Peter van
Peter.vanBoheemen at wur.nl
Fri May 16 16:18:02 EDT 2008
Or if you llike to type a lot :)
<a>
<xsl:attribute name="href">
<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="."/>
</a>
Obviously, dc:identifier is your current node as Charles says.
Best practice is to create a template for dc:identifier and not use a for-each loop.
XSLT is a declarative language and you should avoid procedural methods like you would do in most programming languages: http://www.devx.com/xml/Article/28610/1954
Peter
P.S. Read a good book or see http://www.zvon.org/xxl/XSLTutorial/Output/index.html
Drs. P.J.C. van Boheemen
Hoofd Applicatieontwikkeling en beheer - Bibliotheek Wageningen UR
Head of Application Development and Management - Wageningen University and Research Library
tel. +31 317 48 25 17 http://library.wur.nl <http://library.wur.nl/>
P Please consider the environment before printing this e-mail
________________________________
From: xml4lib-bounces at webjunction.org on behalf of Charles Yates
Sent: Fri 16-5-2008 21:30
To: Metz, Edward J Mr CIV USA TRADOC
Cc: xml4lib at webjunction.org
Subject: Re: [XML4Lib] Job opening: XML developer at TuftsUniversity (UNCLASSIFIED)
for-each changes the context node to each successive item in the select
node list.
you should use href="{.}" or href="{text()}" or href="{self::node()}"
Metz, Edward J Mr CIV USA TRADOC wrote:
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> I'm new to this list and have a question that I'm hoping someone can
> help me with. The answer is probably really straightforward but I can't
> seem to come up with it.
>
> I'm working on a very simple, bearbones XSL stylesheet to convert an XML
> file (using Dublin Core schema) to HTML. The problem I have is
> transforming the Identifier field containing an objects url into the <a
> href""> tag in my HTML.
>
> This bit of code from my XSL is for the Identifier field :
> <tr>
> <td align="left" valign="top" bgcolor="khaki">
> <b>URL(s):</b>
> </td>
> <td align="left" valign="top"><b>
>
> <xsl:for-each select="dc:identifier">
>
> <div class="item-style">
> <a href="{dc:identifier}">
> <xsl:value-of select="."/><br/>
>
> It produces this output though in my htm document:
> <div class="item-style"><a
> href="">http://excerpts.contentreserve.com/FormatType-25/0857-1/123846-T
> heHouseOfThunder.wma<br></a></div>
>
> No matter what I try so far I don't seem able to get the url valkue to
> appear within the <a href""> tag
>
> Edward Metz
> Systems Librarian
> Combined Arms Research Library, USACGSC
> 250 Gibbon Ave
> Fort Leavenworth KS 66027-2314
> Tel: 913-758-3027
> Fax: 913-758-3014
> DSN: 585-3027
> http://carl.army.mil <http://carl.army.mil/>
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
>
>
> _______________________________________________
> XML4Lib mailing list
> XML4Lib at webjunction.org
> http://lists.webjunction.org/mailman/listinfo/xml4lib
>
>
_______________________________________________
XML4Lib mailing list
XML4Lib at webjunction.org
http://lists.webjunction.org/mailman/listinfo/xml4lib
More information about the XML4Lib
mailing list