Hello
I'm Validating an XML object using code similar to the following:
<cfset daOb = xmlParse("ca2.xml")>
<cfset myResults=XMLValidate(daOb, "ca2_generated.xsd")>
Regarding the XSD and errors generated, I notice that if I violate a
restriction as per below ( say I specify 'THATShipper' vs. 'ThisShipper' I will
get a generalised message ( such as : "[Error] :2:23: cvc-elt.1: Cannot find
the declaration of element 'ArrayOfPurchaseOrder'" ) ( ArrayOfPurchase order is
the parent XML element ). rather than anything useful pertaining to the
specific item that was violated ( ie - line number, element number or anything
else for that matter. It seem to simply refer to the parent XML element (
ArrayOfPurchaseOrder ).
<xs:element name="ShipMethod">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ThisShipper"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Is there anything I could do at the Schema/XSD level to assure that I can get
meaningful feedback as to what was violated?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331031
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4