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
...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
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
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,
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:
[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
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
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
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
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
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)
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
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
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
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
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
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.
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
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
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
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
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'
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]
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
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
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
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
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
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
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
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 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"
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
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
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
35 matches
Mail list logo