This thread closely matches my issue.
I am using 6.5.
My goal is to take in xml that may have a namespace prefix specified, map it out, do some editing, map it back to the same document type, and convert to xml but without a namespace prefix.
Is it possible to use documentToXMLString to convert a IS document with a declared namespace to xml using the default namespace?
So far my steps have been the following:
-
create an IS document from the xml schema that has a default namespace. This produces documents with the ns:
-
convert the incomming xml string using xmlStringToXMLNode
-
convert the node to a document using xmlNodeToDocument, setting the documentTypeName as the document created from the schema import, and the nsDecls set value = ns: and the name = to the targetnamespace specified in the schema.
-
for purposes of this discussions, I essentially now want to convert the document into xml with out any namespace prefixes. Using documentToXMLString allows me to set the nsDecls to what I want, but I want it to be blank.
------------Possible XML input
<?xml version="1.0" encoding="UTF-8"?>
<comp:Policy xmlns:comp=“http://www.xyz” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://www.xyz”>
comp:PolicyNumberPolicyNumber</comp:PolicyNumber>
comp:LOBCdtoken</comp:LOBCd>
</comp:Policy>
---------------Convert to Doc
ns:Policy
ns:Policynumber
ns:LOBCd
----------Convert to XML with no namespace prefix (HAVEN’T BEEN ABLE TO DO YET!)
<?xml version="1.0" encoding="UTF-8"?>
<comp:Policy xmlns=“http://www.xyz” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://www.xyz”>
PolicyNumber
token
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB