rlbewick Posted January 23, 2010 Share Posted January 23, 2010 I have string of xml I would like to display as xhtml from a URI string.The XML code is: <xs:element name="SmallCreative" type="xs:anyURI"/> How would I go about displaying this image via xhtml through xslt?Thanks everyone, let me know if you need more specifics.. Link to comment Share on other sites More sharing options...
Martin Honnen Posted January 23, 2010 Share Posted January 23, 2010 You have posted a schema fragment. Assuming it is not the schema fragment you want to transform but rather an instance of the schema you can simply use <xsl:template match="SmallCreative"> <img src="{.}"/></xsl:template> or maybe, if you really want to create XHTML <xsl:template match="SmallCreative"> <img xmlns="http://www.w3.org/1999/xhtml" src="{.}"/></xsl:template> Link to comment Share on other sites More sharing options...
rlbewick Posted January 23, 2010 Author Share Posted January 23, 2010 You have posted a schema fragment. Assuming it is not the schema fragment you want to transform but rather an instance of the schema you can simply use<xsl:template match="SmallCreative"> <img src="{.}"/></xsl:template> or maybe, if you really want to create XHTML <xsl:template match="SmallCreative"> <img xmlns="http://www.w3.org/1999/xhtml" src="{.}"/></xsl:template> Thank you Martin, that code works great! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.