[Simple-support] Query regarding use of Namespace in Simple XML 2.7
Brought to you by:
niallg
|
From: Harish R. <har...@gm...> - 2013-08-05 18:23:48
|
Dear Sir/ Madam, I am trying to create an XML as below using Java and Simple 2.7 Jar, <TestXML xmlns:xs="urn:loc.gov:books" xs:"XYZ.xsd"> <ABC>1.0</ABC> </TestXML> The Java code with Namespace for the same is as below, @Root @NamespaceList({ @Namespace(reference="urn:loc.gov:books", prefix="xs"), @Namespace(reference="XYZ.xsd", prefix = "xs") }) public class TestXML { .... } But, with the above Java class, the XML gets printed as below, <TestXML xmlns:xs="urn:loc.gov:books" xmlns:xs="XYZ.xsd"> <ABC>1.0</ABC> </TestXML> I do not require the "xmlns" and "=" appended to the second namespace. Can you please let me know as to what I am missing in the Java code. Thanks in advance. Warm Regards, Harish |