Hi Tom,

how do create the dom4j object model?

If I try to build your xml document like this, it seems to work fine ...

Document doc = DocumentHelper.createDocument(); Element processDef = doc.addElement("process-definition", "http://jbpm.org/statedefinition-2.0-beta3";);
Element startState = processDef.addElement("start-state");
startState.addAttribute("name", "start");
Element transition = startState.addElement("transition");
transition.addAttribute("to", "first");


   System.out.println(doc.asXML());

regards,
Maarten

Tom Baeyens wrote:

Hi,
I am not able to set the default namespace as i want it while writing an xml document from a dom4j object model.
This is what i want. Watch the *xmlns="..."*. It does not say *xmlns:jbpm="...".*
<?xml version="1.0" encoding="UTF-8"?>
<process-definition *xmlns=*"http://jbpm.org/statedefinition <http://jbpm.org/statedefinition-2.0-beta3>">
<start-state name="start">
<transition to="first"/>
</start-state>
...
<end-state name="end"/>
</process-definition>
When I set the namespace of the process-definition element like this
pde.add( new Namespace(null, "http://jbpm.org/statedefinition <http://jbpm.org/statedefinition-2.0-beta3>") );
all its children get an empty namespace (valid but not what i want)
<start-state xmlns="" name="start">
What am i missing ?
All hints and pointers are appreciated.
Regards,
*Tom Baeyens*
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
jBpm Support Company
Campus Blairon 465
2300 Turnhout
Belgium
+32 14 711 152






-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to