Re: [xmlc] Adding xhtml code in string form

Erik Rasmussen <[email protected]> Mon, 5 Sep 2005 06:05:42 -0700 (PDT)
Newsgroups gmane.comp.java.enhydra.xmlc
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1125925578-18658-154
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hmm...  I found this thread here.
http://mail-archive.objectweb.org/xmlc/2004-09/msg00000.html

Unless it's been fixed in the past year, it looks like
I'll have to do a horrible CDATA filtering hack like
Petr did.  :-(

Erik

--- Erik Rasmussen <[email protected]> wrote:

> Fine, but that's not the behavior I'm seeing.
> 
> my xhtml file:
> ---
> <span id="features">features here</span>
> ---
> 
> my java code:
> ---
> final Text textNode = XMLCUtil.findFirstText(node);
> if(string.indexOf("</") > 0)
> {
> 	// contains xhtml markup
> 	final CDATASection cdata =
> page.createCDATASection(string);
> 	if(textNode == null)
> 	{
> 		node.appendChild(cdata);
> 	}
> 	else
> 	{
> 		node.removeChild(textNode);
> 		node.appendChild(cdata);
> 	}
> }
> else if(textNode != null)
> {
> 	textNode.setData(string);
> }
> else
> {
> 	node.appendChild(page.createTextNode(string));
> }
> ---
> 
> the result:
> ---
> <span id="features"><![CDATA[<ul><li>Holds stuff
> together</li><li>Detects garden
> gnomes</li><li>Repels
> vampires</li><li>Traps anti-matter for up to 4
> seconds</li></ul>]]></span>
> ---
> 
> So I have to say that I don't really believe you. 
> Unless there really is a setCDATA() function
> somewhere
> that I'm missing.  I followed what they did in the
> link you sent, though.
> 
> Any other suggestions?
> Erik
> 
> --- David Li <[email protected]> wrote:
> 
> > XMLC doesn't really put CDATA in a setCDATA call.
> > It's simple insert  
> > raw string.
> > 
> > David
> 
> 
> 
> 	
> 		
>
______________________________________________________
> Click here to donate to the Hurricane Katrina relief
> effort.
> http://store.yahoo.com/redcross-donate3/
> 
> > 
> --
> You receive this message as a subscriber of the
> [email protected] mailing list.
> To unsubscribe:
> mailto:[email protected]
> For general help:
> mailto:[email protected]?subject=help
> ObjectWeb mailing lists service home page:
> http://www.objectweb.org/wws
> 



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/


------------=_1125925578-18658-154
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit


--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

------------=_1125925578-18658-154--