I am trying to import an xsd through connector and metadata wizard. By default it maps elements and nodes to relevant namespace. Now the consumer of the generated xml does not want the name space reference to be added before each element (e.g. ns1, ns2). The stream generated is pretty big and making it optional element by element in nested structure will take lot of time and prone to manual error. Can we generate the xml using the stream that got generated by wizard without adding these namespace before each elements?
If you are seeing namespace prefixes against each element, most likely your XSD seems to be having this attribute elementFormDefault="qualified" defined for <schema> node or form="qualified" attribute against some/all of your <element> or <attribute> nodes. If that is indeed the case, what we are doing on the connector side is correct as per the schema. It is the consumer of this XML that needs to be corrected. If you don't have control over the consumer and you still don't want namespace prefixes added in the XML, you need to manually remove references to elementFormDefault="qualified" and form="qualified" from the XSD and regenerate the rules by running the connector and metadata wizard.
Run C & M wizard with the XSD as-is. The XML tab of XML Stream rule will look as follows (notice the prefixes "ns1").
Run C & M wizard by removing elementFormDefault="qualified" from <xsd:schema> node. The XML tab of XML Stream rule will look as follows (notice there are no prefixes except for the root node which is expected because the global elements always belong to the targetNamespace and hence must be namespace qualified).