| Zafar Abbas 2005-12-30, 6:37 pm |
| You will have to write application code on top of XSD validation to process
pass/fail values of the status attribute.
You could also consider using Schematron in this situtation. XSD does not
provide any help here.
<Piper707@hotmail.com> wrote in message
news:1135923623.771005.132830@g44g2000cwa.googlegroups.com...
> Hi,
>
> I need to generate an XML file for the result which differs based on
> the value of a "status" attribute.
>
> i.e for an error condition it would look something like this:
>
> <result status="failure">
> <errorBlock>
> </result>
>
> a success condition (an empty result block):
>
> <result status="success">
> </result>
>
> I understand that XSD does not support conditional processing based on
> the value of an attribute.
>
> One way would be to have a tag called "failure" or "success" itself in
> the body of the <result>, but then having an empty element seems
> wasteful. I would like to have an atribute to do the same thing.
>
> How does one deal with situations like these?
>
> Thanks fo any help
> Rohit.
>
|