views:

44

answers:

2

Hello,

BizTalk produced namespace default prefix as NS0. Is there a way to override it to generate something different without utilizing an XSLT (it's an overhead when the schema changes, XSLT has to be updated as well)? Something like

<pidx:Invoice> 

and not

<ns0:Invoice>

This should be simple (after all it's just a namespace prefix), but clients are parsing document instead of using it as an XML with namespace, and having no expected namespace prefix causes them grief.

Thank you.

+1  A: 

No, there's not.

A kludgey answer is to convert the XML to a string and search/replace.

Jeremy Stein
Agree. Though I didn't like the approach and after chatting with folks at work, we came up to a different solution. We can have a custom pipeline component that will take in namespace, prefix and XSLT expression and apply it on the output. The map for the output would be configured to produce no namespace at all (so that ns0 is not there at any element) and that should do the trick in a more efficient manner than string replacements by leveraging .NET XsltTransfomation.
Sean
+1  A: 

You can do this. I had to do this when calling a Google API, which requires specific namespace prefixes.

The method is to use the Imports property at the <Schema> level in your XSD. Using the Imports dialog you can define specific prefixes on each namespace.

You will have to break up your schema into at least two separate XSD's so you can import one into the other and redefine the prefix at that time.

Randy Lindsey
Hi Randy,I am sorry, but looks like I don't seem to be able to reproduce this. Is there a way you could setup a simple demo project and fire at my email? Feldman.Sean at gmail.comThank you,Sean
Sean

related questions