users@jaxb.java.net

Marshalling from two shemas

From: Lulseged Zerfu <lulseged.zerfu_at_ericsson.com>
Date: Fri, 26 Jun 2009 07:49:59 +0200

Hi
 
 One more question regarding marshalling:
 
My document is made up of two standard schemas: (schemas attached)
 
urn:ietf:params:xml:ns:pres-rules imports
urn:ietf:params:xml:ns:common-policy.
 
There are two ObjectFactory.java class created when compiling with xjc,
one for each schema:
 
Marshalling a java representation of a document made up up of this two
schemas is not working. Complains about
ietf.params.xml.ns.pres.rules.ProvideServicePermission is not known to
this context

When trying to marshall so that the output xml document looks like as
follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<cr:ruleset xmlns="urn:ietf:params:xml:ns:pres-rules"
xmlns:pr="urn:ietf:params:xml:ns:pres-rules"
xmlns:cr="urn:ietf:params:xml:ns:common-policy">
    <cr:rule id="a">
        <cr:conditions>
            <cr:identity>
                <cr:one id="sip:user_at_example.com" />
            </cr:identity>
        </cr:conditions>
        <cr:actions>
            <pr:sub-handling>allow</pr:sub-handling>
        </cr:actions>
        <cr:transformations>
            <pr:provide-services>
                    <pr:service-uri-scheme>sip</pr:service-uri-scheme>
 
<pr:service-uri-scheme>mailto</pr:service-uri-scheme>
                </pr:provide-services>
            <pr:provide-activities>true</pr:provide-activities>
            <pr:provide-user-input>bare</pr:provide-user-input>
        </cr:transformations>
    </cr:rule>
</cr:ruleset>

The red part of this xml document comes from the second schema. But how
do marshall so that this become output.

 

Lulseged