[
Lists Home |
Date Index |
Thread Index
]
- From: Michael Kraus <michael.kraus@informatik.uni-muenchen.de>
- Date: Tue, 18 Jul 2000 13:36:25 +0200
Ben,
I think the problem is deeper than you described. For example:
******** XML data ********
<library xmlns="http://www.library.com">
<book>
<title>B1</title>
<author>A1</author>
<abstract>xyzzy</abstract>
</book>
<book>
<title>B2</title>
<author>A2</author>
<abstract>xyzzy</abstract>
</book>
<book>
<title>B3</title>
<author>A1</author>
<abstract>xyzzy</abstract>
</book>
</library>
********* XLink linkbase ***********
<linkbase xmlns:xlink="http://www.w3.org/1999/xlink">
<link xlink:type="extended"
xlink:title="Books by Author A1">
<resource xlink:type="locator"
xlink:href="library.xml#xpointer(book[position()=1])"
xlink:title="B1"/>
<resource xlink:type="locator"
xlink:href="library.xml#xpointer(book[position()=3])"
xlink:title="B3"/>
</link>
</linkbase>
********* XSLT stylesheet *********
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lib="http://www.library.com"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="lib:library">
<html>
<h1>Books by Author A1</h1>
<p>
These books come from library XYZ.
</p>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="lib:book[author='A1']">
<p>
<b><xsl:value-of select="title"/></b><br>
<xsl:value-of select="abstract"/>
</p>
</xsl:template>
</xsl:stylesheet>
********************************
The resulting HTML file will be (not valid, but it's only an example):
<html>
<h1>Books by Author A1</h1>
<p>
These books come from library XYZ.
</p>
<p>
<b>B1</b><br>
xyzzy
</p>
<p>
<b>B3</b><br>
xyzzy
</p>
</html>
Now the question is: Is there any chance for the browser, given the
linkbase from above, to know that there should be a link between books
B1 and B3? And if, which elements should be used as source and target
of the link? the <p> element or the <b> element? In my opinion,
there's no general solution to this problem if the complexity of
XPointer and XSLT is considered.
Michael
|