| 20 | |
| 21 | === Attribute <any> in QueryExpression === |
| 22 | |
| 23 | The type !QueryExpression has an attribute <any>, which according to the specification "is extensible and therefor MAY be of any type depending upon the queryLanguage |
| 24 | specified. For SQL queryLanguage it MUST be an SQL query string. For Filter query it MUST be a FilterQueryType defined by [RR-QUERY-XSD]." |
| 25 | |
| 26 | In the XSD it is defined as follows: |
| 27 | |
| 28 | {{{ |
| 29 | <sequence> |
| 30 | <!-- |
| 31 | MAY be any query language syntax supported. |
| 32 | MUST support FilterQuery. SHOULD support SQLQuery |
| 33 | --> |
| 34 | <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="1" /> |
| 35 | </sequence> |
| 36 | }}} |
| 37 | |
| 38 | Now this is interesting from the point of view of the XML Binding. At first, I implemented the any attribute in Java as type "java.lang.Object" but it turns out this is not too easy with JiXB, because it doesn't know how to marshall/unmarshall that type. I could write custom methods for that purpose but then again, neither do I know what might be the actual type at runtime, so any attempt at customs methods would be a guess. |
| 39 | |
| 40 | I have defined it for the time being as follows: the any attribute in Java is of type "java.lang.String" and in the JiBX binding, I defined it as a CDATA value. Meanwhile, if anybody can point me to [RR-QUERY-XSD] which is not dereferenced in the specification, I'll try something better .. |
| 41 | |
| 42 | |
| 43 | ---- |