Re: [digester] Can rules be re-used?

2005-01-19 Thread Bill Keese
I see. Although an XML file containing rules is clearly read-only (thus corresponding to the traditional english-language meaning of "rule"), I guess the "Rule" class is more like a "tag processor", or something like that. Well, it would be easy to write Rule classes if Digester

Re: [digester] Can rules be re-used?

2005-01-18 Thread Bill Keese
...if separate Digester objects being used by separate threads share Rule objects, then all Rule objects would need to be thread-safe. Since rules are read-only objects, aren't they naturally thread-safe? I know that theoretically read-only objects could be

Re: [digester] Can rules be re-used?

2005-01-18 Thread Bill Keese
But Rules aren't "read-only" objects. They are objects whose begin, body and end methods perform real work... CallMethodRule: modifies "bodyText" member. ... Simon Ah, I see. But then what if a Rule matches recursively? Ie, foo hello world foo other

Re: [digester] Can rules be re-used?

2005-01-16 Thread Bill Keese
Also see #1.3 on the FAQ http://wiki.apache.org/jakarta-commons/Digester/FAQ Bill Wendy Smoak wrote: Can rules be re-used or is this likely to cause problems? Rule rule = new SetNestedPropertiesRule(); rule.setAllowUnknownChildElements( true ); digester.addRule( download/person,

Re: [digester] Can rules be re-used?

2005-01-16 Thread Bill Keese
Try */? as a pattern; that's what worked for me. Wendy Smoak wrote: From: Craig McClanahan [EMAIL PROTECTED] Wild cards in Digester are prefix matches, not regular expressions. So, you'll need to add a rule (you can reuse the same instance) for each tail element that you are processing:

Re: Digester simple, simple question

2004-12-15 Thread Bill Keese
[mailto:[EMAIL PROTECTED] Sent: 14 December 2004 09:44 To: Jakarta Commons Users List Subject: Re: Digester simple, simple question IMO the problem is related again with the stack. try ... Bill Keese wrote: This looks OK to me; I'm not sure why it's failing. What happens? Does it create

Re: Digester simple, simple question

2004-12-13 Thread Bill Keese
This looks OK to me; I'm not sure why it's failing. What happens? Does it create an ArrayList but no objects are added to it? You should probably turn on tracing to figure out what is happening. Vinicius Caldeira Carvalho wrote: Hi there! I'd like a little help with diggester. I tried the

Re: [Digester] basic usage problem. Help me understand the stack.

2004-07-26 Thread Bill Keese
it does not seem to me the "*/part" type of pattern will work. this approach does not keep the correspondence between a part strucuture and its parent container(s). I might be wrong, but I think that this is just a simple misunderstanding. Apparently, you are thinking

Re: [Launcher] release 1.0

2004-07-25 Thread Bill Keese
This looks kind of interesting. But, why catalina.sh is (the tomcat startup script) is still 4 pages long? I would hope you could reduce the size, ideally down to a single line. On a related note, does the launch tool provide assistance with the user passing command line parameters to the

Re: [digester] parsing xmlrpc message

2004-07-22 Thread Bill Keese
I think what Simon said explains exactly how to do it. I would only add one thing. There's a common misunderstanding people have when learning Digester, and I wonder if you are making that mistake. People think: "When I call addCreateObject(), it scans the input XML for a tag

[digester] Re: parsing xmlrpc message

2004-07-21 Thread Bill Keese
My difficulty is that I believe I need some kind of recursive pattern-matching capability in order to properly handle the general case. Like Robert said, you may have to use ExtendedBaseRules (http://jakarta.apache.org/commons/digester/apidocs/org/apache/commons/digester/ExtendedBaseRules.html)

[digester] Re: parsing xmlrpc message

2004-07-21 Thread Bill Keese
Simon beat me to the answer to your question by 3 minutes :-) The Digester method I can imagine helping with this involves the use of the NodeCreateRule class... Digester's stack now being out of sync Like the previous responses implied , I don't think you need or want to use the NodeCreateRule

Re: [Digester] Create an object using parent attribute

2004-06-24 Thread Bill Keese
I'm trying to figure out how I can create an [child] object using a parent attribute value as the className for the child. Here's a sample XML snipet: parent childClass=mypackage.childClass child attribute1=value1 attribute2=value2/ child attribute1=value3 attribute2=value4/ /parent I

Re: [Digester] Create an object using parent attribute

2004-06-24 Thread Bill Keese
parent childClass=mypackage.childClass child attribute1=value1 attribute2=value2/ child attribute1=value3 attribute2=value4/ /parent digester.addObjectCreate(parent, mypackage.parentClass); digester.addSetProperties(parent); Did I misunderstand the meaning of the

Re: [Digester] Create an object using parent attribute

2004-06-24 Thread Bill Keese
How about this?? public class ChildCreationFactory implements ObjectCreationFactory { public Object createObject(Attributes x) { ParentClass parent = (ParentClass) digester.peek(); String childClassName = parent.getChildClassName(); // create instance of child class and return it

Re: [digester] reading embedded HTML (or other mixed text)

2004-05-23 Thread Bill Keese
HTML is not valid XML...you could wrap your HTML in CDATA tags in the input document...Alternatively, you could use XHTML, which most browsers support. In this case, you could then use NodeCreateRule. Yup, I should have said XHTML. The point was that the content is free-form (arbitrary levels of

[digester] reading embedded HTML (or other mixed text)

2004-05-20 Thread Bill Keese
Is there any way to tell digester to read in the entire content of an element (including text and sub-elements) as a single String? For example, if I persist e-mail to XML, I'd like to use digester to read the e-mail address list, etc., but the HTML content of the mail should be read verbatim.

Re: [digester] how to use digester with a class hierarchy

2004-05-19 Thread Bill Keese
Adrian Perez Jorge points out that I need to be able to persist the following objects in a non-ambiguous way: class Text extends Component { String text; } class Label extends Component { String text; } I see your point. Maybe when I persist a class from a class hierarchy, I should make an

[digester] how to use digester with a class hierarchy

2004-05-18 Thread Bill Keese
I'm curious how people use digester to persist class hierachies. Consider the class hiearchy below (that represent graphical objects). class Component { int x,y; } class TextString extends Component { String text; } class Rectangle extends Component { int width, height; } There are two ways

Re: [digester] how to use digester with a class hierarchy

2004-05-18 Thread Bill Keese
Thanks Simon! All the existing Digester object creation options (ObjectCreateRule, FactoryCreateRule) create the target object when the opening xml tag is found. I see. In that case, I need to create the Text object when the text tag is encountered. The question is, how do I save the

Re: Jelly: Accessing an xml database with jelly

2003-11-24 Thread Bill Keese
Is there something already done to access an XML Database like exist or xindice with jelly. I guess the interface you are talking about is http://www.xmldb.org/xapi/index.html ? I've wrote tags in Jelly to talk to Tamino (a commercial XML database). Tamino doesn't

Re: [Jelly] xml:forEach, core:forEach and varStatus?

2003-11-11 Thread Bill Keese
I suspect you can use position() but I haven't tried it. xml:expr select=position()/ Marcus Crafter wrote: Hi All, Hope all is well. Was just wondering, one of the differences between the core:forEach tag and the xml:forEach tag as far as 'for-loop' functionality goes, is the 'varStatus'

[jelly] 1.0-beta-4-SNAPSHOT

2003-10-28 Thread Bill Keese
The home page for jelly says 1.0-beta-4-SNAPSHOT, but the download page only has 1.0 beta 3. What's up? Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [jelly] How to post XML with Unicode characters?

2003-08-19 Thread Bill Keese
Sean W. Ferguson wrote: Although if I set the encoding to UTF-8 in the jelly xml file, it cannot parse the xml document. I have to set it to ISO-8859-1 for it to parse the document. Bill Keese wrote: You could try doing everything as UTF-8 rather than ISO-8859-1. Since UTF-8 is the default

Re: [jelly] How to post XML with Unicode characters?

2003-08-18 Thread Bill Keese
You could try doing everything as UTF-8 rather than ISO-8859-1. Since UTF-8 is the default encoding for XML files, you don't need a ?xml version=1.0 encoding=ISO-8859-1? header. Not sure if that would solve your problem or not. Bill Sean W. Ferguson wrote: I am trying to post some XML that

Re: [jelly] bringing a jelly::core variable into an jelly::xml xpath

2003-08-17 Thread Bill Keese
Paul, I'm having trouble understanding your suggestion. Are you suggesting that the following should work? xml:set var=input select=$groups//[EMAIL PROTECTED]'${userEnteredExpression}']/@desc/ (and also the following should work) xml:set var=input select=${userEnteredExpression} / I think I

Re: [JELLY]Cookbook Examples?

2003-07-15 Thread Bill Keese
Peter, Paul, and Andy, Are you interested in adding general documentation (outside of cookbook examples)? I've attached a few notes I wrote on variables and writing custom tags in Jelly script. Bill Paul Libbrecht wrote: Peter Royal wrote: On Wednesday, July 9, 2003, at 05:05 PM, Andy

Re: Parsing jelly:http results with jelly:html

2003-07-14 Thread Bill Keese
HTTP tags are working for me but I am saving the output to a variable. http:get url=... var=outVar/ Looking at the code, unfortunately, this seems to be necessary. Note that outVar is a HTTPMethod class (see

Re: Jelly/o:XML

2003-06-19 Thread Bill Keese
o:XML seems to do alot of what Jelly does and ... Wow, there are a million different XML scripting languages out there, apparently. Thanks for the pointer on this language. Reading the manual of o:XML (http://www.o-xml.org/objectbox/), it seems pretty cool. It is written in

Re: [Jelly] Problem using / or div and % or mod...

2003-06-18 Thread Bill Keese
Christian Beer wrote: I tried using /, div, % and mod but none of it seems to work. Looks like a bug. The jexl code specifies the division character as /. Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Jelly Status

2003-06-18 Thread Bill Keese
I'd like to know whether there is still a serious ongoing development effort in Jelly. Unfortunately I have the same concerns; I submitted some patches to commons-dev mailing list weeks ago without any response (yet), which is even scarier. Same thing with some other people that

[jelly] namespaces swallowed

2003-06-10 Thread Bill Keese
Jelly seems to swallow up namespace references. For example, in the following program, the "ino:" is dropped from the output. Any workaround or fix to this problem? Program: j:jelly xmlns:j="jelly:core" xmlns:ino="http://namespaces.softwareag.com/tamino/response2"

Re: [Jelly] Modularization: To Return A Non XMLOutput/String Object

2003-06-09 Thread Bill Keese
the advantage of being transparent to such things as iteration type of parents. I am not sure it would work within an imported tag though... that would interest me! Paul Bill Keese wrote: Note that things are a little different depending on if your functions are written in java or in jelly

Re: [Jelly] Modularization: To Return A Non XMLOutput/StringObject

2003-06-09 Thread Bill Keese
Ah, I see. The child function returns an output value w/a statement like this: j:set var=myOutputVar1 scope=parent value=myOutputValue/ Cool. Bill -- j:jelly xmlns:j=jelly:core xmlns:define=jelly:define xmlns:myTagLib=myTagLib define:taglib uri=myTagLib

Re: [Jelly] Modularization: To Return A Non XMLOutput/String Object

2003-06-08 Thread Bill Keese
Here are some notes from my experiences with return values in Jelly. The way it is done into such things as jelly-swing is that the tag climbs the hierarchy to the first possible ancestor tag that can receive a result and adds it there. Note that things are a little different depending on if