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

Boris Kolpackov boris at codesynthesis.com
Sat Nov 16 07:37:57 EST 2013


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