Page 1 of 1

Count equals string

Posted: Thu Nov 11, 2010 9:56 am
by enclaved
So i have a xml file

Code: Select all

<ApacheLog>
<LOGS>
<Request>GET promotion2.html HTTP/1.0</Request>
<Reff>www.yahoo.com</Reff>
</LOGS>
<LOGS>
<Request>GET promotion1.html HTTP/1.0</Request>
<Reff>www.yahoo.com</Reff>
</LOGS>
<LOGS>
<Request>GET promotion1.html HTTP/1.0</Request>
<Reff>www.google.com</Reff>
</LOGS>
</ApacheLog>
I need to count how many times each promotion is visited , and caunt diffrent reff for each promotion

Code: Select all

<ApacheLog>
<LOGS>
<promotion1>2</Request>
<numReff>2</RemoteHost>
</LOGS>
<LOGS>
<promotion2>1</Request>
<numReff>1</RemoteHost>
</LOGS>
</ApacheLog>
Can someone help me with this transformation.
Sorry for bad English but is not my native language.