[xsd-users] Can't parse root element with xmlns attribute.

Erasmo Aguilera eaguilerai at hotmail.com
Sat Nov 16 14:24:55 EST 2013


Hi Boris,

As you might notice, I used the --generate-test-driver flag in the XSD
compiler. In my case, the output driver already constructs the doc_p with
the namespace of the root element.

If you have compiled the code with Visual Studio, I'll be grateful that you
send me the individual files you used or place a copy of the entire project
on my SkyDrive: 
https://skydrive.live.com/redir?resid=A8C8268C5A1D5215!476&authkey=!AL7b7XH0
HkufYj8

Thanks again.

Erasmo.

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: sábado, 16 de noviembre de 2013 06:38 a.m.
To: Erasmo Aguilera
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] Can't parse root element with xmlns attribute.

Hi Erasmo,

Erasmo Aguilera <eaguilerai at hotmail.com> writes:

> I supposed that was because the xmlns attribute wasn't defined for the 
> hello element in the XML Schema, but as you know, you can't define an 
> attribute with such a name.

No, xmlns is a built-in attribute and it cannot be "defined".

I just took the hello example, made the modifications you described, and
everything works fine.

Note that you need to change your doc_p constructor to include the
namespace:

xml_schema::document doc_p (hello_p, "http://www.mysite.com/hello",
"hello");

Boris




More information about the xsd-users mailing list