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
to
I tried to set the attribute value after getting the attribute pointer from the node element as follows:
The output shows "Attribute NOT found"
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"