[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Implementing simple XLinks using XSL
Hi! I'm using an XML document (it happens to be NewsML but that isn't really relevant) that uses the following tag: <xlink:simple xmlns:xlink="http://www.w3.org/1999/xlink/namespace/" xlink:href="VIDEO_ABC123456789.xml#VIDEO_ABC123456789" xlink:role="NewsComponent" xlink:show="embed" xlink:actuate="onLoad" /> This is a very simple thing. What I want is a variation on the identity transform that intercepts any element with an xlink:show="embedded" and xlink:actuate="onLoad" and instead of copying the element, it gets the document in the href, finds the element that has the ID refered to and copies that nodeset into the result tree. I have a few ideas on how to do this but I've run into problems The identity transform (according to MS): <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/ | @* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> My first thought would be: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/ | @* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="*[@xlink:show='embed'][@xlink:actuate='onLoad']"> <xsl:copy-of select="document(substring-before(@xlink:href, '#'))//id(substring-after(@xlink:href, '#')) /> </xsl:template> </xsl:stylesheet> But it doesn't seem to work. Thanks! > Adam van den Hoven > Internet Application Developer > Blue Zone > tel. 604.685.4310 > fax. 604.685.4391 > > Blue Zone makes you interactive. http://www.bluezone.net/ > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|