Hello,
first my sincere compliments for the framework that I find really useful :-)
I'm writing to you because I'm into trouble. Let me explain the problem:
I'm in need, for my application, to have a custom tag named <services />
into an XML template. This tag must be mapped to multiple listitems of a list . The number of these items and the items' content of this list are unknown until runtime.
Using the XmlPeer to map the <services /> tag to a ElementTags.LIST does not work. But if I include the tag <services /> in a <list...> tag in my template it works fine, but works only for one ElementTags.LISTITEM.
example:
for(int i = 0; i < 5; i++){
peer = new XmlPeer(ElementTags.LISTITEM,"services");
peer.addValue(ElementTags.FONT,"Verdana");
peer.addValue(ElementTags.SIZE,"7");
peer.addValue(ElementTags.INDENTATIONLEFT,"10");
peer.setContent("Service"+i);
tagmap.put(peer.getAlias(),peer);
peer = new XmlPeer(ElementTags.LISTITEM,"services");
peer.addValue(ElementTags.FONT,"Verdana");
peer.addValue(ElementTags.SIZE,"7");
peer.addValue(ElementTags.INDENTATIONLEFT,"10");
peer.setContent("Service"+i);
tagmap.put(peer.getAlias(),peer);
}
produces only one item "1. Services4".... that's correct indeed for the alias is always "services".... but I think the framework does not offer the opportunity of creating multiple runtime listitems for a list starting from a single custom tag in a template.
Is there a workaround for this problem? Or could it be enough to implement my own SAX handler to achive my target?
Please, help I'm in trouble
Fabio.
Yahoo! Companion - Scarica gratis la toolbar di Ricerca di Yahoo!
