This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > December 2005 > Re: ways to deal with conditionals on attribute value?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: ways to deal with conditionals on attribute value?
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.
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews