Help is needed, thank you head of time

Hello everyone, I need some really big help here as I am starting to go a little crazy in my issue. What i need to do is remove the prefix from the following XML Data (typ: and ser:). Issue is that not only do i need to remove the prefix but the prefix always changes. Can someone help please and thank you.

<typ:ServiceProviderRequest xmlns:typ=“XXX.ca domain name may be for sale”>
typ:header
typ:messageId18</typ:messageId>
typ:recipientTEST</typ:recipient>
typ:destinationEnvironmentSIT</typ:destinationEnvironment>
</typ:header>
typ:payload
<ser:ServiceRequest xmlns:ser=“XXX.ca domain name may be for sale”>
ser:rmaCodeBESRMT</ser:rmaCode>
ser:rmaNoBESRMT5005293</ser:rmaNo>
ser:notes remote</ser:notes>
ser:priorityfalse</ser:priority>
ser:recordCreateDate2009-11-24</ser:recordCreateDate>
ser:rma
ser:equipment
ser:remote
ser:Remote
ser:modelNo1200</ser:modelNo>
</ser:Remote>
</ser:remote>
</ser:equipment>
ser:customer

Possible way i could think of to use string replace function. Use inbuilt service “[FONT=Arial][SIZE=5][FONT=Arial][SIZE=5]pub.string:replace[/SIZE][/FONT][/SIZE][/FONT]” to replace the unwanted string with the desired one.

Hope it will help. Thanks in Advance for your feedback.

But why is the prefix always changes?..I did replied to your old post about prefix issue did that helped?

HTH,
RMG

Yes the prefix always changes.

Then you have only choice of use replace functionality or create IS documents without prefix and re-map it while parsing nodetodocument.

HTH,
RMg

I’m assuming that the XML posted is just a fragment of a larger document?

Since the prefixes are identifying different namespaces it really isn’t valid to simply remove them. When calling xmlNodeToDocument, specify nsDecls to translate the prefixes to something known.

E.g. you might define nsDecls like this:

key=foo; value=XXX.ca domain name may be for sale
key=bar; value=XXX.ca domain name may be for sale

Then your IS document will have variables like this:

foo:messageId
foo:recipient

bar:rmaCode
bar:rmaNo

From there, you can map the document to a target structure or define a document type that mirrors the source type but without the prefixed names. Then map the fields from the source document to the no-prefix document.

IMO, using replace is the wrong thing to do.

Rob,

Yes i totally agree replace is not a best bet…but only as alternate option (if not clear to to).

Marolen,Best way to handle via setting nsDecls param and define IS Document type/Schema with no-prefix as mentioned above.

HTH,
RMg