TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft BizTalk Server

Notices

why biztalk 2006 piut NS0 prefix part of my XML...even if i dont wantit..plz some1 explain me that

Microsoft BizTalk Server


Reply
 
Thread Tools Display Modes
Old 04-12-2007, 09:34 PM   #1
philippe.kozubek@gmail.com
Guest
 
Posts: n/a
why biztalk 2006 piut NS0 prefix part of my XML...even if i dont wantit..plz some1 explain me that

I realize that Biztalk put an NS0 prefix inside my output XML...
however I DO NOT want that ,cause those xml will be validated against
external system..nothign to do with Biztalk...and they failed the
validation cause of that. I dont get it, when i pass the XML to
biztalk, it take it with the XMLns:="toto" and no prefix part of the
XML and why those XML when they go out it put those NS0.


Exemple Input XML:


<ROOT xmlsns:="toto"/>
<data>
<element1>rere<element1/>
<data/>


I WANT the same result in output


so if i keep the property set on the schema with the target namespace
"toto" ElementFormDefault =Qualified
result is :
<ns0:ROOT xmlsns:ns0="toto"/>
<ns0:data>
<ns0:element1>rere<ns0:element1/>
<ns0:data/>


so if i keep the property set on the schema with the target namespace
"toto" ElementFormDefault =UnQualified
result is :
<ns0:ROOT xmlsns:ns0="toto"/>
<data>
<element1>rere<element1/>
<ns0:data/>


so if i keep the property set on the schema with the target namespace
= ""
result is :
<ROOT />
<data>
<element1>rere<element1/>
<data/>


THATS NICE BUT I LOST MY TARGETNAMESPACE REFERENCE....... how the
hell
im doing to get the xml like i want ???????? the result i want is :


<ROOT xmlsns:="toto"/>
<data>
<element1>rere<element1/>
<data/>


is that possible >>?????? plz i need to understand wht the heck is
going on....

  Reply With Quote
Old 05-12-2007, 01:18 AM   #2
Tomas Restrepo [MVP]
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dont want it..plz some1 explain me that

Philippe,

>I realize that Biztalk put an NS0 prefix inside my output XML...
> however I DO NOT want that ,cause those xml will be validated against
> external system..nothign to do with Biztalk...and they failed the
> validation cause of that. I dont get it, when i pass the XML to
> biztalk, it take it with the XMLns:="toto" and no prefix part of the
> XML and why those XML when they go out it put those NS0.
>


How are you generating the output message?

Now, keep in mind, that as far as XML is concerned, this:

<ROOT xmlsns="toto"/>
<data>
<element1>rere</element1>
</data>
</ROOT>

is exactly equivalent to this:

<ns0:ROOT xmlsns:ns0="toto">
<ns0:data>
<ns0:element1>rere</ns0:element1>
</ns0:data>
</ns0:ROOT>

(I'll assume the obvious syntax errors in your sample documents where just a
mistake in typing them and that's not actually what you were trying to
process).

Both of those sample documents will validate against the exact same XML
schema and are equivalent. If that's indeed the schema you want to be
compliant with, and the target system is telling you the second is invalid,
then, either your schema is wrong, or the target system doesn't really
support XML namespaces correctly. As far as XMLNS is concerned, the prefix
(i.e. ns0) is completely irrelevant, the only thing that matters is to what
namespace it is associated with in the document instance.

--
Tomas Restrepo



  Reply With Quote
Old 05-12-2007, 02:25 AM   #3
Tomas Restrepo [MVP]
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dont want it..plz some1 explain me that

Philippe,

>I realize that Biztalk put an NS0 prefix inside my output XML...
> however I DO NOT want that ,cause those xml will be validated against
> external system..nothign to do with Biztalk...and they failed the
> validation cause of that. I dont get it, when i pass the XML to
> biztalk, it take it with the XMLns:="toto" and no prefix part of the
> XML and why those XML when they go out it put those NS0.
>


How are you generating the output message?

Now, keep in mind, that as far as XML is concerned, this:

<ROOT xmlsns="toto"/>
<data>
<element1>rere</element1>
</data>
</ROOT>

is exactly equivalent to this:

<ns0:ROOT xmlsns:ns0="toto">
<ns0:data>
<ns0:element1>rere</ns0:element1>
</ns0:data>
</ns0:ROOT>

(I'll assume the obvious syntax errors in your sample documents where just a
mistake in typing them and that's not actually what you were trying to
process).

Both of those sample documents will validate against the exact same XML
schema and are equivalent. If that's indeed the schema you want to be
compliant with, and the target system is telling you the second is invalid,
then, either your schema is wrong, or the target system doesn't really
support XML namespaces correctly. As far as XMLNS is concerned, the prefix
(i.e. ns0) is completely irrelevant, the only thing that matters is to what
namespace it is associated with in the document instance.

--
Tomas Restrepo



  Reply With Quote
Old 05-12-2007, 02:25 AM   #4
philippe.kozubek@gmail.com
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dontwant it..plz some1 explain me that

On Dec 4, 1:29 pm, "Tomas Restrepo [MVP]" <> wrote:
> Philippe,
>
> >I realize that Biztalk put an NS0 prefix inside my output XML...
> > however I DO NOT want that ,cause those xml will be validated against
> > external system..nothign to do with Biztalk...and they failed the
> > validation cause of that. I dont get it, when i pass the XML to
> > biztalk, it take it with the XMLns:="toto" and no prefix part of the
> > XML and why those XML when they go out it put those NS0.

>
> How are you generating the output message?
>
> Now, keep in mind, that as far as XML is concerned, this:
>
> <ROOT xmlsns="toto"/>
> <data>
> <element1>rere</element1>
> </data>
> </ROOT>
>
> is exactly equivalent to this:
>
> <ns0:ROOT xmlsns:ns0="toto">
> <ns0:data>
> <ns0:element1>rere</ns0:element1>
> </ns0:data>
> </ns0:ROOT>
>
> (I'll assume the obvious syntax errors in your sample documents where justa
> mistake in typing them and that's not actually what you were trying to
> process).
>
> Both of those sample documents will validate against the exact same XML
> schema and are equivalent. If that's indeed the schema you want to be
> compliant with, and the target system is telling you the second is invalid,
> then, either your schema is wrong, or the target system doesn't really
> support XML namespaces correctly. As far as XMLNS is concerned, the prefix
> (i.e. ns0) is completely irrelevant, the only thing that matters is to what
> namespace it is associated with in the document instance.
>
> --
> Tomas Restrepohttp://www.devdeo.com/http://www.winterdom.com/weblog/


I make thwe xml message by doing as mâp.basically im building it, how
can i make the XML , to have a target Namespace and no prefix in it,
i will like my xml to look like that once i send it out :

<ROOT xmlsns="toto"/>
<data>
<element1>rere</element1>
</data>
</ROOT>

I dont want to see any ns0 prefix, and im not able to do so... i play
with the elementFormDefault attrribute of the schema(inside Biztalk)
and i m not able to generate the output XML without the prefix but
with the targetnamespace attribut set. So in 1 sentence, wht im
looking for is : having an xml with a targetNamespace in it but no
prefix...very important no Prefix....can biztalk do that ???? probaly
the external application that use the XML once it get out from Biztalk
cannot validate with a prefix, i dont know... the main point here is
to have an XML comming out form Biztalk that doesnt have any prefix
but does have the targetnamespace in it... do i have to build a
pipeline component , so i take out the prefix once it go out passing
by my pipeline... i found that solution a bit more like a patch that i
dont like honestly. its a client requirement.. to have a
targetNamespace inside the XML but no prefix...probaly because they
dont know how to validate it.

If i look to the schema, i dont see any prefix part of it...so why
biztalk will do so.... regarding external validation.. on a pur schema
point of view , if the Schema doesnt have any prefix and your XML
does... it will never validate anyway no ??? do you have any exemple
of the contraire that i can take a look at..perhaps there is
someything i dont get here....

i Hope my english is enought clear so you can understand my point....
  Reply With Quote
Old 05-12-2007, 03:29 AM   #5
philippe.kozubek@gmail.com
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dontwant it..plz some1 explain me that

On Dec 4, 1:29 pm, "Tomas Restrepo [MVP]" <> wrote:
> Philippe,
>
> >I realize that Biztalk put an NS0 prefix inside my output XML...
> > however I DO NOT want that ,cause those xml will be validated against
> > external system..nothign to do with Biztalk...and they failed the
> > validation cause of that. I dont get it, when i pass the XML to
> > biztalk, it take it with the XMLns:="toto" and no prefix part of the
> > XML and why those XML when they go out it put those NS0.

>
> How are you generating the output message?
>
> Now, keep in mind, that as far as XML is concerned, this:
>
> <ROOT xmlsns="toto"/>
> <data>
> <element1>rere</element1>
> </data>
> </ROOT>
>
> is exactly equivalent to this:
>
> <ns0:ROOT xmlsns:ns0="toto">
> <ns0:data>
> <ns0:element1>rere</ns0:element1>
> </ns0:data>
> </ns0:ROOT>
>
> (I'll assume the obvious syntax errors in your sample documents where justa
> mistake in typing them and that's not actually what you were trying to
> process).
>
> Both of those sample documents will validate against the exact same XML
> schema and are equivalent. If that's indeed the schema you want to be
> compliant with, and the target system is telling you the second is invalid,
> then, either your schema is wrong, or the target system doesn't really
> support XML namespaces correctly. As far as XMLNS is concerned, the prefix
> (i.e. ns0) is completely irrelevant, the only thing that matters is to what
> namespace it is associated with in the document instance.
>
> --
> Tomas Restrepohttp://www.devdeo.com/http://www.winterdom.com/weblog/


I make thwe xml message by doing as mâp.basically im building it, how
can i make the XML , to have a target Namespace and no prefix in it,
i will like my xml to look like that once i send it out :

<ROOT xmlsns="toto"/>
<data>
<element1>rere</element1>
</data>
</ROOT>

I dont want to see any ns0 prefix, and im not able to do so... i play
with the elementFormDefault attrribute of the schema(inside Biztalk)
and i m not able to generate the output XML without the prefix but
with the targetnamespace attribut set. So in 1 sentence, wht im
looking for is : having an xml with a targetNamespace in it but no
prefix...very important no Prefix....can biztalk do that ???? probaly
the external application that use the XML once it get out from Biztalk
cannot validate with a prefix, i dont know... the main point here is
to have an XML comming out form Biztalk that doesnt have any prefix
but does have the targetnamespace in it... do i have to build a
pipeline component , so i take out the prefix once it go out passing
by my pipeline... i found that solution a bit more like a patch that i
dont like honestly. its a client requirement.. to have a
targetNamespace inside the XML but no prefix...probaly because they
dont know how to validate it.

If i look to the schema, i dont see any prefix part of it...so why
biztalk will do so.... regarding external validation.. on a pur schema
point of view , if the Schema doesnt have any prefix and your XML
does... it will never validate anyway no ??? do you have any exemple
of the contraire that i can take a look at..perhaps there is
someything i dont get here....

i Hope my english is enought clear so you can understand my point....
  Reply With Quote
Old 05-12-2007, 05:20 AM   #6
Tomas Restrepo [MVP]
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dont want it..plz some1 explain me that

Philippe,

<<
I make thwe xml message by doing as mâp.basically im building it, how
can i make the XML , to have a target Namespace and no prefix in it,
i will like my xml to look like that once i send it out :

<ROOT xmlsns="toto"/>
<data>
<element1>rere</element1>
</data>
</ROOT>

I dont want to see any ns0 prefix, and im not able to do so... i
>>


Yes, you mentioned that the first time

<<
play
with the elementFormDefault attrribute of the schema(inside Biztalk)
and i m not able to generate the output XML without the prefix
>>


Changing the elementFormDefault completely changes the kind of documents a
schema represents/validates, playing with it won't get you what you want.
Also, the prefix is not controlled by the schema at all. As I said earlier,
the actual prefix used is irrelevant; the only thing that matters is that it
is associated to the right namespace in the *document instance* via the
"xmlns:xx" attribute.

I would strongly suggest going through some good XSD and XML Namespace
related documentation (there's plenty on internet) just so that you
understand better what it means and how it impacts schema validation. It
will make it much easier to deal with these kind of issues in the future.

Now, if, for any unfortunate reason, you are indeed faced with sending a
document to a system that implements XSD validation incorrectly and insists
that your document instance should use a specific prefix (and I'm not 100%
convinced this is indeed your problem), then in your specific case there
might be something you can do:



It's not a very nice solution, but it might give you a way around it.


--
Tomas Restrepo



  Reply With Quote
Old 06-12-2007, 12:56 AM   #7
wendld
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i do

Hi

If you still want to remove the namespace you can always use custom pipeline.

Hope this helps


"Tomas Restrepo [MVP]" wrote:

> Philippe,
>
> <<
> I make thwe xml message by doing as mâp.basically im building it, how
> can i make the XML , to have a target Namespace and no prefix in it,
> i will like my xml to look like that once i send it out :
>
> <ROOT xmlsns="toto"/>
> <data>
> <element1>rere</element1>
> </data>
> </ROOT>
>
> I dont want to see any ns0 prefix, and im not able to do so... i
> >>

>
> Yes, you mentioned that the first time
>
> <<
> play
> with the elementFormDefault attrribute of the schema(inside Biztalk)
> and i m not able to generate the output XML without the prefix
> >>

>
> Changing the elementFormDefault completely changes the kind of documents a
> schema represents/validates, playing with it won't get you what you want.
> Also, the prefix is not controlled by the schema at all. As I said earlier,
> the actual prefix used is irrelevant; the only thing that matters is that it
> is associated to the right namespace in the *document instance* via the
> "xmlns:xx" attribute.
>
> I would strongly suggest going through some good XSD and XML Namespace
> related documentation (there's plenty on internet) just so that you
> understand better what it means and how it impacts schema validation. It
> will make it much easier to deal with these kind of issues in the future.
>
> Now, if, for any unfortunate reason, you are indeed faced with sending a
> document to a system that implements XSD validation incorrectly and insists
> that your document instance should use a specific prefix (and I'm not 100%
> convinced this is indeed your problem), then in your specific case there
> might be something you can do:
>
>
>
> It's not a very nice solution, but it might give you a way around it.
>
>
> --
> Tomas Restrepo
>
>
>
>

  Reply With Quote
Old 06-12-2007, 03:11 AM   #8
philippe.kozubek@gmail.com
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dontwant it..plz some1 explain me that

On Dec 4, 6:30 pm, "Tomas Restrepo [MVP]" <tom...@mvps.org> wrote:
> Philippe,
>
> <<
> I make thwe xml message by doing as mâp.basically im building it, how
> can i make the XML , to have a target Namespace and no prefix in it,
> i will like my xml to look like that once i send it out :
>
> <ROOT xmlsns="toto"/>
> <data>
> <element1>rere</element1>
> </data>
> </ROOT>
>
> I dont want to see any ns0 prefix, and im not able to do so... i
>
>
>
> Yes, you mentioned that the first time
>
> <<
> play
> with the elementFormDefault attrribute of the schema(inside Biztalk)
> and i m not able to generate the output XML without the prefix
>
>
>
> Changing the elementFormDefault completely changes the kind of documents a
> schema represents/validates, playing with it won't get you what you want.
> Also, the prefix is not controlled by the schema at all. As I said earlier,
> the actual prefix used is irrelevant; the only thing that matters is that it
> is associated to the right namespace in the *document instance* via the
> "xmlns:xx" attribute.
>
> I would strongly suggest going through some good XSD and XML Namespace
> related documentation (there's plenty on internet) just so that you
> understand better what it means and how it impacts schema validation. It
> will make it much easier to deal with these kind of issues in the future.
>
> Now, if, for any unfortunate reason, you are indeed faced with sending a
> document to a system that implements XSD validation incorrectly and insists
> that your document instance should use a specific prefix (and I'm not 100%
> convinced this is indeed your problem), then in your specific case there
> might be something you can do:
>
>
>
> It's not a very nice solution, but it might give you a way around it.
>
> --
> Tomas Restrepohttp://www.devdeo.com/http://www.winterdom.com/weblog/


thanks a lot... i will do some experimentation with Schemas and XMl
with or whtiout prefix and thanks for the link you sent to me... and
yes the external system im sending the xml to... OBLIGATE ME to take
out the prefix... so i guest they dont do correct validation...
  Reply With Quote
Old 06-12-2007, 04:18 AM   #9
philippe.kozubek@gmail.com
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i dontwant it..plz some1 explain me that

On Dec 4, 6:30 pm, "Tomas Restrepo [MVP]" <tom...@mvps.org> wrote:
> Philippe,
>
> <<
> I make thwe xml message by doing as mâp.basically im building it, how
> can i make the XML , to have a target Namespace and no prefix in it,
> i will like my xml to look like that once i send it out :
>
> <ROOT xmlsns="toto"/>
> <data>
> <element1>rere</element1>
> </data>
> </ROOT>
>
> I dont want to see any ns0 prefix, and im not able to do so... i
>
>
>
> Yes, you mentioned that the first time
>
> <<
> play
> with the elementFormDefault attrribute of the schema(inside Biztalk)
> and i m not able to generate the output XML without the prefix
>
>
>
> Changing the elementFormDefault completely changes the kind of documents a
> schema represents/validates, playing with it won't get you what you want.
> Also, the prefix is not controlled by the schema at all. As I said earlier,
> the actual prefix used is irrelevant; the only thing that matters is that it
> is associated to the right namespace in the *document instance* via the
> "xmlns:xx" attribute.
>
> I would strongly suggest going through some good XSD and XML Namespace
> related documentation (there's plenty on internet) just so that you
> understand better what it means and how it impacts schema validation. It
> will make it much easier to deal with these kind of issues in the future.
>
> Now, if, for any unfortunate reason, you are indeed faced with sending a
> document to a system that implements XSD validation incorrectly and insists
> that your document instance should use a specific prefix (and I'm not 100%
> convinced this is indeed your problem), then in your specific case there
> might be something you can do:
>
>
>
> It's not a very nice solution, but it might give you a way around it.
>
> --
> Tomas Restrepohttp://www.devdeo.com/http://www.winterdom.com/weblog/


thanks a lot... i will do some experimentation with Schemas and XMl
with or whtiout prefix and thanks for the link you sent to me... and
yes the external system im sending the xml to... OBLIGATE ME to take
out the prefix... so i guest they dont do correct validation...
  Reply With Quote
Old 11-12-2007, 04:11 PM   #10
K Price
Guest
 
Posts: n/a
Re: why biztalk 2006 piut NS0 prefix part of my XML...even if i do

There's a good example of how to remove all namespace nastiness here:



This will also remove the default namespace, though - and I think you want
this?


"philippe.kozubek@gmail.com" wrote:

> On Dec 4, 6:30 pm, "Tomas Restrepo [MVP]" <tom...@mvps.org> wrote:
> > Philippe,
> >
> > <<
> > I make thwe xml message by doing as mâp.basically im building it, how
> > can i make the XML , to have a target Namespace and no prefix in it,
> > i will like my xml to look like that once i send it out :
> >
> > <ROOT xmlsns="toto"/>
> > <data>
> > <element1>rere</element1>
> > </data>
> > </ROOT>
> >
> > I dont want to see any ns0 prefix, and im not able to do so... i
> >
> >
> >
> > Yes, you mentioned that the first time
> >
> > <<
> > play
> > with the elementFormDefault attrribute of the schema(inside Biztalk)
> > and i m not able to generate the output XML without the prefix
> >
> >
> >
> > Changing the elementFormDefault completely changes the kind of documents a
> > schema represents/validates, playing with it won't get you what you want.
> > Also, the prefix is not controlled by the schema at all. As I said earlier,
> > the actual prefix used is irrelevant; the only thing that matters is that it
> > is associated to the right namespace in the *document instance* via the
> > "xmlns:xx" attribute.
> >
> > I would strongly suggest going through some good XSD and XML Namespace
> > related documentation (there's plenty on internet) just so that you
> > understand better what it means and how it impacts schema validation. It
> > will make it much easier to deal with these kind of issues in the future.
> >
> > Now, if, for any unfortunate reason, you are indeed faced with sending a
> > document to a system that implements XSD validation incorrectly and insists
> > that your document instance should use a specific prefix (and I'm not 100%
> > convinced this is indeed your problem), then in your specific case there
> > might be something you can do:
> >
> >
> >
> > It's not a very nice solution, but it might give you a way around it.
> >
> > --
> > Tomas Restrepohttp://www.devdeo.com/http://www.winterdom.com/weblog/

>
> thanks a lot... i will do some experimentation with Schemas and XMl
> with or whtiout prefix and thanks for the link you sent to me... and
> yes the external system im sending the xml to... OBLIGATE ME to take
> out the prefix... so i guest they dont do correct validation...
>

  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 08:13 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional