xsl-list
[Top] [All Lists]

AW: Is conditional group-by possible?

2005-01-25 09:03:01
As far as I can tell, you don't have any FED_ID_FLAG, FED_ID or SOC_SEC_ID 
elements in your input document.
You missed the "PROV_" and "PROS_" part your element names....

HTH

wbr,
Roman

_______________________________________

Roman Huditsch
IT and Electronic Publishing
LexisNexis ARD Orac 
Marxergasse 25
1030 Vienna
Austria 
ph: +43-1-534 52-1514
f: +43-1-534 52-140
e-mail roman(_dot_)huditsch(_at_)lexisnexis(_dot_)at
www.lexisnexis.at
 

-----Ursprüngliche Nachricht-----
Von: Jim Neff [mailto:jneff(_at_)blockvision(_dot_)com] 
Gesendet: Dienstag, 25. Januar 2005 16:52
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: [xsl] Is conditional group-by possible?

Greetings,

Is a conditional group-by possible?

Here is what I tried:

<xsl:for-each-group 
     select="Table" 
     group-by="(if ((FED_ID_FLAG = 'F') 
     and (not(FED_ID = ''))) 
     then FED_ID 
     else SOC_SEC_ID)">

And I get nothing in my output.

My input looks like simliar to this :

<NewDataSet>
  <Table>    
    <PROV_SOC_SEC_ID>111104550</PROV_SOC_SEC_ID>    
    <PLOS_FED_ID_FLAG>S</PLOS_FED_ID_FLAG>
    <PLOS_FED_ID>190404550</PLOS_FED_ID>
    <PATIENT_LAST_NAME>Doe</PATIENT_LAST_NAME>
    <PATIENT_FIRST_NAME>John</PATIENT_FIRST_NAME>    
  </Table>
  <Table>    
    <PROV_SOC_SEC_ID>111104550</PROV_SOC_SEC_ID>
    <PLOS_FED_ID_FLAG>S</PLOS_FED_ID_FLAG>
    <PLOS_FED_ID>190404550</PLOS_FED_ID>
    <PATIENT_LAST_NAME>Doe</PATIENT_LAST_NAME>
    <PATIENT_FIRST_NAME>Jane</PATIENT_FIRST_NAME>    
  </Table>
  <Table>    
    <PROV_SOC_SEC_ID>777104550</PROV_SOC_SEC_ID>
    <PLOS_FED_ID_FLAG>F</PLOS_FED_ID_FLAG>
    <PLOS_FED_ID>880121550</PLOS_FED_ID>
    <PATIENT_LAST_NAME>Smith</PATIENT_LAST_NAME>
    <PATIENT_FIRST_NAME>Mary</PATIENT_FIRST_NAME>    
  </Table>
</NewDataSet>

This should result in two groups, one 111104550, the other 880121550.

What I want is to use the FED_ID element to group by if the 
FED_ID_FLAG = 'F' and FED_ID is an empty string.  Otherwise I 
want to use the SOC_SEC_ID element to group.

Thanks in advance,
Jim Neff


--~------------------------------------------------------------------
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>
  • AW: Is conditional group-by possible?, Huditsch Roman <=