asp.net - XML Property 'InnerText' is WriteOnly when trying to read attribute value -
i'm getting "property 'innertext' writeonly" error when trying read attribute value
here's xml:
<?xml version="1.0" encoding="utf-8"?> <products> <product id="11837"> <price currency="eur">75.29</price> <properties> <property name="brand"> <value></value> </property> </properties> <variations/> </product> </products>
to extract price do:
node.selectsinglenode("price").innertext
which returns "75.29"
but when do:
node.attributes("id").innertext
i error:
property 'innertext' writeonly
i don't see reason why it's write-only , don't know how can change can read value.
it's fact of implementation of xmlattribute
supports writing innertext
property. don't "change it" can read value - use value
property:
gets or sets value of node.
alternatively, can access value via innertext
if cast xmlattribute
xmlnode
(its base class).
Comments
Post a Comment