That is exactly the case, thanks.
-----Original Message-----
From: Robert Lowe [mailto:rmlowe_at_rmlowe.com]
Sent: Thursday, October 16, 2003 4:38 PM
To: users_at_jaxb.dev.java.net
Subject: RE: xmlns="" in direct child element.
I believe it depends on your schema, and specifically the elementFormDefault
attribute of the schema element.
If the attribute takes the value "unqualified", or if the attribute is not
present, then nested elements do *not* inherit the namespace from their
parents, but are in the "namespace with no name" (I'm sure there's a more
technical term :) ). So declaring the namespace as xmlns="" on child
elements is correct behavior in this case.
If the attribute takes the value "qualified" then nested elements inherit
the namespace from their parents, in which case the xmlns="" declarations
hsould *not* be present.
So, try adding elementFormDefault="qualified" to your schema declaration,
run xjc again and see if that gives the behavior you want.
- Rob
-----Original Message-----
From: Tang, Harry [mailto:Harry.Tang_at_BELLSOUTH.COM]
Sent: Friday, October 17, 2003 2:38 AM
To: users_at_jaxb.dev.java.net
Subject: xmlns="" in direct child element.
Hi,
I am using jaxb 1.0.1 in jwsdp1.2 package. When I marshal xml message, I
always got the xmlns="" in the direct child element(s) of the root element
(and only for these first level sub elements). While xmlns value for the
root element is same as defined in the schema. Can anyone help me to
understand this and is there some way I can get rid of the 'xmlns=""'
stuff.
Thanks for any help in advance.
here is the example below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TRANSACTION TRANNAME="TRANSACTION" xmlns="
http://www.myxmlnsdefinition">
<NAME xmlns="">ASSGN_SCAN_OPER</NAME>
<VERSION xmlns="">1</VERSION>
<RECORD RECNAME="REQUEST_DATA" xmlns="">
<CKT_ID>S 50/QQQQ/44440000/SC</CKT_ID>
<TKT_ID>
<TKTTypeId>10</TKTTypeId>
<TKTTypeValue>tksValue</TKTTypeValue>
</TKT_ID>
</RECORD>
</TRANSACTION>
harry
*****
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 113
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net
*****
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers.60"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net