XML schema is at http://www.pdc.org/pride/xmlschema/wls.xsd
The marshaled XML is at http://www.pdc.org/pride/ptwc/stations.xml



Specifically I am unclear as to how I may eliminate the empty xmlns="" 
attribute that keeps showing up in the child wls element of the top level 
gauges element.  My choices seem to be suppress the xmlns for everything or 
live with xmlns in everything.  

I don't think you can do something at the XSD level level (or marshalling 
level) to get xmlns at the top level gauges object while suppressing it for 
child objects.  

Or can we?



-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 22, 2007 10:24 PM
To: [email protected]
Subject: AW: [castor-user] Supress Namespaces

If you want namespaces to be used in your XML document (as produced by the 
Marshaller), including namespace declarations (at e.g. the top level element), 
then you must not turn off (i.e. suppress) namespaces.

I have not yet looked at the XML schema as provided by you, but when generating 
Java classes from the XML schema, Castor will create 

a) domain classes
b) descriptor classes that hold information about the mapping between the Java 
classes (domain objects) and the XML artefacts as defined in the XML schema.

In other words, as long as the descriptor classes are available on the 
classpath, you should get e.g. namespaces in your XML document instances as 
defined in your XML schema.

Werner

> -----Ursprüngliche Nachricht-----
> Von: Uday Kari [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 23. März 2007 02:52
> An: [email protected]
> Betreff: [castor-user] Supress Namespaces
> 
> Praveen:  Thanks for the prompt response!  Indeed...it works.
> 
> To clarify, you mean call Marshaller.setSuppressNamespaces(TRUE), not
> false, while marshalling. The only catch is that I wanted namespaces to
> show up in the top-most level element "gauges" but not in any of its
> child elements.  By suppressing namespace, it takes it out for even the
> top most elements...o well, it is a case of cosmetics anyway.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to