P
Patrick
Hi All,
I'm new to all this and I'm back for more help. I am working with global
variables. I'm trying to make my xls just display the data for the
defined <moorname>. In my example I am using the second set of elements
C10AB. I can get it to just show the <moorname> but then it wants to
write out all the values for both sets. How can I fix this.
I would like my output to look like this;
Moorname: C10AB
Moortype: moortype2
Latitude: lat2
Longitude: lon2
Start: start2
End: end2
Your help is greatly appreciated.
Patrick
I have this xml;
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="testglovar.xsl" ?>
<active_wfs>
<deployment>
<moorname>C10AA</moorname>
<moortype>moortype1</moortype>
<lat>lat1</lat>
<lon>lon1</lon>
<start>start1</start>
<end>end1</end>
</deployment>
<deployment>
<moorname>C10AB</moorname>
<moortype>moortype2</moortype>
<lat>lat2</lat>
<lon>lon2</lon>
<start>start2</start>
<end>end2</end>
</deployment>
</active_wfs>
And this xsl;
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:variable name="moorname" select="'C10AB'" >
<html>
<body>
<xsl:call-template name="show_moor">
<xsl:with-param name="moornameToSelect" />
</xsl:call-template>
</body>
</html>
</xsl:variable>
<xsl:template name="show_moor" match="/">
<xslaram name="moornameToSelect" />
<xsl:for-each select="active_wfs/deployment">
<p>Moorname: <xsl:value-of select="$moorname " /></p>
<p>Moortype: <xsl:value-of select="moortype " /></p>
<p>Latitude: <xsl:value-of select="lat" /></p>
<p>Longitude: <xsl:value-of select="lon" /></p>
<p>Start: <xsl:value-of select="start" /></p>
<p>End: <xsl:value-of select="end" /></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
I'm new to all this and I'm back for more help. I am working with global
variables. I'm trying to make my xls just display the data for the
defined <moorname>. In my example I am using the second set of elements
C10AB. I can get it to just show the <moorname> but then it wants to
write out all the values for both sets. How can I fix this.
I would like my output to look like this;
Moorname: C10AB
Moortype: moortype2
Latitude: lat2
Longitude: lon2
Start: start2
End: end2
Your help is greatly appreciated.
Patrick
I have this xml;
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="testglovar.xsl" ?>
<active_wfs>
<deployment>
<moorname>C10AA</moorname>
<moortype>moortype1</moortype>
<lat>lat1</lat>
<lon>lon1</lon>
<start>start1</start>
<end>end1</end>
</deployment>
<deployment>
<moorname>C10AB</moorname>
<moortype>moortype2</moortype>
<lat>lat2</lat>
<lon>lon2</lon>
<start>start2</start>
<end>end2</end>
</deployment>
</active_wfs>
And this xsl;
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="html" encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:variable name="moorname" select="'C10AB'" >
<html>
<body>
<xsl:call-template name="show_moor">
<xsl:with-param name="moornameToSelect" />
</xsl:call-template>
</body>
</html>
</xsl:variable>
<xsl:template name="show_moor" match="/">
<xslaram name="moornameToSelect" />
<xsl:for-each select="active_wfs/deployment">
<p>Moorname: <xsl:value-of select="$moorname " /></p>
<p>Moortype: <xsl:value-of select="moortype " /></p>
<p>Latitude: <xsl:value-of select="lat" /></p>
<p>Longitude: <xsl:value-of select="lon" /></p>
<p>Start: <xsl:value-of select="start" /></p>
<p>End: <xsl:value-of select="end" /></p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld