« Return to Thread: Sending XML containing html tags

Re: Sending XML containing html tags

by David Dancy :: Rate this Message:

Reply to Author | View in Thread

Rafael

I think that DOM SET XML ELEMENT VALUE is translating the < into <
for you. There's not much you can do about that, because what you're
sending is itself XML.

However, it ought to be possible within javascript (in your method
that accepts the data coming back from the Rico Ajax object) to parse
for < and > (use a regex) and turn them back to < and >
respectively. Then you have to set the .innerHTML (I think) property
of a DOM object in the web page to the value you've been given, and I
think that will work. It's a bit harder, but I think that's necessary
in order to be able to send XML inside XML.

If it's easier, you could use DOM SET XML ELEMENT
VALUE($elem;$answer;*) which puts the $answer text into the CDATA
section of the XML. That might be easier to parse once it gets to the
web page.

An alternative is to set the <span> tag in your HTML with no contents,
give it an ID, and then send back the contents of the span only, then
use javascript to fill in the contents of the span from the result of
the Ajax call. Given the choice, this is the way I'd do it, but I'm
only just learning, so others may have better ideas.

David
**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

 « Return to Thread: Sending XML containing html tags