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

Kelvin (archive)

Usenet Archive
Joined
May 4, 2000
Messages
31
Reaction score
0
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
 

Rolf Magnus

Usenet Archive
Joined
Jun 25, 2003
Messages
3,487
Reaction score
0
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.
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
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>]]>
 

Kelvin (archive)

Usenet Archive
Joined
May 4, 2000
Messages
31
Reaction score
0
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
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top