[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Implementing simple XLinks using XSL

Subject: Implementing simple XLinks using XSL
From: Adam Van Den Hoven <Adam.Hoven@xxxxxxxxxxxx>
Date: Mon, 18 Dec 2000 13:21:38 -0800
implementing xlinks
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.