Re: how to: unqualify root element with targetnamespace
- From: "BizTalk Benjamin" <BizTalkBenjamin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Jul 2021 08:13:11 -0700
Tomas,
I dont seem to be able to send paste links to messages, else i could refer
you to my XML Namespaces post on this issue..
My original post is :
I have a XML file that looks approximately like
<SupplierRecord xmlns="http://mycompany/schemas/supplier1";>
<Header>.....</Header>
<Body>....</Body>
</Supplier Record>
When i try to validate this against the schema, it throws errors for every
single element saying that it couldnt locate the namespace. So i generated a
instance from the schema and found that it creates a file that looks like this
<ns0:SupplierRecord xmlns:ns0="http://mycompany/schemas/supplier1";>
<Header>.....</Header>
<Body>....</Body>
</ns0:Supplier Record>
This validates correctly. So i have had to resort to manually adding a ns0:
in order to get my map to work and the file to validate against the XSD
- Benjy
"Tomas Restrepo (MVP)" wrote:
> Benjamin,
>
> > In my case the source document comes from a custom component that uses
> > XSDObjectGen (the class in turn was generated from this schema) and does
> > not
> > have the ns0: prefix but has the correct targetNamespace. As a result it
> > fails to get mapped to my target schema (and fails when you validate it
> > against the schema). BizTalk complains that it cannot find the definition
> > for
> > any of the elements. I had to manually add the ns0: prefix for it to work
> > properly (the manual work around was only to test and see, obviously thats
> > not sustainable. )
>
> You mean it is something like this?
>
> <root xmlns="http://....";>
> <somenode>....</somenode>
> ....
> </root>
>
> If so, then that's just the same (as far as xml is concerned) to:
>
> <ns0:root xmlns:ns0="http://....";>
> <ns0:somenode>....</ns0:somenode>
> ....
> </ns0:root>
>
> Guess someone should just show what they mean because so far, I'm a little
> bit lost trying to understand you guys :)
>
>
> --
> Tomas Restrepo
> tomasr@xxxxxxxx
> http://www.winterdom.com/
>
>
>
.
- Follow-Ups:
- Re: how to: unqualify root element with targetnamespace
- From: BizTalk Benjamin
- Re: how to: unqualify root element with targetnamespace
- References:
- how to: unqualify root element with targetnamespace
- From: Jeff Wessling
- Re: how to: unqualify root element with targetnamespace
- From: Tomas Restrepo \(MVP\)
- Re: how to: unqualify root element with targetnamespace
- From: Jeff Wessling
- Re: how to: unqualify root element with targetnamespace
- From: Tomas Restrepo \(MVP\)
- Re: how to: unqualify root element with targetnamespace
- From: BizTalk Benjamin
- Re: how to: unqualify root element with targetnamespace
- From: Tomas Restrepo \(MVP\)
- how to: unqualify root element with targetnamespace
- Prev by Date: Re: Mapping Failures - Native Parsing Error
- Next by Date: Re: Need help on: Failed to initialize the correlation property name:
- Previous by thread: Re: how to: unqualify root element with targetnamespace
- Next by thread: Re: how to: unqualify root element with targetnamespace
- Index(es):
Relevant Pages
- Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Modules (Vol I)
... >>>but that's totally useless for XML parsing. ... >Your parser
has no appreciation of nesting beyond the very trivial, ... >going to be for your parser to
validate against one. ... Wheather or not I can use it to write a schema checker
is something I ... (comp.lang.perl.misc) - Using xs:import and xs:extension
... validate each one seperately against an XML doc. ... Here is the "base"
schema: ... So I tried to put namespaces in: ... (comp.text.xml) - Re: Validate XML against Schema
... are problems when loading the schema and XML. ... generated from validate()
always have line and column numbers of "-1". ... public void fatalError ... (comp.lang.java.programmer) - Validate subsets of XML document using different schema?
... I *think* I need to be able to validate subsets of an XML document ... using
different schema. ... External suppliers produce an XML document containing multiple
User ... something like "User record 1 was valid, ... (comp.text.xml) - Re: how to: unqualify root element with targetnamespace
... Just to comment that the replies from Tomas and David are very helpful (in ...
the reply to the XML Namespaces post) and i will check them out as soon as i ... > instance
from the schema and found that it creates a file that looks like this ... > in order
to get my map to work and the file to validate against the XSD ... (microsoft.public.biztalk.general)