Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in libxml++ for Linux

Status
Not open for further replies.

tanlccc

Programmer
Jul 5, 2011
3
Hi,

Using libxml++-2.6, is it possible to change the xsi:noNamespaceSchemaLocation in the root element node?
e.g.
from
Code:
<myxml xsi:noNamespaceSchemaLocation="[B]ABC.xsd[/B]" xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance">[/URL]
   :
   :
</myxml>

to
Code:
<myxml xsi:noNamespaceSchemaLocation="[B]XYZ.xsd[/B]" xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance">[/URL]
   :
   :
</myxml>

I tried to set the attribute value after getting the attribute pointer from the node element as follows:
Code:
Element* nodeElement = dynamic_cast<const Element*>(rootNode)
Attribute* attribute = nodeElement->get_attribute("xsi:noNamespaceSchemaLocation")
if (attribute)
     attribute->set_value("XYZ.xsd:);
else
     cout << "Attribute NOT found" << endl;

The output shows "Attribute NOT found" :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top