Suppose I have the following XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pathto/xsd/meta.xsd">
<baar name="metaName"></baar>
</foo>
How to add attribute visible="false" to the node <baar>?
I tried the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xchange xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pathto/xsd/xchange.xsd" location="@super">
<insert xpath="/foo/baar/@visible" visible="false">
</insert>
</xchange>
But it does not work.
xchangeis because it's not well-known, and XPath alone does not manipulate XML; it selects from XML.