Hello all,

I have any-section in my xml (I simpified actually my xml), which I map
to org.w3c.dom.Element using org.jibx.extras.DomElementMapper.

  <role>
    <properties>
      <creation-date>2008-10-15T15:08:22.484+02:00</prop:creation-date>
      <name>Ingester</prop:name>
    </properties>
<!--  Any-section
     <Policy PolicyId="Ingester-policy"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorith
m:ordered-permit-overrides"> 
 </Policy>
-->
  </role>


Class Role{

Properties properties;
Org.w3c.dom.Element policy;
;
}


Unmarshalling works fine. But I I get an Exception while marshalling,
If I set a member variable "policy" to the value, which I get by parsing
of a xml file like:

InputStream input =
getClass().getResourceAsStream("policy_for_create.xml");
        
        DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(input);
        Element root = doc.getDocumentElement();
        Role role = new Role();
          Role.setPolicy(root);


java.lang.NullPointerException
        at
org.jibx.runtime.impl.UTF8StreamWriter.writeMarkup(UTF8StreamWriter.java
:96)
        at
org.jibx.runtime.impl.XMLWriterBase.startTagOpen(XMLWriterBase.java:196)
        at
org.jibx.extras.DomMapperBase.marshalElement(DomMapperBase.java:236)
        at
org.jibx.extras.DomElementMapper.marshal(DomElementMapper.java:129)
        at
de.escidoc.core.resources.aa.role.Role.JiBX_eSciDocCoreClient_src_jibx_b
inding_soap_resource_binding_marshal_3_0(Role.java)
        at
de.escidoc.core.resources.aa.role.JiBX_eSciDocCoreClient_src_jibx_bindin
g_soap_resource_bindingRole_access1.marshal()
        at de.escidoc.core.resources.aa.role.Role.marshal(Role.java)
        at
org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.
java:1041)
        at
org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingCont
ext.java:1111)
        at
de.escidoc.core.common.jibx.Marshaller.marshalDocument(Marshaller.java:8
7)


I get the same Exception while marshalling, if I try to set a member
variable "policy"  via:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
                Document doc = builder.newDocument();
        Element element = doc.createElement("Policy");
        Role.setPolicy(element);

Marshalling works fine only If I set a member variable "policy" via 
        Element element = doc.createElementNS(
            null, "Policy");


It is very important for me to have a possibility to set any-content to
the xml-content from an external xml file. 

Thanks for your help.
Rozita


        

-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinR Hermann Riehl.

-------------------------------------------------------------------------
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=/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to