Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Help with writing select data

From: Patrick <psmith@------.---.--->
To: NULL
Date: 11/3/2006 11:59:00 AM

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">
<xsl:output 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="/">
   <xsl:param 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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent