<?xml version="1.0" encoding="US-ASCII"?>

<!--
Copyright (C) 2001—2004 Stichting LogReport Foundation LogReport@LogReport.org
 
This document is part of Lire.

Lire is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
     
You should have received a copy of the GNU General Public License
along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html. 

-->
  
  

<!--                    
                                                                   -->

<!--                    Namespace prefix for validation using the
                        DTD                                        -->
<!ENTITY % LIRE.xmlns.pfx    "lire"                                  >
<!ENTITY % LIRE.pfx          "%LIRE.xmlns.pfx;:"                     >
<!ENTITY % LIRE.xmlns.attr.name "xmlns:%LIRE.xmlns.pfx;"             >
<!ENTITY % LIRE.xmlns.attr
  "%LIRE.xmlns.attr.name; CDATA #FIXED 'http://www.logreport.org/LRSML/'">

<!ENTITY % LRCML.xmlns.pfx    "lrcml"                                 >
<!ENTITY % LRCML.pfx          "%LRCML.xmlns.pfx;:"                    >
<!ENTITY % LRCML.xmlns.attr.name "xmlns:%LRCML.xmlns.pfx;">
<!ENTITY % LRCML.xmlns.attr
  "%LRCML.xmlns.attr.name; CDATA #FIXED 'http://www.logreport.org/LRCML/'">


  
  

<!ENTITY % lire-types.mod PUBLIC
    "-//LogReport.ORG//ENTITIES Lire Data Types V1.0//EN"
    "lire-types.mod">
%lire-types.mod;

<!ENTITY % lire-desc.mod PUBLIC
    "-//LogReport.ORG//ELEMENTS Lire Description Elements V2.0//EN"
    "lire-desc.mod">
%lire-desc.mod;
   
  

<!ENTITY % LIRE.report-spec     "%LIRE.pfx;report-spec"              >
<!ENTITY % LIRE.global-filter-spec "%LIRE.pfx;global-filter-spec">
<!ENTITY % LIRE.display-spec    "%LIRE.pfx;display-spec"             >
<!ENTITY % LIRE.param-spec      "%LIRE.pfx;param-spec"               >
<!ENTITY % LIRE.param           "%LIRE.pfx;param"                    >
<!ENTITY % LIRE.chart-configs   "%LIRE.pfx;chart-configs"            >
<!ENTITY % LRCML.param          "%LRCML.pfx;param"                   >
<!ENTITY % LIRE.filter-spec     "%LIRE.pfx;filter-spec"              >
<!ENTITY % LIRE.report-calc-spec "%LIRE.pfx;report-calc-spec"        >

<!ELEMENT %LRCML.param; (#PCDATA|%LRCML.param;)*                     >
<!ATTLIST %LRCML.param;
             name      NMTOKEN                             #REQUIRED
             value     CDATA                               #IMPLIED  >

  

<!ELEMENT %LIRE.report-spec;
                        (%LIRE.title;, %LIRE.description;,
                         (%LIRE.param-spec;)?, %LIRE.display-spec;,
                        (%LIRE.filter-spec;)?, (%LIRE.chart-configs;)?,
                        %LIRE.report-calc-spec;)    
                                                                     >
<!ATTLIST %LIRE.report-spec;
             id             ID                              #REQUIRED
             superservice   %superservice.type;             #REQUIRED
             schema         NMTOKEN                         #IMPLIED
             joined-schemas NMTOKENS                        #IMPLIED
             %LIRE.xmlns.attr;                                       
             %LRCML.xmlns.attr;                                       >

   

<!ELEMENT %LIRE.global-filter-spec;
                        (%LIRE.title;, %LIRE.description;,
                         (%LIRE.param-spec;)?, %LIRE.display-spec;,
                        (%LIRE.filter-spec;))    
                                                                     >

<!ATTLIST %LIRE.global-filter-spec;
             id             ID                              #REQUIRED
             superservice   %superservice.type;             #REQUIRED
             schema         NMTOKEN                         #IMPLIED
             joined-schemas NMTOKENS                        #IMPLIED
             %LIRE.xmlns.attr;                                       >

   

<!ELEMENT %LIRE.display-spec; (%LIRE.title;, (%LIRE.description;)?)  >

   

<!ELEMENT %LIRE.param-spec; (%LIRE.param;)+                          >

   

<!ELEMENT %LIRE.param; (%LIRE.description;)?                         >
<!ATTLIST  %LIRE.param;
             name       ID                                 #REQUIRED 
             type       (%lire.types;)                     #REQUIRED
             default    CDATA                              #IMPLIED  >

   

<!ELEMENT %LIRE.chart-configs; (%LRCML.param;)+                      >

   

<!ENTITY % LIRE.eq      "%LIRE.pfx;eq"                               >
<!ENTITY % LIRE.ne      "%LIRE.pfx;ne"                               >
<!ENTITY % LIRE.gt      "%LIRE.pfx;gt"                               >
<!ENTITY % LIRE.ge      "%LIRE.pfx;ge"                               >
<!ENTITY % LIRE.lt      "%LIRE.pfx;lt"                               >
<!ENTITY % LIRE.le      "%LIRE.pfx;le"                               >
<!ENTITY % LIRE.and     "%LIRE.pfx;and"                              >
<!ENTITY % LIRE.or      "%LIRE.pfx;or"                               >
<!ENTITY % LIRE.not     "%LIRE.pfx;not"                              >
<!ENTITY % LIRE.match   "%LIRE.pfx;match"                            >
<!ENTITY % LIRE.value   "%LIRE.pfx;value"                            >

<!ENTITY % expr "%LIRE.eq; | %LIRE.ne; | 
                 %LIRE.gt; | %LIRE.lt; | %LIRE.ge; | %LIRE.le; | 
                 %LIRE.and; | %LIRE.or; | %LIRE.not; | 
                 %LIRE.match; | %LIRE.value;"                        >

   
 
<!ELEMENT %LIRE.filter-spec; (%expr;)                                >

    

<!ELEMENT %LIRE.value;  EMPTY                                        >
<!ATTLIST %LIRE.value;
             value      CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.eq;     EMPTY                                        >
<!ATTLIST %LIRE.eq;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.ne;     EMPTY                                        >
<!ATTLIST %LIRE.ne;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.gt;     EMPTY                                        >
<!ATTLIST %LIRE.gt;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.ge;     EMPTY                                        >
<!ATTLIST %LIRE.ge;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.lt;     EMPTY                                        >
<!ATTLIST %LIRE.lt;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.le;     EMPTY                                        >
<!ATTLIST %LIRE.le;
             arg1       CDATA                              #REQUIRED   
             arg2       CDATA                              #REQUIRED >

    

<!ELEMENT %LIRE.match;  EMPTY                                        >
<!ATTLIST %LIRE.match;
             value          CDATA                          #REQUIRED   
             re             CDATA                          #REQUIRED 
             case-sensitive (%bool.type;)                  'true'    >

    

<!ELEMENT %LIRE.not;    (%expr;)                                     >

    

<!ELEMENT %LIRE.and;    (%expr;)+                                    >

    

<!ELEMENT %LIRE.or;     (%expr;)+                                    >

    

<!ENTITY % LIRE.timegroup   "%LIRE.pfx;timegroup"                    >
<!ENTITY % LIRE.group       "%LIRE.pfx;group"                        >
<!ENTITY % LIRE.rangegroup  "%LIRE.pfx;rangegroup"                   >
<!ENTITY % LIRE.timeslot    "%LIRE.pfx;timeslot"                     >
<!ENTITY % LIRE.field       "%LIRE.pfx;field"                        >
<!ENTITY % LIRE.sum         "%LIRE.pfx;sum"                          >
<!ENTITY % LIRE.avg         "%LIRE.pfx;avg"                          >
<!ENTITY % LIRE.min         "%LIRE.pfx;min"                          >
<!ENTITY % LIRE.max         "%LIRE.pfx;max"                          >
<!ENTITY % LIRE.first       "%LIRE.pfx;first"                        >
<!ENTITY % LIRE.last        "%LIRE.pfx;last"                         >
<!ENTITY % LIRE.count       "%LIRE.pfx;count"                        >
<!ENTITY % LIRE.records     "%LIRE.pfx;records"                      >

<!-- Empty group operator                                          -->
<!ENTITY % LIRE.empty-ops   "%LIRE.sum; | %LIRE.avg; | %LIRE.count; |
                             %LIRE.min; | %LIRE.max; | %LIRE.first; |
			     %LIRE.last; | %LIRE.records;"           >

<!-- Group operations that are also aggregators                    -->
<!ENTITY % LIRE.nestable-aggr
                            "%LIRE.group; | %LIRE.timegroup; | 
                             %LIRE.timeslot; | %LIRE.rangegroup;"    >

<!-- Group operations                                              -->
<!ENTITY % LIRE.group-ops   "%LIRE.empty-ops;| %LIRE.nestable-aggr;" >

<!-- Containers for group operations                               -->
<!ENTITY % LIRE.aggregator  "%LIRE.nestable-aggr;"                   >

   

<!ELEMENT %LIRE.report-calc-spec; (%LIRE.aggregator;)                >

    

<!ENTITY % label.attr "label CDATA #IMPLIED">

    

<!ENTITY % name.attr	  "name ID      #IMPLIED">
<!ENTITY % name.attr.req  "name ID      #REQUIRED">

    

<!ELEMENT %LIRE.group;      ((%LIRE.field;)+, (%LIRE.group-ops;)+)   >
<!ATTLIST %LIRE.group;
	     %name.attr;
             sort       NMTOKENS                           #IMPLIED  
             limit      CDATA                              #IMPLIED  >

    

<!ELEMENT %LIRE.timegroup;  (%LIRE.group-ops;)+                      >
<!ATTLIST %LIRE.timegroup;
	     %name.attr;
	     %label.attr;
             field      NMTOKEN                            #IMPLIED
             period     CDATA                             #REQUIRED  >

    

<!ELEMENT %LIRE.timeslot;  (%LIRE.group-ops;)+                       >
<!ATTLIST %LIRE.timeslot;
	     %name.attr;
	     %label.attr;
             field      NMTOKEN                            #IMPLIED
             unit       CDATA                             #REQUIRED  >

    

<!ELEMENT %LIRE.rangegroup;  (%LIRE.group-ops;)+                     >
<!ATTLIST %LIRE.rangegroup;
	     %name.attr;
	     %label.attr;
             field          NMTOKEN                       #REQUIRED
             range-start    CDATA                         #IMPLIED
             range-size     CDATA                         #REQUIRED 
             min-value      CDATA                         #IMPLIED   
             max-value      CDATA                         #IMPLIED 
             size-scale     CDATA                         #IMPLIED   >

    

<!ELEMENT %LIRE.field;  EMPTY                                        >
<!ATTLIST %LIRE.field;
             name   NMTOKEN				    #REQUIRED
	     %label.attr;                                            >

    

<!ELEMENT %LIRE.sum;    EMPTY                                        >
<!ATTLIST %LIRE.sum;
             %name.attr.req;
	     %label.attr;
	     ratio	(none | group |table)              'none'
             field      NMTOKEN                            #REQUIRED 
	     weight	NMTOKEN				   #IMPLIED >

    
 
<!ELEMENT %LIRE.avg;    EMPTY                                        >
<!ATTLIST %LIRE.avg;
             %name.attr.req;
	     %label.attr;
             field      NMTOKEN                            #IMPLIED 
             by-fields  NMTOKENS                           #IMPLIED 
	     weight	NMTOKEN				   #IMPLIED >

    
 
<!ELEMENT %LIRE.max;    EMPTY                                        >
<!ATTLIST %LIRE.max;
             %name.attr.req;
	     %label.attr;
             field      NMTOKEN                            #REQUIRED >

    
 
<!ELEMENT %LIRE.min;    EMPTY                                        >
<!ATTLIST %LIRE.min;
             %name.attr.req;
	     %label.attr;
             field      NMTOKEN                            #REQUIRED >

    
 
<!ELEMENT %LIRE.first;    EMPTY                                        >
<!ATTLIST %LIRE.first;
             %name.attr.req;
	     %label.attr;
             field      NMTOKEN                            #REQUIRED 
             sort       NMTOKENS                           #IMPLIED  
	     >

    
 
<!ELEMENT %LIRE.last;    EMPTY                                        >
<!ATTLIST %LIRE.last;
             %name.attr.req;
	     %label.attr;
             field      NMTOKEN                            #REQUIRED 
             sort       NMTOKENS                           #IMPLIED  
	     >

    

<!ELEMENT %LIRE.count;  EMPTY                                        >
<!ATTLIST %LIRE.count;
             %name.attr.req;
             %label.attr;
	     ratio	(none | group |table)              'none'
             fields     NMTOKENS                           #IMPLIED  >

    

<!ELEMENT %LIRE.records; EMPTY                                       >
<!ATTLIST %LIRE.records;
             fields      NMTOKENS                          #REQUIRED >

    