[xml] problem validating XML file with DTD



Hi All,

I'm investigating LIBXML2 for an embedded project I'm working on.
I tried to validate & parse one of my existing XML config. files using
"parse2.c" from the example code.  It failed with an error:
camera_test.xml:65: validity error : Content model of rule is not determinist: ((input | (input , (operator , input)+)) , output+)
               </rule>

I'm using version 2.6.23.
I've validated & parsed this same file with other tools fine however.
Any ideas as to what could be going wrong?
I've included the XML file and corresponding DTD inline below:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE function_list SYSTEM "rules.dtd">
<function_list>
   <function>
       <name>camera test</name>
       <enabled>
           <boolean>false</boolean>
       </enabled>
       <rule>
           <input>
               <input_device>
                   <id>1</id>
                   <lpw_camera>
                       <motion_sensor>
                           <triggered>true</triggered>
                       </motion_sensor>
                   </lpw_camera>
               </input_device>
           </input>
           <operator>or</operator>
           <input>
               <input_device>
                   <id>1</id>
                   <lpw_camera>
                       <motion_sensor>
                           <inactive>55</inactive>
                       </motion_sensor>
                   </lpw_camera>
               </input_device>
           </input>
           <operator>and</operator>
           <input>
               <input_device>
                   <id>42</id>
                   <lpw_camera>
                       <image_motion>
                           <triggered>false</triggered>
                       </image_motion>
                   </lpw_camera>
               </input_device>
           </input>
           <operator>or</operator>
           <input>
               <input_device>
                   <id>15</id>
                   <lpw_camera>
                       <image_motion>
                           <inactive>10894</inactive>
                       </image_motion>
                   </lpw_camera>
               </input_device>
           </input>
           <output>
               <output_device>
                   <id>500</id>
                   <value>off</value>
               </output_device>
           </output>
           <output>
               <output_device>
                   <id>501</id>
                   <value>on</value>
               </output_device>
           </output>
       </rule>
   </function>
</function_list>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT function_list (function*)>
<!ELEMENT function (name,enabled,rule+) >
<!ELEMENT name (#PCDATA)>
<!ELEMENT enabled (boolean,(start_time,end_time)?)>
<!ELEMENT boolean (#PCDATA)>
<!ELEMENT rule ( (input|(input,(operator,input)+)),output+) >
<!ELEMENT start_time ( (year,month?,day?,hour?,minute?,second?)|(month,day?,hour?,minute?,second?)|(day,hour?,minute?,second?)|(hour,minute?,second?))> <!ELEMENT end_time ( (year,month?,day?,hour?,minute?,second?)|(month,day?,hour?,minute?,second?)|(day,hour?,minute?,second?)|(hour,minute?,second?))>
<!ELEMENT year (#PCDATA)>
<!ELEMENT month (#PCDATA)>
<!ELEMENT day (#PCDATA)>
<!ELEMENT hour (#PCDATA)>
<!ELEMENT minute (#PCDATA)>
<!ELEMENT second (#PCDATA)>
<!ELEMENT operator (#PCDATA)>
<!ELEMENT input (input_device|email_from|sms_from|time_between|time_at)>
<!ELEMENT time_at ( (year,month?,day?,hour?,minute?,second?)|(month,day?,hour?,minute?,second?)|(day,hour?,minute?,second?)|(hour,minute?,second?)|(minute,second?))> <!ELEMENT input_device (id, ( (lpw_env_sensor) | (lpw_dw_sensor|lpw_camera|lpw_motion_sensor)))>
<!ELEMENT id (#PCDATA)>
<!ELEMENT lpw_env_sensor ((temp,comparator)|(humidity,comparator)|(battery_status,comparator)|(power_source,comparator))>
<!ELEMENT temp (#PCDATA)>
<!ELEMENT humidity (#PCDATA)>
<!ELEMENT battery_status (#PCDATA)>
<!ELEMENT lpw_dw_sensor (door|window|(battery_status,comparator)|(power_source,comparator))>
<!ELEMENT door (triggered|inactive)>
<!ELEMENT power_source (#PCDATA)>
<!ELEMENT window (triggered|inactive)>
<!ELEMENT lpw_camera (motion_sensor|image_motion|(battery_status,comparator)|(power_source,comparator))>
<!ELEMENT motion_sensor (triggered|inactive)>
<!ELEMENT image_motion (triggered|inactive)>
<!ELEMENT lpw_motion_sensor (motion_sensor|(battery_status,comparator)|(power_source,comparator))>
<!ELEMENT triggered (#PCDATA)>
<!ELEMENT inactive (#PCDATA)>
<!ELEMENT comparator (#PCDATA)>
<!ELEMENT email_from (email_addr,subject?,message?)>
<!ELEMENT email_addr (#PCDATA)>
<!ELEMENT subject (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT sms_from (sms_sender,message?)>
<!ELEMENT sms_sender (#PCDATA)>
<!ELEMENT time_between (start_time,end_time)>
<!ELEMENT output ((output_device|email_to),after?)>
<!ELEMENT output_device (id,value,duration?)>
<!ELEMENT value (#PCDATA)>
<!ELEMENT email_to (email_addr,subject?,message?)>
<!ELEMENT duration (#PCDATA)>
<!ELEMENT after (#PCDATA)>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]