| JsonConvertDeserializeXmlNode Method (String, String, Boolean, Boolean) |
Deserializes the
XmlNode from a JSON string nested in a root element specified by
deserializeRootElementName,
writes a Json.NET array attribute for collections, and encodes special characters.
Namespace:
Newtonsoft.Json
Assembly:
Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db
Syntax public static XmlDocument DeserializeXmlNode(
string value,
string deserializeRootElementName,
bool writeArrayAttribute,
bool encodeSpecialCharacters
)
Parameters
- value
- Type: SystemString
The JSON string. - deserializeRootElementName
- Type: SystemString
The name of the root element to append when deserializing. - writeArrayAttribute
- Type: SystemBoolean
A value to indicate whether to write the Json.NET array attribute.
This attribute helps preserve arrays when converting the written XML back to JSON.
- encodeSpecialCharacters
- Type: SystemBoolean
A value to indicate whether to encode special characters when converting JSON to XML.
If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify
XML namespaces, attributes or processing directives. Instead special characters are encoded and written
as part of the XML element name.
Return Value
Type:
XmlDocumentThe deserialized
XmlNode.
See Also