XML Spy validates XML files, but the CDB itself reports strange errors
There are many cases where XML Spy 5 validates XML files that are not consistent with the XML specifications. This FAQ intends to provide some insight into the stranger error messages emitted by the configuration database. ERROR MESSAGECDB complains about a specific BACI property(???) PROBLEMXML Spy will not complain about excess spaces for attributes. An example: Bad - <xs:attribute name="relative_address " type="xs:int" use="optional" default="9"/> Good - <xs:attribute name="relative_address" type="xs:int" use="optional" default="9"/> ERROR MESSAGEXMLerror : SAXException java.lang.NullPointerException CDB.XMLerror: IDL:cosylab.com/CDB/XMLerror:1.0 at CDB.XMLerrorHelper.read(XMLerrorHelper.java:65) at CDB._DALStub.get_DAO(_DALStub.java:29) at CDBImpl.DALClient.main(DALClient.java:59) [david@midnight-vml CDB]$ PROBLEMThis is caused by a misnamed attribute: <xs:attribute name="double min_delta_trig" type="xs:double" use="optional" default="0.11719"/> ERROR MESSAGEXMLerror : XML parser error: Line=8: cvc-elt.1: Cannot find the declaration of element 'DC2DCConv_Node'. PROBLEMA guess is that the "urn:...:...:1.0" must be the same name as the schema, but this needs to be verified. In any event, the name of the schema must be �DC2DCConv_Node� in this specific case. ERROR MESSAGEDALClient alma/ABM1/LORR -k corbaloc::midnight-vml:4005/DAL XMLerror : SAXException org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the comment. CDB.XMLerror: IDL:cosylab.com/CDB/XMLerror:1.0 PROBLEM??? ERROR MESSAGEThe CDB complains about a specific BACI property. PROBLEMOverriding the type of an attribute is not possible: <xs:attribute name="default_timer_trig" type="xs:integer" use="optional" default="3000000000"/> should be of type "xs:int". ERROR MESSAGEalma/ABM1/FECOMP1 -k corbaloc::midnight-vml:4005/DAL XMLerror : SAXException org.xml.sax.SAXParseException: Content is not allowed in prolog. CDB.XMLerror: IDL:cosylab.com/CDB/XMLerror:1.0 at CDB.XMLerrorHelper.read(XMLerrorHelper.java:65) at CDB._DALStub.get_DAO(_DALStub.java:29) at CDBImpl.DALClient.main(DALClient.java:59) PROBLEM(Presumably) caused by this (relative_address is not part of a ROEnum): <xs:restriction base="baci:ROEnum"> <xs:attribute name="description" type="xs:string" use="optional" default="Helium Compressor Status"/> <xs:attribute name="format" type="xs:string" use="optional" default="%04X"/> <xs:attribute name="id" type="xs:int" use="optional" default="3"/> <xs:attribute name="relative_address" type="xs:int" use="optional" default="6"/> </xs:restriction> ERROR MESSAGEXMLerror : XML parser error: Line=37: src-resolve.4: Components from namespace 'urn:schemas-cosylab-com:BACI:1.0' are not referenceable from schema document 'file:/export/home/midnight-vml/david/introot/config/CDB/schemas/FECOMP_Node.xsd'. PROBLEMThis was caused because the following was missing from FECOMP_Node.xsd: <xs:import namespace="urn:schemas-cosylab-com:BACI:1.0"/> ERROR MESSAGEXML parser error: Line=278: derivation-ok-restriction.2.1.2: Error for type '#AnonType_set_fridge_stateFECOMP_Node'. An attribute use in this type has a type which is not validly derived from the type of the matching attribute use in the base type. CDB.XMLerror: IDL:cosylab.com/CDB/XMLerror:1.0 PROBLEMCaused by this (must specify name, type, use, default): <xs:attribute name="min_value" default="0"/> ERROR MESSAGEThe CDB complains that properties inherited from another device�s schema are not available. PROBLEMIt seems that it is not possible to inherit BACI properties from other schemas. Most likely a problem with expat, but not verified. Could also be something missing from the derived schema. ERROR MESSAGERecord does not exists: alma/TICSSIM/DC2DCCONV/getCurrent24VCnv PROBLEMThis is caused because the "default" of an attribute was not specified: <xs:attribute name="description" type="xs:string" use="optional"/> Here are some of Bogdan's additional comments: <attribute name=�double min_delta_trig � �/> cause Null pointer exception in exapt, but XMLSpy validates it. In inheritance by restriction XMLSpy just ignores �new� attributes as �double min_delta_trig � in our case! <attribute name=�min_delta_trig � �/> (space at the end !!) expat interpret as �min_delta_trig� (w/o space), XMLSpy according to above �rule� simply just ignore it. Duplicate attributes: expat complains, meanwhile XMLSpy does not complain and take the last one. XMLSpy works fine if MS XML parser is used. Bogdan -- DavidFugate - 28 Jun 2005 |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|