General XMetaL Discussion
pooh2583 February 25, 2013 at 10:59 am
f9/xmetal ValidatorFebruary 25, 2013 at 10:59 amParticipants 0Replies 1Last Activity 9 years, 7 months ago
I have wriiten code in On_Before_Document_Validate,which is used to validate certain attribute values in my xml document,
when F9 is pressed
When one of value is not valid as per my code of validation, error message is shown(defined by me) ,
but after that an alert message of Xmetal comes “In built validator”,which XMetaL says,
“Validation is complete.
document has been validated successfully.”
Is it possible to tell XmetaL that documnent is not valid in On_Before_Document_Validate event?
RegardsDerek Read February 25, 2013 at 6:25 pm
Reply to: f9/xmetal ValidatorFebruary 25, 2013 at 6:25 pm
If you want XMetaL Author (or XMAX) to consider your document invalid (even though it is valid according to the DTD) you will need to add a custom error message(s) to the Validation Log. You cannot do that inside this event. There are two different events provided for this purpose.
If your code adds a message to the Validation Log (inside these two other events) then it will be displayed and the document will be considered invalid.
Please have a look at the Journalist demo. The MCR file is here:
Search for “On_Check_Element_SimpleContent” and “On_Check_Attribute_Value”.
Please also read my other message in response to your earlier question, which sounds almost identical: http://forums.xmetal.com/index.php/topic,2992.0.html.
- You must be logged in to reply to this topic.