I try to write Apache digester parsing rules in xml file (xmlrules). But I don't see something like PluginCreateRule in digester-rules.dtd. The question is: (How) Can I declare and reference plugin in a xml rule file?
declare plugin with digester xmlrules
97 Views Asked by Tianwei Chen At
1
There are 1 best solutions below
Related Questions in APACHE-COMMONS-DIGESTER
- Digester Parsing not adding bean to the main Bean
- Is there a way to add all the values of a key in the Arraylist from xml using Apache Commons Digester?
- How can I call a method with popped object using commons-digester?
- Alternate for DigesterLoader.createDigester(url) in digester3
- Apache Digester XML parser annotations and composite model
- apache digester sax parser exception
- Using Apache Commons Digester with JSON
- Retrieve namespace value of XML using digester
- Apache Digester XML roule to invoke a custom setter on a bean
- How do you ignore an element with Apache Digester?
- Java - Apache commons Digester - write xml
- How can I parse only the 1st element from a repetitive elements in a XML using commons-digester?
- android with commons-digester java.lang.UnsupportedOperationException: This parser does not support specification "Unknown" version "0.0"
- declare plugin with digester xmlrules
- Application works fine in weblogic 10.3.5 but gives following errors in weblogic 10.3.0:
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you're out of luck here.
As you've seen, there is no
plugin-create-rulein the DTD file. Also, Digester uses itself to parse the XML rules, and there is no mention of theplugin-create-rulein the digester configuration itself.Looking at that code, it would seem pretty straight forward to add that rule, so I'm not sure if it has been left out just because no-one has gotten around to adding it, or because there are some problems with the implementation which are not immediately obvious.
I would have a go at a patch to implement this, but there appears to be little activity in Digester development these days...
Update
Yep - seems fairly simple to create a basic implementation which supports this:
binder/PluginCreateRuleBuilderto support creation by class name not just class instance (just copied code fromObjectCreateBuilder).xmlrules/PluginCreateRuleclass (again, based onObjectCreateRulewith most of it thrown away).XmlRulesModule.Full patch file here.
Tested using the example from the Digester Plugin doco with the following XML
Note that this is only a basic proof-of-concept, but should give you something to work on if you want to go that way. Also, there are a bunch more options for creating plugins which are not covered by this and would be required for a complete solution, so this patch is not (in its current state) suitable for submission back to the Digester project.
Update 2
To call this, you need to pass a
PluginRulesinstance to the loader when creating a digester:Cheers,