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

[xsl] Antw: sum up the "Size in GB".


Subject: [xsl] Antw: sum up the "Size in GB".
From: "Michael Donabauer" <michael.donabauer@xxxxxxxxxxxx>
Date: Thu, 23 Jun 2005 13:22:26 +0200

Hi *,

This is the file sympd_list_lirp33.xml:

  <?xml version="1.0" standalone="yes" ?> 
- <SymCLI_ML>
- <Symmetrix id="000287970171">
- <Device dev_name="0007" status="Ready" configuration="2-Way Mir">
  <Flags worm_protected="False" grouped="False" meta="None" /> 
  <Capacity megabytes="3" /> 
- <Front_End>
  <Port pd_name="/dev/rhdiskpower0" director="02C" port="0" /> 
  </Front_End>
- <Back_End>
  <Disk director="16A" interface="C" tid="3" /> 
  </Back_End>
  </Device>
- <Device dev_name="0008" status="Ready" configuration="2-Way Mir">
  <Flags worm_protected="False" grouped="False" meta="None" /> 
  <Capacity megabytes="3" /> 
- <Front_End>
  <Port pd_name="/dev/rhdiskpower1" director="02C" port="0" /> 
  </Front_End>
- <Back_End>
  <Disk director="01B" interface="C" tid="3" /> 
  </Back_End>
  </Device>
- <Device dev_name="0009" status="Ready" configuration="2-Way Mir">
  <Flags worm_protected="False" grouped="False" meta="None" /> 
  <Capacity megabytes="3" /> 
- <Front_End>
  <Port pd_name="/dev/rhdiskpower2" director="02C" port="0" /> 
  </Front_End>
- <Back_End>
  <Disk director="16B" interface="C" tid="8" /> 
  </Back_End>
  </Device>

and this is the file lspv_lirp33.xml (called by the document
function):

  <?xml version="1.0" standalone="yes" ?> 
- <SymCLI_ML>
- <Symmetrix id="000287970171">
- <Device>
- <Front_End>
  <Port pd_name="/dev/rhdiskpower49" aix_vg="oraclevg" /> 
  <Port pd_name="/dev/rhdisk0" aix_vg="rootvg" /> 
  <Port pd_name="/dev/rhdisk1" aix_vg="rootvg" /> 
  <Port pd_name="/dev/rhdiskpower4" aix_vg="oraclevg" /> 
  <Port pd_name="/dev/rhdiskpower5" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower6" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower7" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower8" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower9" aix_vg="adsmvg1" /> 
  <Port pd_name="/dev/rhdiskpower10" aix_vg="adsmvg1" /> 
  <Port pd_name="/dev/rhdiskpower11" aix_vg="adsmvg1" /> 
  <Port pd_name="/dev/rhdiskpower12" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower13" aix_vg="mksysb_sp" /> 
  <Port pd_name="/dev/rhdiskpower14" aix_vg="mksysb_sp" /> 
  <Port pd_name="/dev/rhdiskpower15" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower16" aix_vg="tsmvg" /> 
  <Port pd_name="/dev/rhdiskpower17" aix_vg="uniqvg" /> 
  <Port pd_name="/dev/rhdiskpower18" aix_vg="uniqvg" /> 
 
 
both are joined by the script below. I'm using the msxsl.exe 3.0 tool
for the html-file generation. I have read in an online-manual that only
saxon supports the for-each-group function. Is that right? Do we need to
use the Munchian grouping method?

ciao ciao
::mike



##############################################################

Michael Donabauer
Informatik Services
Tel:+43 (0)732-9000-3359
Mobil: +43 (0)664/60165 3359
Fax: +43 (0) 732 9000 53359
Mail: michael.donabauer@xxxxxxxxxxxx

>>> <cookieking@xxxxxxxxxxx> 06/23/05 1:06  >>>

Post a sniplet of the xml files so i can see the structure. makes it
easier to dev your sum up the "Size in GB". 
jaxkookie
##############################################################
Date: Wed, 22 Jun 2005 08:37:07 +0200
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
From: "Michael Donabauer" <michael.donabauer@xxxxxxxxxxxx>
Subject: Group-by Question
Message-Id: <s2b9234a.089@xxxxxxxxxxxxxxxxxxx>

Hi xsl'ers,

thanks for your help, now i have joined two files together with the
following xsl-code: 

################################################################################
#############
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="host" />
<xsl:param name="lspv" />

<xsl:template match="SymCLI_ML/Symmetrix">
<HTML>
<BODY>
<H3><xsl:value-of select="$host" /> - Storageusage</H3>
<TABLE BORDER="1">
<tr bgcolor="#9acd32">
<TH>Symm-Dev</TH>
<TH>Dev-State</TH>
<TH>Dev-Conf</TH>
<TH>Meta-Dev</TH>
<TH>Size in GB</TH>
<TH>AIX-Device</TH>
<TH>AIX-Volumegroup</TH>
</tr>
<xsl:for-each select="Device[not(@dev_name =
preceding-sibling::Device/@dev_name)]">
    <xsl:variable name="vId" select="Front_End/Port/@pd_name"/>
<TR>
<TD>
  <xsl:value-of select="@dev_name"/>
  <td><xsl:value-of select="@status"/></td>
  <td><xsl:value-of
select="@configuration"/></td>
  <td><xsl:value-of select="Flags/@meta"/></td>
  <td><xsl:value-of select="Capacity/@megabytes
div 1000"/></td>
</TD>
<TD> 
  <xsl:value-of
select="document($lspv)/SymCLI_ML/Symmetrix/Device/Front_End/Port[@pd_name=$vId]
/@pd_name"/>
  <td>
  <xsl:value-of
select="document($lspv)/SymCLI_ML/Symmetrix/Device/Front_End/Port[@pd_name=$vId]
/@aix_vg"/>
  </td>
</TD>
</TR>
  </xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>

</xsl:stylesheet>
################################################################################
#############

an excerpt of the output looks like this in html:

################################################################################
#############
<HTML>
<BODY>
<H3>lirp10 - Storageusage</H3>
<TABLE BORDER="1">
<tr bgcolor="#9acd32">
<TH>Symm-Dev</TH>
<TH>Dev-State</TH>
<TH>Dev-Conf</TH>
<TH>Meta-Dev</TH>
<TH>Size in GB</TH>
<TH>AIX-Device</TH>
<TH>AIX-Volumegroup</TH>
</tr>
<TR>
<TD>0021<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower0<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>0025<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower1<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>0029<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower2<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>002D<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower3<td>P21vg</td>
</TD>
<TR>
<TD>01CE<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower22<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>01D2<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower23<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>01D6<td>Ready</td>
<td>RDF1+R-S</td>
<td>Head</td>
<td>46.035</td>
</TD>
<TD>/dev/rhdiskpower24<td>P21vg</td>
</TD>
</TR>
<TR>
<TD>0000<td>Write Disabled</td>
<td>2-Way Mir</td>
<td>None</td>
<td>0.023</td>
</TD>
<TD><td></td>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
################################################################################
#############

you see there is a column called AIX-Volumegroup (= @aix_vg), now i
want to group by @aix_vg and sum up the "Size in GB". Could i do that
in
one script? As already mentioned, i'm net to xsl!

thx
::mike

Michael Donabauer
Informatik Services
Tel:+43 (0)732-9000-3359
Mobil: +43 (0)664/60165 3359
Fax: +43 (0) 732 9000 53359
Mail: michael.donabauer@xxxxxxxxxxxx 


Current Thread
Keywords
xml