Hi all,
Because I want my marshalled Node to contain a certain namespace I added
the xmlns="
http://www.mycomp.com/user" attribute to my schema
declaration. However as you can see in the output of my serialized
document the user-root element contains only the namespace declaration
"". Can someone please tell me what's causing this?
My schema:
<xsd:schema xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns="
http://www.mycomp.com/user">
<xsd:element name="user">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="email" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="ip" type="xsd:string"/>
<xsd:element name="host" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="companyName" type="xsd:string"/>
<xsd:element name="companyAddress" type="xsd:string"/>
<xsd:element name="companyCity" type="xsd:string"/>
<xsd:element name="companyState" type="xsd:string"/>
<xsd:element name="companyZip" type="xsd:string"/>
<xsd:element name="companyCountry" type="xsd:string"/>
<xsd:element name="companyTelephone" type="xsd:string"/>
<xsd:element name="companyFax" type="xsd:string"/>
<xsd:element name="companyURI" type="xsd:string"/>
<xsd:element name="comments" type="xsd:string"/>
<xsd:element name="industries" type="xsd:string"/>
<xsd:element name="relation" type="xsd:string"/>
<xsd:element name="size" type="xsd:string"/>
<xsd:element name="project" type="xsd:string"/>
<xsd:element name="timeframe" type="xsd:string"/>
<xsd:element name="os" type="xsd:string"/>
<xsd:element name="source" type="xsd:string"/>
<xsd:element name="updateNews" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Serialized document:
<?xml version="1.0"?>
<user xmlns="">
<email>jeroenb_at_x-hive.com</email>
<password>gkM91HXEH</password>
<ip>127.0.0.1</ip>
<host>127.0.0.1</host>
<name>ewfef</name>
<title>feewffe</title>
<companyName>klk</companyName>
<companyAddress>kl</companyAddress>
<companyCity>kl</companyCity>
<companyState>k</companyState>
<companyZip/>
<companyCountry/>
<companyTelephone/>
<companyFax/>
<companyURI/>
<comments/>
<industries/>
<relation/>
<size/>
<project/>
<timeframe/>
<os/>
<source/>
<updateNews/>
</user>
Thanks and regards,
Jeroen
--
X-Hive Corporation
e-mail: jeroenb_at_x-hive.com
phone: +31 10 2818080
http://www.x-hive.com