Pass HTMLpage code for XML DOM Parsing

K

Kabindra

hello guys,

I have been doing some ajax based works.

For my works I have my basic HTML pages [parent] calling next HTML
pages [child] using ajax. Since my child pages also contains form
controls, I have been using XML Parser first to parse the child page
code and create respective DOM output in parent page.

Everything worked fine but my problem arouse while using & symbol and
other basic symbols. So in confusion how to resolve that.

My steps for my page processing:
1.) opening of parent page
2.) call js function
a.) init ajax
b.) call child page
c.) call response handler
3) response handler
a.) feed resposne to XML parser
b.) create DOM elements in parent page.

Error occurs only if special XML charecters are present in child page
 
M

Martin Honnen

Kabindra said:
My steps for my page processing:
1.) opening of parent page
2.) call js function
a.) init ajax
b.) call child page
c.) call response handler
3) response handler
a.) feed resposne to XML parser
b.) create DOM elements in parent page.

Error occurs only if special XML charecters are present in child page

If you want to use an XML parser then your markup has to comply with XML
rules. If your markup is HTML tag soup and not well-formed XML then you
are better off to feed it to the HTML tag soup parser (i.e. set
innerHTML of a HTML DOM element or use methods like insertAdjacentHTML).
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top