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

Intra-document transclusion in IE5

Subject: Intra-document transclusion in IE5
From: Rick Geimer <rick.geimer@xxxxxxx>
Date: Sun, 14 Mar 1999 09:15:00 -0800
intra on xsl template
Hello all,

This is my first posting to this list. I've been using XSL for about two
weeks now,
and have run into a stumbling block with IE5's implementation. I'm
trying to perform
a "transclusion" (also called source and reflection for those who speak
Pinnacles),
where I take the contents of one element and and display it in the
location of another
element that references it. I've thought of several ways to do this with
the full XSL
spec, but IE5 barfs on all my ideas. Basically, I would like to take
something like
the following instance:


<?xml version="1.0"?>
<?xml-stylesheet href="drinkdoc.xsl" type="text/xsl"?>
<!DOCTYPE drink.doc [
<!ELEMENT drink.doc ( beverage.list, drink.body )>
<!ELEMENT beverage.list ( beverage+ ) >
<!ELEMENT beverage ( #PCDATA ) >
<!ATTLIST beverage bev.id ID #REQUIRED>
<!ELEMENT drink.body ( bar.quote+ ) >
<!ELEMENT bar.quote ( #PCDATA | drink.link )* >
<!ELEMENT drink.link EMPTY >
<!ATTLIST drink.link bev.ref IDREF #REQUIRED>
]>
<drink.doc>
 <beverage.list>
  <beverage bev.id="drink1">beer</beverage>
 </beverage.list>
 <drink.body>
  <bar.quote>I could really use a <drink.link bev.ref="drink1"/> right
now.</bar.quote>
 </drink.body>
</drink.doc>



And transform it into the following HTML for display:



<html>
 <title>Tales from the bar side</title>
<body>
 <p>I could really use a beer right now</p>
</body>
</html>


Here is my straw-man XSL template as it stands:


<xsl:template xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:qxsl="quote:http://www.w3.org/TR/WD-xsl">
 <html>
 <title>Tales from the bar side</title>
 <body>
  <xsl:apply-templates select="drink.doc/*"/>
 </body>
 </html>
 <xsl:define-template-set>
        <xsl:template match = "drink.doc">
            <xsl:apply-templates/>
        </xsl:template>
        <xsl:template match = "drink.body">
            <xsl:apply-templates/>
        </xsl:template>
        <xsl:template match = "bar.quote">
   <p>
            <xsl:apply-templates select="node()">
    <xsl:template match="textnode()"><xsl:value-of/></xsl:template>
   </xsl:apply-templates>
   </p>
        </xsl:template>
        <xsl:template match = "drink.link">
            <!--
   What the heck do I put here to get the content of the
   beverage element whose bev.id attribute is equal to the current
   drink.link's bev.ref attribute?
   -->
        </xsl:template>
 </xsl:define-template-set>
</xsl:template>



I need to find some way to refer to the contents of the beverage element

whose bev.id attribute matches the bev.ref attribute of the drink.link
element.

Any ideas how to make this work in IE5?

Sincerely,

Rick Geimer
National Semiconductor
rick.geimer@xxxxxxx





 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.