# Help in libxml++ for Linux

**URL:** <https://community.unix.com/t/help-in-libxml-for-linux/292302>\
**Category:** Programming\
**Created:** [July 26, 2011, 11:13pm UTC](https://community.unix.com/t/help-in-libxml-for-linux/292302 "2011-07-26T23:13:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanlccc](https://community.unix.com/letter_avatar/tanlccc/32/6_449c533f586939b6e5f246632a46421f.png) [@tanlccc](https://community.unix.com/u/tanlccc)\
**Post date:** [July 26, 2011, 11:13pm UTC](https://community.unix.com/t/help-in-libxml-for-linux/292302/1 "2011-07-26T23:13:50Z")

</div>

Hi,

Using libxml++-2.6, is it possible to change the xsi:noNamespaceSchemaLocation in the root element node?  
e.g.  
from

```nohighlight
<myxml xsi:noNamespaceSchemaLocation="ABC.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   :
   :
</myxml>

```

to

```nohighlight
<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:

```nohighlight
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" 😕

---

<div class="post-metadata">

**Author:** ![fpmurphy](https://community.unix.com/user_avatar/community.unix.com/fpmurphy/32/110_2.png) [@fpmurphy](https://community.unix.com/u/fpmurphy)\
**Post date:** [July 27, 2011, 11:43am UTC](https://community.unix.com/t/help-in-libxml-for-linux/292302/2 "2011-07-27T11:43:23Z")

</div>

I am not familiar with libxml++ but am very familiar with libxml. It looks like you are using the wrong method to access the namespace nodes as far as libxml is concerned.

I understand that libxml++ is simply a C++ wrapper around libxml. I glanced at the libxml++ API documentation and as far as I can see libxml++ does not provide wrappers for the libxml namespace APIs. I could be wrong - I only spent a few minutes looking for namespace manipulation methods. You should examine the limxml++ documentation yourself carefully.
