L
Leila
Hi,
I am having a problem retrieving the html tags from my XML document
when it's being loaded into a DOM object.
For example, my xml contains the following:
<my:InsideView>
..
..
..
<my:Body>
<b>Guess what happened today?</b>
<p>This is example text</p>
<p>I want to select all content within the body tags but the html tags
are also getting interpreted as xml tags!</p>
</my:Body>
..
..
..
</my:InsideView>
My javascript function is as follows
..
..
..
strTemp = "";
xmlObj = (xmlDocs.selectNodes("//my:InsideView//my:Body"));
strTemp = xmlObj.item(0).text;
if (strTemp.length > 0) {
document.all.mainText.innerHTML = strTemp;
} else {
document.all.mainText.innerHTML = "";
}
..
..
..
The problem though, is that when the content is displayed in the <div>
tag, all the HTML <b> and <p> tags within <my:Body> have been
interpreted as xml and not reflected in my <div>
Is there a way to select the <my:Body> node in Javascript and tell it
to ignore any other tags within <my:Body> - in affect using a CDATA
type function???
Any suggestions would be most appreciated!!
I am having a problem retrieving the html tags from my XML document
when it's being loaded into a DOM object.
For example, my xml contains the following:
<my:InsideView>
..
..
..
<my:Body>
<b>Guess what happened today?</b>
<p>This is example text</p>
<p>I want to select all content within the body tags but the html tags
are also getting interpreted as xml tags!</p>
</my:Body>
..
..
..
</my:InsideView>
My javascript function is as follows
..
..
..
strTemp = "";
xmlObj = (xmlDocs.selectNodes("//my:InsideView//my:Body"));
strTemp = xmlObj.item(0).text;
if (strTemp.length > 0) {
document.all.mainText.innerHTML = strTemp;
} else {
document.all.mainText.innerHTML = "";
}
..
..
..
The problem though, is that when the content is displayed in the <div>
tag, all the HTML <b> and <p> tags within <my:Body> have been
interpreted as xml and not reflected in my <div>
Is there a way to select the <my:Body> node in Javascript and tell it
to ignore any other tags within <my:Body> - in affect using a CDATA
type function???
Any suggestions would be most appreciated!!