|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Intra-document transclusion in IE5
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
|
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
|

Cart








