The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
XmlParserContext Class
.NET Framework 2.0
Provides all the context information required by the XmlReader to parse an XML fragment.
Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)
Assembly: System.Xml (in system.xml.dll)
The following example creates an XmlReader object that reads an XML fragment.
string xmlFrag ="<item rk:ID='abc-23'>hammer</item> " + "<item rk:ID='r2-435'>paint</item>" + "<item rk:ID='abc-39'>saw</item>"; // Create the XmlNamespaceManager. NameTable nt = new NameTable(); XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); nsmgr.AddNamespace("rk", "urn:store-items"); // Create the XmlParserContext. XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); // Create the reader. XmlReaderSettings settings = new XmlReaderSettings(); settings.ConformanceLevel = ConformanceLevel.Fragment; XmlReader reader = XmlReader.Create(new StringReader(xmlFrag), settings, context);
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
Show: