Im trying to transform an XML document into XHTML using XSL transformation and was wondering how i can choose an XML element given the value of its attribute. e.g.
<image size="small">http:example.small.jpg</image>
<image size="medium">http:example.medium.jpg</image>
<image size="large">http:example.largw.jpg</image>
I only want to access the value "http:example.medium.jpg" from the image tag where size="medium".
Any help is greatly appreciated.
Ally
<xsl:if> Example<? xml version="1.0"?>
XSLT <xsl:value-of> Element.
The standard way to transform XML data into other formats is by Extensible Stylesheet Language Transformations (XSLT). You can use the built-in XSLTRANSFORM function to convert XML documents into HTML, plain text, or different XML schemas. XSLT uses stylesheets to convert XML into other data formats.
<xsl:value-of select="image[@size='medium']" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With