BizTalk Server General - Change Namespace Prefix

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > June 2004 > Change Namespace Prefix





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Change Namespace Prefix
Frank Wilson

2004-06-02, 4:56 pm

Is there a way either in BizTalk or through a custom component (pipeline or
other) to change the namespace prefix of an outbound message? I am sending
a document to an application that requires that every element be prefixed
with "sm". BizTalk sends the document with the "ns0" prefix.

I am interested in how to do this in BizTalk, but I would also be interested
in how to do it using .NET (System.Xml) without having to set the prefix on
every node.

Thanks,
Frank


Tatyana Yakushev [MSFT]

2004-06-03, 11:56 pm

You will have to implement custom pipeline component if you really need to do this.

Why does the application require you to set prefix to sm?

Following 2 XMLs are considered identical.
<ns0:A xmlns:ns0="NS"/>

<sm:A xmlns:sm="NS"/>

Thanks,
Tatyana
--------------------
>From: "Frank Wilson" <nospam@hotmail.com>
>Subject: Change Namespace Prefix
>Date: Wed, 2 Jun 2004 11:44:45 -0700
>Lines: 13
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <#bbgpJNSEHA.1048@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.biztalk.general
>NNTP-Posting-Host: c-24-21-127-35.client.comcast.net 24.21.127.35
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:15860
>X-Tomcat-NG: microsoft.public.biztalk.general
>
>Is there a way either in BizTalk or through a custom component (pipeline or
>other) to change the namespace prefix of an outbound message? I am sending
>a document to an application that requires that every element be prefixed
>with "sm". BizTalk sends the document with the "ns0" prefix.
>
>I am interested in how to do this in BizTalk, but I would also be interested
>in how to do it using .NET (System.Xml) without having to set the prefix on
>every node.
>
>Thanks,
>Frank
>
>
>



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

Frank Wilson

2004-06-04, 4:59 pm

Thank you for your response. The application in question is MBN (Microsoft
Business Network) and it transforms documents using XSLT. Every node in the
document is prefixed (<sm:Element /> ) and every XPath reference includes
those prefixes (match="sm:Root/sm:Child/sm:Grandchild"). So I am forced to
make sure that every element is prefixed with sm, even though any other
prefix should be valid as long as they as defined as the same thing.

I have follow-up question: How can I implement this in a custom pipeline
component? I have a component right now that will change the namespace
prefix, but I don't feel that it is an acceptable solution. I have found 2
ways to do this: 1) Convert the document to a string an do a Replace() on
the prefix and namespace declaration or 2) Loop through every node in the
document and change the prefix property.

Do you know of a better way? Both of my solutions have significant
downfalls.

Thanks,
Frank


"Tatyana Yakushev [MSFT]" <tatyanam@online.microsoft.com> wrote in message
news:5iOLltcSEHA.3664@cpmsftngxa10.phx.gbl...
> You will have to implement custom pipeline component if you really need to

do this.
>
> Why does the application require you to set prefix to sm?
>
> Following 2 XMLs are considered identical.
> <ns0:A xmlns:ns0="NS"/>
>
> <sm:A xmlns:sm="NS"/>
>
> Thanks,
> Tatyana
> --------------------
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
..phx.gbl[vbcol=seagreen]
or[vbcol=seagreen]
sending[vbcol=seagreen]
interested[vbcol=seagreen]
on[vbcol=seagreen]
>
>
> --
>
> This posting is provided "AS IS" with no warranties, and confers no

rights. Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> Note: For the benefit of the community-at-large, all responses to this

message are best directed to the newsgroup/thread from which they
originated.
>



Tatyana Yakushev [MSFT]

2004-06-26, 10:51 am

I don't know other solutions (except fixing the XSLT which you don't have control over...).
Second solution looks safer because you don't replace "ns0:" if it's part of element/attribute value.

Thanks
Tatyana

--------------------
>From: "Frank Wilson" <nospam@hotmail.com>
>References: <#bbgpJNSEHA.1048@tk2msftngp13.phx.gbl> <5iOLltcSEHA.3664@cpmsftngxa10.phx.gbl>
>Subject: Re: Change Namespace Prefix
>Date: Fri, 4 Jun 2004 11:49:03 -0700
>Lines: 85
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <OQD4oSmSEHA.2128@TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.biztalk.general
>NNTP-Posting-Host: c-67-160-176-188.client.comcast.net 67.160.176.188
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:15932
>X-Tomcat-NG: microsoft.public.biztalk.general
>
>Thank you for your response. The application in question is MBN (Microsoft
>Business Network) and it transforms documents using XSLT. Every node in the
>document is prefixed (<sm:Element /> ) and every XPath reference includes
>those prefixes (match="sm:Root/sm:Child/sm:Grandchild"). So I am forced to
>make sure that every element is prefixed with sm, even though any other
>prefix should be valid as long as they as defined as the same thing.
>
>I have follow-up question: How can I implement this in a custom pipeline
>component? I have a component right now that will change the namespace
>prefix, but I don't feel that it is an acceptable solution. I have found 2
>ways to do this: 1) Convert the document to a string an do a Replace() on
>the prefix and namespace declaration or 2) Loop through every node in the
>document and change the prefix property.
>
>Do you know of a better way? Both of my solutions have significant
>downfalls.
>
>Thanks,
>Frank
>
>
>"Tatyana Yakushev [MSFT]" <tatyanam@online.microsoft.com> wrote in message
>news:5iOLltcSEHA.3664@cpmsftngxa10.phx.gbl...
>do this.
>cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
>.phx.gbl
>or
>sending
>interested
>on
>rights. Use of included script samples are subject to the terms specified at
>message are best directed to the newsgroup/thread from which they
>originated.
>
>
>



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com