next
|
Subject: Question on validation Author: Helen He Date: 08 Mar 2006 10:11 AM
|
Now I am comparing XMLSPY and Stylus Studio since we are planning to buy one. I got confused when I tried to validate a same xml schema file. XMLSPY says the xml file is valid, but Stylus Studio says it has 34 errors.
Since the schema is fixed, we can not modify it. Can those errors be ignored if I set up some options? Could someone help me out? I appreciate any help.
The main schema includes too many schemas. I cannot attache the whole fold since it's too large.
Here is a snippet. In Stylus Studio, it says "Base type definition does not have any attributes" when the schema tried to define a complexType named CV.
<xs:complexType name="CV">
<xs:annotation>
<xs:documentation>
Coded data, consists of a code, display name, code system,
and original text. Used when a single code value must be sent.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="CE">
<xs:sequence>
<xs:element name="originalText" type="ED" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
The text or phrase used as the basis for the coding.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="translation" type="CD" minOccurs="0" maxOccurs="0"/>
</xs:sequence>
<xs:attribute name="code" type="cs" use="optional">
<xs:annotation>
<xs:documentation>
The plain code symbol defined by the code system.
For example, "784.0" is the code symbol of the ICD-9
code "784.0" for headache.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystem" type="uid" use="optional">
<xs:annotation>
<xs:documentation>
Specifies the code system that defines the code.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystemName" type="st" use="optional">
<xs:annotation>
<xs:documentation>
A common name of the coding system.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystemVersion" type="st" use="optional">
<xs:annotation>
<xs:documentation>
If applicable, a version descriptor defined
specifically for the given code system.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="displayName" type="st" use="optional">
<xs:annotation>
<xs:documentation>
A name or title for the code, under which the sending
system shows the code value to its users.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Here is the definition of base complexType named "CE"
<xs:complexType name="CE">
<xs:annotation>
<xs:documentation>
Coded data, consists of a coded value (CV)
and, optionally, coded value(s) from other coding systems
that identify the same concept. Used when alternative
codes may exist.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="CD">
<xs:sequence>
<xs:element name="originalText" type="ED" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
The text or phrase used as the basis for the coding.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="qualifier" type="CR" minOccurs="0" maxOccurs="0"/>
<xs:element name="translation" type="CD" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
A set of other concept descriptors that translate
this concept descriptor into other code systems.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="code" type="cs" use="optional">
<xs:annotation>
<xs:documentation>
The plain code symbol defined by the code system.
For example, "784.0" is the code symbol of the ICD-9
code "784.0" for headache.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystem" type="uid" use="optional">
<xs:annotation>
<xs:documentation>
Specifies the code system that defines the code.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystemName" type="st" use="optional">
<xs:annotation>
<xs:documentation>
A common name of the coding system.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSystemVersion" type="st" use="optional">
<xs:annotation>
<xs:documentation>
If applicable, a version descriptor defined
specifically for the given code system.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="displayName" type="st" use="optional">
<xs:annotation>
<xs:documentation>
A name or title for the code, under which the sending
system shows the code value to its users.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
|
next
|
Subject: Question on validation Author: (Deleted User) Date: 08 Mar 2006 03:28 PM
|
Hi Helen,
thanks for the schema files. Xerces-C is indeed getting confused by the recursive structure of some definitions, and probably by the restrictions involving mixed elements; we'll report these problems to the Xerces team.
We tried other validators (Microsoft System.Xml, MSXML, Xerces-J2.5, Xerces-J 2.8, XSV, SQC) and we got mixed reports, probably an indication that the schema writer exercized troublesome parts of the schema specs.
(BTW, this is not the first time we see such pattern, hence our approach to ship a number of them, allowing the user to also plug in their preferred one)
Given that you must use the schema as is, I suggest that you use XSV or Xerces-J 2.8 to validate your XML samples, as they don't report any error in the schema itself.
In order to use XSV you must click on the arrow next to the validation button in the toolbar and select the XSV 2.10-1 entry; to use Xerces-J 2.8 (released 10 days ago) you will have to first download it from http://www.apache.org/dist/xml/xerces-j/Xerces-J-bin.2.8.0.zip and unpack it (e.g. C:\xerces-2_8_0), then take the attached custom validator definition and place it in the <stylus_dir>\bin\Custom Validation Engines. At that point a new entry "Xerces-J 2.8" will appear in the list of the available validators.
Hope this helps,
Alberto
Xerces_J_2_8.xml Xerces-J 2.8 custom validator
|
next
|
Subject: Question on validation Author: Helen He Date: 09 Mar 2006 01:07 PM Originally Posted: 09 Mar 2006 10:14 AM
|
Hi, Alberto
Thank you very much. This is very helpful and now I know what's going on.
I tried both way. XSV works very well, but I had a little trouble on adding Xerces-J 2.8.
After putting Xerces_J_2_8.xml under folder Custom Validation Engines, I start Stylus, I cannot find Xerces-J2.8 entry by clicking the arrow next to the validation button. Then I click menu "Tools", go down to Options --> General --> Custom Validation Engines, I can find Xerces-J 2.8 entry at the upper right panel. I try to modify Xerces_J_2_8.xml and set SupportsXSD="true", then I can find Xerces-J 2.8 entry under that arrow, but when I tried to validate a schema, I got an error message
"There was an error during validation of ${SchemaURLFile}
Reason = no protocol: ${SchemaURLFile}"
I tried several ways but it looks I didn't get right configuration.
Could you please help me out?
Appreciate your help,
Helen
|
|