converting cross refs between HTML documents
I'm trying to use XSLT to convert an XML book into multiple HTML files, and I'm having an issue with cross references betweent the files.
The book is made up of multiple chapters, and I'm outputting each chapter as a separate HTML file-- chapter 1 is output as ch_1.html, and so on--using <xsl:number>. Within the chapters are Xref elements with an id attribute. I can create the text of the cross reference just fine:
<a href="#{@Target}">See <xsl:value-of select="id(@Target)/Head"/></a>
This works just fine for xref destinations within the same HTML file. The problem is that for a destination in a different HTML file, I can't figure out how to get the filename of the HTML file in the hypertext link. The Xref elementsare descendants of the Chapter element, but they aren't immediate children, and the number of elements between the Chapter and the Xref elements can vary.
Any ideas how I can get the destination filename in the hypertext link?
FYI, the DTD looks like this:
<!ELEMENT Manual (Chapter+)>
<!ELEMENT Chapter (title, Section*)>
<!ELEMENT Section (Head, Body*, Section*)>
<!ATTLIST Section Id #IMPLIED>
<!ELEMENT Body (#PCDATA | Xref)*>
<!ELEMENT Xref Empty>
<!ATTLIST Xref Target IDREF #REQUIRED
format CDATA #IMPLIED>
|