Using XSLT Absolute ResolvedURL as a link
I'm trying to pull links from my XML file and use them in an XSLT file. Here is the XML:
<ElementData type="LBarData">
<ItemCount>5.0</ItemCount>
<Items class="array">
<LBarItem>
<EventHandlers type="LinkEvents">
<Click/>
<MouseOut/>
<MouseOver/>
</EventHandlers>
<IsPageNumber>0</IsPageNumber>
&l开发者_运维问答t;ResolvedURL>
<Absolute>http://www4.uwm.edu/letsci/</Absolute>
<ServerRelative>http://www4.uwm.edu/letsci/</ServerRelative>
</ResolvedURL>
<Title>College of Letters and Science</Title>
<WantHighlight>0</WantHighlight>
</LBarItem>
Below that are more instances of the "LBarItem" with similar data. I'm using the following to get the link "title":
<xsl:value-of select="Title"/>
How to I pull the "ResolvedURL/Absolute" and use it as a link on the title?
Desired output (from comments)
<a href="URL">Title</a>
With URL being the XML "ResolvedURL/Absolute" and Title being the XML "Title".
This is a FAQ,
Use:
<a href="{ResolvedURL/Absolute}"><xsl:value-of select="Title"/></a>
The technique of evaluating an XPath expression inside an attribute is a powerful, standard XSLT way of doing this, called AVT (Attribute-Value-Templates).
精彩评论