I want to create an XML file which will be used to store the structure of a Java program. I am able to successfully parse the Java program and create the tags as required. T
In XML attributes you must escape
" with "
< with <
& with &
if you wrap attribute values in double quotes ("
), e.g.
meaning tag MyTag
with attribute attr
with text If a - note: no need to use
'
to escape '
character.
If you wrap attribute values in single quotes ('
) then you should escape these characters:
' with '
< with <
& with &
and you can write "
as is.
Escaping of >
with >
in attribute text is not required, e.g. is well-formed XML.