0 di 3 hanno valutato il contenuto utile: Valuta questo argomento

Classe XmlParserContext

Fornisce tutte le informazioni sul contesto richieste dalla classe XmlReader per analizzare un frammento XML.

Spazio dei nomi: System.Xml
Assembly: System.Xml (in system.xml.dll)

public class XmlParserContext
public class XmlParserContext
public class XmlParserContext

Nell'esempio riportato di seguito viene creato un oggetto XmlReader che legge un frammento XML.

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);


System.Object
  System.Xml.XmlParserContext
I membri statici pubblici (Shared in Visual Basic) di questo tipo sono validi per le operazioni multithreading. I membri di istanza non sono garantiti come thread safe.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile per Pocket PC, Windows Mobile per Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework non supporta tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema.

.NET Framework

Supportato in: 2.0 1.1 1.0

.NET Compact Framework

Supportato in: 2.0 1.0
Il documento è risultato utile?
(2000 caratteri rimanenti)
Contenuto della community Aggiungi