[libxml++] Creating root node with namespace uri



Hello!

I'm trying to write the following xml:

<?xml version="1.0"?>
<exampleroot xmlns="http://www.landxml.org/schema/LandXML-1.0";>
  <examplechild/>
</exampleroot>

Here is the simple code, that throws an exception
(Exception caught: The namespace () has not been declared.):

      xmlpp::Document document;
      xmlpp::Element* nodeRoot = document.create_root_node("exampleroot",
"http://www.landxml.org/schema/LandXML-1.0";);
      nodeRoot->add_child("examplechild");

How can I create the above xml? I'm using libxml++2.6. Thanks in advance!

Hälsningar,
Daniel
SBG AB

Phone: +4687112090
Fax  : +4687112098
Location:
       59 14'10" N
       18 00'09" E




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]