Hi,
I am trying to use the new rule package instead of writing an XSLT and
call a java class. It seemed so much easier to use the rule in dom4j,
notice that I said seemed. It probably is my fault but I can't get it to
work.

I am trying to insert one document into another at a spcific location in
the second document. The first file is based on information from the node
that the rule finds.

....
Rule rule = new Rule();
rule.setPattern(DocumentHelper.createPattern( "module:*" ));
rule.setAction(new ModuleAction(request, response));
stylesheet.addRule(rule);
....
class ModuleAction implements Action {

  public void run(Node node) throws Exception {

    Document document = DocumentHelper.parseText( some file );

    Element parent = node.getParent();

    List content = parent.content(); <--- Exception cause the parent is null.
    content.add( parent.indexOf( node ), document.getRootElement() );
  }
}
....

The core of my problem is that I can't get the parent, it always is null
no matter what I do. And without that I am a little bit stuck.
Anybody have any suggestions? Anywhere I can read on how to do it?

// Jens


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to