Skip to content

Gendarme.Rules.Correctness.ProvideValidXmlStringRule(git)

Sebastien Pouliot edited this page Mar 2, 2011 · 1 revision

ProvideValidXmlStringRule

Assembly: Gendarme.Rules.Correctness
Version: git

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

Source code

You can browse the latest source code of this rule on github.com

Clone this wiki locally