Forums Register Login
attribute vs. CDATA

I'm new to XML. I cannot decide if I should save information as attributes or as CDATA. Below are the two versions. Which way should I go and why?


attribute version

CDATA version
Hi lajos,
you should go for the first one (the attribute version).

Reason: name and password are attributes of a user.

Only if you are not able to represent in the first method you can go for the second method.

You can go for CDATA under following situations.

<Building name="Build1">
<Floor name="Floor1">
<Cabin name="c1"/>
<Cabin name="c2"/>


<Building name="Build1">
<Floor name="Floor1"/>
<Floor name="Floor2"/>

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 529 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 21, 2018 06:03:34.