That schema has namespace "xs" defiened, but the serizlize output has "xs:xs:" as it namespace instead of "xs".
I attached the source file and here is the simple problem that I am using:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbf.newDocumentBuilder();
System.out.println( "Loading document with JAXP builder: " + builder );
org.w3c.dom.Document domDocument = builder.parse( "output.xsd" );
org.w3c.dom.Element element2 = domDocument.getDocumentElement();
DOMReader reader = new DOMReader();
Document document = reader.read(domDocument);
// use dom4j document as the source
Source source = new DocumentSource( document );
OutputFormat outformat = OutputFormat.createPrettyPrint();
XMLWriter writer = new XMLWriter(System.out, outformat);
writer.write(document);
writer.flush();
Here is the output, it has "xmlns:xs" twice also in the root node.
<?xml version="1.0" encoding="UTF-8"?>
<xs:xs:schema xmlns:xs="" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3">
<xs:xs:import xmlns:xs="" namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
<xs:xs:simpleType xmlns:xs="" name="statusTextType">
<xs:xs:annotation>
<xs:xs:documentation>list of standard human-readable status descriptions</xs:xs:documentation>
</xs:xs:annotation>
<xs:xs:restriction base="xs:string"/>
</xs:xs:simpleType>
</xs:xs:schema>
Any help is appreciated.
Thank you.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-3" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/> <xs:simpleType name="statusTextType"> <xs:annotation> <xs:documentation>list of standard human-readable status descriptions</xs:documentation> </xs:annotation> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:schema>