Skip to content
RobertTheGrey edited this page Jan 12, 2013 · 1 revision

<else>

Forms a part of an if/elseif/else conditional structure.

<else>anyXml</else>

Results in C#:

else
{
  //anyXml-generated-code
}

Must follow an element that produces an if/elseif statement. Contains material that will be rendered if all preceding conditions are false.

with if=""

<else if="x">anyXml</else>

Results in C#:

else if(x)
{
  //anyXml-generated-code
}

Must follow an element that produces an if/elseif statement. Contains material that will be rendered if all preceding conditions are false, and the expression x evaluates to true.

empty <else/> element

<test if="x">anyXml-1<else if="y"/>anyXml-2<else/>anyXml-3</test>

Results in C#:

if(x)
{
  //anyXml-1-generated-code
}
else if(y)
{
  //anyXml-2-generated-code
}
else 
{
  //anyXml-3-generated-code
}

Must be contained within an <if> or <test> element. The material following an empty <else/> element is treated as if it was contained within that element. If there are multiple <else/> elements all but the last one must have an if="" attribute.