Some more research revealed that there is a makeElement method in the 
DocumentHelper class. It looks like it only supports simple paths made up of 
element names. I needed something that can create attributes as well. It looks 
like no such thing exists.

Muzaffer

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ozakca, Muzaffer
Sent: Friday, August 15, 2008 2:43 PM
To: dom4j-user@lists.sourceforge.net
Subject: [dom4j-user] generate XML using XPath

I read somewhere that Dom4J can generate an XML node or fragment using XPath. I 
am aware that XPath is not primarily designed for such use. But, Can XPath be 
used to create and add nodes to XML. What I’m looking for is like being able to 
specify something like:

“a/b/c” to generate a tree equivalent to:
<a>
            <b>
                        <c></c>
            </b>
</a>

How to do that (without parsing the text of XPath and creating nodes 
programmatically, that is)?

Thanks,
Muzaffer


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to