tags:

views:

32

answers:

2

Hi,

in an application I'm using a config-file in which i'd like also to use '&&'.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<use-case id="customer">
    <precondition evaluate="!empty customer && !empty product" />
    <menu-item id="customer" label="Kunde" />
</use-case>

With this code I'm getting an validation error owing to the '&&' ...

Is there any solution to express this?

THX

A: 

Being able to shove almost any old rubbish into an XML file is a job for CDATA, something like:

<precondition name="evaluate">
    <![CDATA[!empty customer && !empty product]]>
</precondition>

Then you don't have to worry about anything other than the ]] possibility.

paxdiablo
+2  A: 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<use-case id="customer">
    <precondition evaluate="!empty customer &amp;&amp; !empty product" />
    <menu-item id="customer" label="Kunde" />
</use-case>
Willi