What will XML parsers do if my text contains </mytag>?

K

Kelvin

Hi, there:

My question is, what if my text contains the tag in square bracket itself?
What will MSXML30.dll do with such situation?
Do I have to filter out these stuff before I save the XML file itself?

Kelvin
 
R

Rolf Magnus

Kelvin said:
Hi, there:

My question is, what if my text contains the tag in square bracket
itself? What will MSXML30.dll do with such situation?
Do I have to filter out these stuff before I save the XML file itself?

I have no idea what you're talking about. Could you elaborate? Anyway,
an XML parser should only accept well-formed XML documents.
 
M

Martin Honnen

Kelvin wrote:

My question is, what if my text contains the tag in square bracket itself?

Well if that relates to the example in the subject line if you have
</mytag>
in your XML document then any XML parser parsing this will see that as a
closing tag and will throw an error if there is no preceding properly
nested opening said:
Do I have to filter out these stuff before I save the XML file itself?

It depends whether </mytag> is indeed intended to be XML markup or just
character data, if character data you need to escape it e.g.
&lt;/mytag&gt;
or use a CDATA section
<![CDATA[</mytag>]]>
 
K

Kelvin

I see. Thank you.

Kelvin





Martin Honnen said:
Kelvin wrote:

My question is, what if my text contains the tag in square bracket
itself?

Well if that relates to the example in the subject line if you have
</mytag>
in your XML document then any XML parser parsing this will see that as a
closing tag and will throw an error if there is no preceding properly
nested opening said:
Do I have to filter out these stuff before I save the XML file itself?

It depends whether </mytag> is indeed intended to be XML markup or just
character data, if character data you need to escape it e.g.
&lt;/mytag&gt;
or use a CDATA section
<![CDATA[</mytag>]]>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top