xsl-list
[Top] [All Lists]

RE: RE: RE: a question

2004-11-05 00:03:36
actually i want to group all rows with the same first 3 character in one cell 
of a table. i can put an element which has the sum values into the XML file. 
e.g.:
----
01011
01001
0100001
010 -->the sums
------
0201111
02023
020-->the sums
------
...

regards.


-----Original Message-----
From: cknell(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com]
Sent: Thursday, November 04, 2004 7:29 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: RE: RE: [xsl] a question


Do you know the three characters before you do the transformation or are you 
looking to determine which groups of elements have the same three characters 
while the transformation is taking place?

In the former case, you can pass the three-character string as a parameter to 
the transformation, as in:

<xsl:parameter name="match-key" select="" />

Suppose you passed "010" as the value of the parameter, then this will do what 
you describe:

<xsl:value-of select="sum(elementlist/value[substring(c,1,3)=$match-key]/a)" />

If you don't know the value in advance, and therefor cannot pass it in as a 
parameter, then you will have to use keys to select the nodes. That's beyond a 
simple explanation, and given my relatively rare use of the key()  and 
generate-id() functions, beyond my capacity to offer a complex explanation in a 
short period of time. There are may references to these functions on this 
list's archives. If this is what you need, then perhaps someone more familiar 
with this approach will offer advice.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Osman Çinar Eren <Cinar(_dot_)Eren(_at_)isbank(_dot_)com(_dot_)tr>
Sent:     Thu, 4 Nov 2004 19:02:58 +0200
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: RE: [xsl] a question

hi,
"elementlist/value/c" are unique over both elementlists(aktif and pasif).
i would like to sum over all whose "elementlist/value/c" values` first 3 
characters have the same value. if this is not feasible, i can also supply his 
value in the XML as another field. i.e."elementlist/value/first3"

regards.


-----Original Message-----
From: cknell(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com]
Sent: Thursday, November 04, 2004 7:00 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: RE: [xsl] a question


Are you saying that you wish to sum all the values of "elementlist/value/a" 
where "elementlist/value/c" = "010"? Do you want to sum across all 
"elementlist" elements or only the ones where "elementlist/key" has a specific 
value?
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Osman Çinar Eren <Cinar(_dot_)Eren(_at_)isbank(_dot_)com(_dot_)tr>
Sent:     Thu, 4 Nov 2004 18:52:14 +0200
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: [xsl] a question

thanks for your answers (david and cknell)
i would like to learn if i can make some operations on the values of one 
field.i.e. take the total of some elements'(<value> in my XML) X values(<a> in 
my XML file) and write these totals. Also some elements are chose according to 
the value of some field.(<c> in my XML file) That is; take the total of all 
elements whose some value is SAME. Then write this into the XSL.

thanks in advance.
also i will greatly appreciate any help if you can guide me a nice tutorial on 
thse subjects.

best regards.


-----Original Message-----
From: cknell(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com]
Sent: Thursday, November 04, 2004 6:46 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] a question


The precise form of the XPath depends on the document context from which you 
invoke it.  Let's assume that your document's root element is <lists></lists> 
and that all the <elementlist></elementlist> are its direct descendants. In 
this case, 
<xsl:value of select="/lists/elementlist[key='aktif']/value[1]/e" /> will 
return "KASA".
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Osman Çinar Eren <Cinar(_dot_)Eren(_at_)isbank(_dot_)com(_dot_)tr>
Sent:     Thu, 4 Nov 2004 18:27:29 +0200
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] a question

hi,

i am a newbie on this list. i work with FOP and i must prepare an XSL file for 
my XML file. My XML file contains two elements with different keys, i.e.:

 <elementlist xsi:type="java:org.exolab.castor.mapping.MapItem">
  <key xsi:type="java:java.lang.String">aktif</key> 
 <value xsi:type="java:com.oreilly.hh.QueryTestXML$XMLDovizElement">
  <a>17100</a> 
  <b>746.00</b> 
  <c>010</c> 
  <d>17130900000.00</d> 
  <e>KASA</e> 
  <f>74854930157246.00</f> 
  <g>1</g> 
  <h>1</h> 
  </value>
     <value>
    .
    .
    .
    </value>

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



<Prev in Thread] Current Thread [Next in Thread>