Skip to content

Gendarme.Rules.Correctness.ProvideValidXmlStringRule(2.10)

Sebastien Pouliot edited this page Jan 22, 2011 · 2 revisions

ProvideValidXmlStringRule

Assembly: Gendarme.Rules.Correctness
Version: 2.10

Description

This rule verifies that valid XML string arguments are passed as arguments.

Examples

Bad example (using LoadXml):

XmlDocument doc = new XmlDocument ();
doc.LoadXml ("<book>");

Good example (using LoadXml):

XmlDocument doc = new XmlDocument ();
doc.LoadXml ("<book />");

Bad example (using InnerXml):

bookElement.InnerXml = "<author>Robert J. Sawyer</authr>";

Good example (using InnerXml):

bookElement.InnerXml = "<author>Robert J. Sawyer</author>";

Notes

  • This rule is available since Gendarme 2.6
Clone this wiki locally