Velocity Reviews

Velocity Reviews (
-   XML (
-   -   annotations and additional rules (

pbk++ 03-28-2008 08:36 AM

annotations and additional rules
Hi dear fellows

I have to write set of classes analizing xml document. Doc should be
validated againt given scheme. I did it. Unfortunately doc should have
additional validation based on unformal rules hiden in
<xs:annotation><xs:documentation>, ie.

<xs:attribute name="Typ" use="required">
<xs:documentation source="list">15</xs:documentation>
<xs:documentation source="rule">R39, R40</xs:documentation>
<xs:restriction base="xs:string">
<xs:length value="1" />

Meaning of this rules is given in words:

R39 - IF /SAD/Zgloszenie/Rodzaj/@PodTyp = "C" THEN
/SAD/Zgloszenie/Rodzaj/@Typ ="H"
R40 - IF /SAD/Zgloszenie/Rodzaj/@PodTyp = "D" THEN
/SAD/Zgloszenie/Rodzaj/@Typ ="A"

Obviously there are much more complicated cases.

Validation of every rule will be implemented as function.

I don't know how to trigger validation (call functions) against this
additional rules.
Should I at the begining find all rules and go through the DOM and
validate them one by one? Maybe there is another, better solution?

What kind of parser would be better, SAX or DOM?

I'm using Xerces.

Please give me some hits.


All times are GMT. The time now is 05:47 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.