Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] talking about new features

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: luca <passani AT eunet.no>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] talking about new features
  • Date: Sat, 08 Jan 2005 08:16:40 +0100


Elliotte, since you are asking about new features, here
is a more low-level idea, but one that would really come handy for
me. Why not add a functionality that makes XOM
render XML as colored HTML?

for example, if you have:

<greeting value="friend">Hello</greeting>

it would be nice to have something like this:

doc.toHTML();

that returns:

&lt;<span class="green">greeting</span>
<span class="red">value</span>="friend"&gt;Hello
&lt;/<span class="green">greeting</span>&gt;

How to decide the colors? maybe a strategy pattern of some kind.

HashMap elemcolors = new HashMap();
elemcolors.add("greeting","green");
HashMap attrcolors = new HashMap();
attrcolors.add("value","red");
doc.toHTML(elemcolors,attrcolors);

for good measure, you might throw in a feature that lets one choose
if the want to use CSS or the FONT tag.

It would help me visualizing WURFL snippets in web-based admin tools
and I am sure other developers might find it useful when they least expect it.

Thank you

Luca

PS: why don't you get rid of the XHTML mime type?
it bugs me that I can't browse www.xom.nu with internet explorer.
text/html is the standard, man. At least provide an alternative version!







Archive powered by MHonArc 2.6.24.

Top of Page