I have an object and I am trying to output as xml. That part is working fine, but I need to put a namespace on the elements. How is the namespace set? I am using the following code. In my startElement method in my ContentHandler, the namespaceURI is "". What am I doing wrong?

HardErrorContentHandler beanHandler = HardErrorContentHandlerFactory.getInstance(obj);
beanHandler.setPrettyPrint(prettyPrint);
SAXBeanWriter beanWriter = new SAXBeanWriter(beanHandler);
if(capitalize) {
beanWriter.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
}
// set namespace
NamespacePrefixMapper namespaceMapper = new NamespacePrefixMapper();
namespaceMapper.setPrefix("xmlns","http://tempuri.org/segHedge.xsd";);
beanWriter.getXMLIntrospector().getConfiguration().setPrefixMapper(namespaceMapper);
Thanks,


Matt

--
Matt Goodwin
[EMAIL PROTECTED]
(515)708-0114
Metalexis
"Transcending the Ordinary"


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to