[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] binding xml to stylesheet


Subject: RE: [xsl] binding xml to stylesheet
From: Donal Regan <donal_regan10@xxxxxxxxxxx>
Date: Fri, 12 Mar 2004 07:17:24 +0000 (GMT)

Hello,

I think I was a bit vague the first time and I
apologise if this is painfully obvious. 

If I have 

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="stylesheet.xsl"
type="text/xsl"?>

<Company>
	<Name>Hello Tours</Name>
	<Location>Dublin</Location>
</Company>
<Company>
	<Name>Bonjour Voyages</Name>
	<Location>Paris</Location>
</Company>

and 



<?xml version = "1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" indent="no"
omit-xml-declaration="yes"/>

<xsl:template match="/">
<table>
<xsl:apply-templates/>
</table>

</xsl:template>


<xsl:template match="Company">
	<tr><td><b>Name:</b><i><xsl:value-of
select="Name"/></i></td></tr>
	<tr><td><button onClick="getLocation()" >Click
Me!</button></td></tr>
		
</xsl:template>

</xsl:stylesheet>


can I write a getLocation() function that will reside
in the resultant document and that will do something
like
document.parentDocument.getElementsByTagName("Location")
if not, why not? Where has the original document gone?

Cheers,
Donal


If a document has been created by binding an XML doc
to a stylesheet, is it possible to refer to elements
in the original XML document? I'm looking for
something like -
document.parentDocument.getElementsByTagName("Location")
for example.
If not, why not? 


	
	
		
___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml