Re: [xmlc] Adding xhtml code in string form
Erik Rasmussen <[email protected]> Mon, 5 Sep 2005 05:28:19 -0700 (PDT)
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format...
------------=_1125923339-18658-88
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
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/
------------=_1125923339-18658-88
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
------------=_1125923339-18658-88--