« Return to Thread: Sending XML containing html tags

Re: Sending XML containing html tags

by MIYAKO :: Rate this Message:

Reply to Author | View in Thread

Hello,

the whole point of xml is that it contains data elements only,
as opposed to conventional html which has data and style.

XSLT is supposed to be the solution to convert xml into html.

alternatively, you could create small methods (method name "span", for  
example),
to be called within the context of constructing the xml,
which given a DOM reference and value would insert a span tag.

but, yes, there are cases where you would like to insert a piece of xml
within a parent xml, which seems to be beyond the capabilities of DOM  
commands.

incidentally the SAX ADD XML ELEMENT VALUE has been enhanced in v11 to
accept an * to directly handle escape characters.

miyako

On 2008/05/14, at 0:34, Rafael Escote wrote:

> Dear folks, i'm trying to build a correct AJAX (using RICO js libs)
> response from 4D, so i'm building an
> XML document using the DOM commands and sending it via
> SEND HTML BLOB.
> However I've found that if the response text includes
> some tags to format the html page
> the result is not the one desired. For example:
>
> // Test response
> $answer:="<span>Testing</span>"
>
> $myxml:=DOM Create XML Ref("ajax-response")
>
> DOM SET XML OPTIONS($myxml;"ISO-8859-1")
>
> $elem:=DOM Create XML element($myxml;"/ajax-response/
> response";"type";"element";"id";"myObject")
>
> DOM SET XML ELEMENT VALUE($elem;$answer)
> DOM EXPORT TO VAR($myxml;$result)
> DOM CLOSE XML($myxml)
> ...
> SEND HTML BLOB($result;"text/xml")
>
> The sent text is always translating the tag <span> into
> somthing like:
> <span>Pepe</span>
>
> Being an XML, BLOB ignorant I'm not sure what i'm doing wrong...
> Any help?
> TIA
> --
> Rafael Escoté
> BlauSoft s.l.

**********************************************************************
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