Marshalling and Namespaces in XML

View: New views
2 Messages — Rating Filter:   Alert me  

Marshalling and Namespaces in XML

by Mahen Perera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

HI all,

 

I have a situation where in the marshalled XML all elements and attributes should belong to a particular namespace. However, there is this one attribute which will not belong to any namespace, hence basically no prefix specified in the marshalled output for it.

Does anyone know how I can write the binding .xml in order to get such a behaviour.

 

Cheers

 

 

The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc.) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Index plc is a company registered in England and Wales under number 01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the Financial Services Authority. FSA Register number 114059.

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

Re: Marshalling and Namespaces in XML

by DSosnoski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

(resending after sf.net email problems)

Hi Mahen,

That's an unfortunately ugly case to handle. It's easy to make all the
elements and attributes use a particular namespace, by just defining the
namespace with default="all". Excluding one attribute from this is the
problem.

The best I can suggest is to instead define the namespace with
default="elements", and then specify the namespace directly on each
attribute <value> element by using the ns="..." attribute (which needs
to give the namespace URI, not the prefix).

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Mahen Perera wrote:

>
> HI all,
>
>  
>
> I have a situation where in the marshalled XML *all* elements and
> attributes should belong to a particular namespace. However, there is
> this one attribute which will not belong to any namespace, hence
> basically no prefix specified in the marshalled output for it.
>
> Does anyone know how I can write the binding .xml in order to get such
> a behaviour.
>
>  
>
> Cheers
>
>  
>
>  
>
> The information contained in this email is strictly confidential and
> for the use of the addressee only, unless otherwise indicated. If you
> are not the intended recipient, please do not read, copy, use or
> disclose to others this message or any attachment. Please also notify
> the sender by replying to this email or by telephone (+44 (0)20 7896
> 0011) and then delete the email and any copies of it. Opinions,
> conclusions (etc.) that do not relate to the official business of this
> company shall be understood as neither given nor endorsed by it. IG
> Index plc is a company registered in England and Wales under number
> 01190902. VAT registration number 761 2978 07. Registered Office:
> Friars House, 157-168 Blackfriars Road, London SE1 8EZ. Authorised and
> regulated by the Financial Services Authority. FSA Register number 114059.
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> 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@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  


-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/jibx-users
LightInTheBox - Buy quality products at wholesale price!