Hi,
Using libxml++-2.6, is it possible to change the xsi:noNamespaceSchemaLocation in the root element node?
e.g.
from
<myxml xsi:noNamespaceSchemaLocation="ABC.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
:
:
</myxml>
to
<myxml xsi:noNamespaceSchemaLocation="XYZ.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
:
:
</myxml>
I tried to set the attribute value after getting the attribute pointer from the node element as follows:
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" 