diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CPP/source.cpp
deleted file mode 100644
index 1f39979cb87..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CPP/source.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a deep clone. The cloned node
- //includes the child node.
- XmlDocument^ deep = dynamic_cast(doc->CloneNode( true ));
- Console::WriteLine( deep->ChildNodes->Count );
-
- //Create a shallow clone. The cloned node does not
- //include the child node.
- XmlDocument^ shallow = dynamic_cast(doc->CloneNode( false ));
- Console::WriteLine( "{0}{1}", shallow->Name, shallow->OuterXml );
- Console::WriteLine( shallow->ChildNodes->Count );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CPP/source.cpp
deleted file mode 100644
index e1c7160ac1f..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create an attribute.
- XmlAttribute^ attr = doc->CreateAttribute( "publisher" );
- attr->Value = "WorldWide Publishing";
-
- //Add the new node to the document.
- doc->DocumentElement->SetAttributeNode( attr );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CPP/source.cpp
deleted file mode 100644
index b99d05865e3..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a CData section.
- XmlCDataSection^ CData;
- CData = doc->CreateCDataSection( "All Jane Austen novels 25% off starting 3/23!" );
-
- //Add the new node to the document.
- XmlElement^ root = doc->DocumentElement;
- root->AppendChild( CData );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CPP/source.cpp
deleted file mode 100644
index de2b9a3e426..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a comment.
- XmlComment^ newComment;
- newComment = doc->CreateComment( "Sample XML document" );
-
- //Add the new node to the document.
- XmlElement^ root = doc->DocumentElement;
- doc->InsertBefore( newComment, root );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CPP/source.cpp
deleted file mode 100644
index 43a191e3ad8..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CPP/source.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "" );
-
- //Create a document fragment.
- XmlDocumentFragment^ docFrag = doc->CreateDocumentFragment();
-
- //Set the contents of the document fragment.
- docFrag->InnerXml = "- widget
";
-
- //Add the children of the document fragment to the
- //original document.
- doc->DocumentElement->AppendChild( docFrag );
- Console::WriteLine( "Display the modified XML..." );
- Console::WriteLine( doc->OuterXml );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CPP/source.cpp
deleted file mode 100644
index 9ef82e4bbe0..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CPP/source.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
-
- //Create a document type node and
- //add it to the document.
- XmlDocumentType^ doctype;
- doctype = doc->CreateDocumentType( "book", nullptr, nullptr, "" );
- doc->AppendChild( doctype );
-
- //Create the root element and
- //add it to the document.
- doc->AppendChild( doc->CreateElement( "book" ) );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/CPP/source.cpp
deleted file mode 100644
index 75a61a9cebf..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/CPP/source.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a new node and add it to the document.
- //The text node is the content of the price element.
- XmlElement^ elem = doc->CreateElement( "price" );
- XmlText^ text = doc->CreateTextNode( "19.95" );
- doc->DocumentElement->AppendChild( elem );
- doc->DocumentElement->LastChild->AppendChild( text );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/CPP/source.cpp
deleted file mode 100644
index 726fefbd045..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- // Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- String^ xmlData = "";
- doc->Load( gcnew StringReader( xmlData ) );
-
- // Create a new element and add it to the document.
- XmlElement^ elem = doc->CreateElement( "bk", "genre", "urn:samples" );
- elem->InnerText = "fantasy";
- doc->DocumentElement->AppendChild( elem );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CPP/source.cpp
deleted file mode 100644
index 7bf73f8915c..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CPP/source.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "]>Pride And Prejudice" );
-
- //Create an entity reference node. The child count should be 0
- //since the node has not been expanded.
- XmlEntityReference^ entityref = doc->CreateEntityReference( "h" );
- Console::WriteLine( entityref->ChildNodes->Count );
-
- //After the node has been added to the document, its parent node
- //is set and the entity reference node is expanded. It now has a child
- //node containing the entity replacement text.
- doc->DocumentElement->LastChild->AppendChild( entityref );
- Console::WriteLine( entityref->FirstChild->InnerText );
-
- //Create and insert an undefined entity reference node. When the entity
- //reference node is expanded, because the entity reference is undefined
- //the child is an empty text node.
- XmlEntityReference^ entityref2 = doc->CreateEntityReference( "p" );
- doc->DocumentElement->LastChild->AppendChild( entityref2 );
- Console::WriteLine( entityref2->FirstChild->InnerText );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CPP/source.cpp
deleted file mode 100644
index 8a885ff4f33..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a new node and add it to the document.
- XmlNode^ elem = doc->CreateNode( XmlNodeType::Element, "price", nullptr );
- elem->InnerText = "19.95";
- doc->DocumentElement->AppendChild( elem );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CPP/source.cpp
deleted file mode 100644
index e638f3db6fd..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode1 Example/CPP/source.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( " Oberon's Legacy 5.95" );
-
- // Create a new element node.
- XmlNode^ newElem = doc->CreateNode( "element", "pages", "" );
- newElem->InnerText = "290";
- Console::WriteLine( "Add the new element to the document..." );
- XmlElement^ root = doc->DocumentElement;
- root->AppendChild( newElem );
- Console::WriteLine( "Display the modified XML document..." );
- Console::WriteLine( doc->OuterXml );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CPP/source.cpp
deleted file mode 100644
index a51f50b4f52..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CPP/source.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( " Oberon's Legacy 5.95" );
-
- // Create a new element node.
- XmlNode^ newElem;
- newElem = doc->CreateNode( XmlNodeType::Element, "g" , "ISBN" , "https://global.ISBN/list" );
- newElem->InnerText = "1-861001-57-5";
-
- // Add the new element to the document
- XmlElement^ root = doc->DocumentElement;
- root->AppendChild( newElem );
-
- // Display the modified XML document
- Console::WriteLine( doc->OuterXml );
-
- // Output:
- // Oberon's Legacy5.951-861001-57-5
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp
deleted file mode 100644
index 27a969f9685..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
-
- // Create a procesing instruction.
- XmlProcessingInstruction^ newPI;
- String^ PItext = "type='text/xsl' href='book.xsl'";
- newPI = doc->CreateProcessingInstruction( "xml-stylesheet", PItext );
-
- // Display the target and data information.
- Console::WriteLine( "{0} {1}?>", newPI->Target, newPI->Data );
-
- // Add the processing instruction node to the document.
- doc->AppendChild( newPI );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CPP/source.cpp
deleted file mode 100644
index 4817ff6ccf4..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "EvaCorets" );
- Console::WriteLine( "InnerText before..." );
- Console::WriteLine( doc->DocumentElement->InnerText );
-
- // Add white space.
- XmlNode^ currNode = doc->DocumentElement;
- XmlSignificantWhitespace^ sigws = doc->CreateSignificantWhitespace( "\t" );
- currNode->InsertAfter( sigws, currNode->FirstChild );
- Console::WriteLine();
- Console::WriteLine( "InnerText after..." );
- Console::WriteLine( doc->DocumentElement->InnerText );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CPP/source.cpp
deleted file mode 100644
index 7eeb3da5079..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "EvaCorets" );
- Console::WriteLine( "InnerText before..." );
- Console::WriteLine( doc->DocumentElement->InnerText );
-
- // Add white space.
- XmlNode^ currNode = doc->DocumentElement;
- XmlWhitespace^ ws = doc->CreateWhitespace( "\r\n" );
- currNode->InsertAfter( ws, currNode->FirstChild );
- Console::WriteLine();
- Console::WriteLine( "InnerText after..." );
- Console::WriteLine( doc->DocumentElement->InnerText );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CPP/source.cpp
deleted file mode 100644
index af70be8e025..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create an XML declaration.
- XmlDeclaration^ xmldecl;
- xmldecl = doc->CreateXmlDeclaration( "1.0", nullptr, nullptr );
-
- //Add the new node to the document.
- XmlElement^ root = doc->DocumentElement;
- doc->InsertBefore( xmldecl, root );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentElement Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentElement Example/CPP/source.cpp
deleted file mode 100644
index ee5192065b7..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentElement Example/CPP/source.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Display the document element.
- Console::WriteLine( doc->DocumentElement->OuterXml );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/CPP/source.cpp
deleted file mode 100644
index 3240940efc2..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- // Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "]>"
- ""
- "Pride And Prejudice"
- ""
- "" );
-
- // Display the DocumentType.
- Console::WriteLine( doc->DocumentType->OuterXml );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CPP/source.cpp
deleted file mode 100644
index f9842a8ef80..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
- XmlDocument^ doc = gcnew XmlDocument;
- doc->Load( "ids.xml" );
-
- //Get the first element with an attribute of type ID and value of A111.
- //This displays the node .
- XmlElement^ elem = doc->GetElementById( "A111" );
- Console::WriteLine( elem->OuterXml );
-
- //Get the first element with an attribute of type ID and value of A222.
- //This displays the node .
- elem = doc->GetElementById( "A222" );
- Console::WriteLine( elem->OuterXml );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CPP/source.cpp
deleted file mode 100644
index 3c1265c6b3c..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CPP/source.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-
-int main()
-{
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->Load( "books.xml" );
-
- //Display all the book titles.
- XmlNodeList^ elemList = doc->GetElementsByTagName( "title" );
- for ( int i = 0; i < elemList->Count; i++ )
- {
- Console::WriteLine( elemList[ i ]->InnerXml );
- }
-}
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/CPP/source.cpp
deleted file mode 100644
index df8b7f49438..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/CPP/source.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#using
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::Xml;
-using namespace System::Xml::Xsl;
-using namespace System::Data;
-using namespace System::Windows::Forms;
-
-public ref class Form1: public Form
-{
-protected:
- DataSet^ dataset;
-
-public:
- void Method()
- {
-//
- XmlDocument^ doc1 = gcnew XmlDocument;
- doc1->Load( "books.xml" );
- XmlDocument^ doc2 = doc1->Implementation->CreateDocument();
-//
- }
-};
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CPP/source.cpp
deleted file mode 100644
index 2e836430e60..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CPP/source.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create another XmlDocument which holds a list of books.
- XmlDocument^ doc2 = gcnew XmlDocument;
- doc2->Load( "books.xml" );
-
- //Import the last book node from doc2 into the original document.
- XmlNode^ newBook = doc->ImportNode( doc2->DocumentElement->LastChild, true );
- doc->DocumentElement->AppendChild( newBook );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/CPP/source.cpp
deleted file mode 100644
index 893b4782d72..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "]>"
- ""
- "Pride And Prejudice"
- ""
- "" );
-
- //Check if the node is read-only.
- if ( doc->DocumentElement->LastChild->FirstChild->IsReadOnly )
- Console::WriteLine( "Entity reference nodes are always read-only" );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/CPP/source.cpp
deleted file mode 100644
index de9abc8d55b..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/CPP/source.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
-
- //Load the document with the last book node.
- XmlTextReader^ reader = gcnew XmlTextReader( "books.xml" );
- reader->WhitespaceHandling = WhitespaceHandling::None;
- reader->MoveToContent();
- reader->Read();
- reader->Skip(); //Skip the first book.
- reader->Skip(); //Skip the second book.
- doc->Load( reader );
- doc->Save( Console::Out );
-}
-
-//
-XmlDocument ^XMLDOMProcessing::XMLHelperMethods::LoadDocument(bool generateXML)
-{
-
- XmlDocument ^doc = gcnew XmlDocument();
- doc->PreserveWhitespace = true;
- try
- {doc->Load("booksData.xml");}
- catch (System::IO::FileNotFoundException ^e1)
- {
- // If no book is found, generate some XML.
-
- doc->LoadXml(" \n" +
- " \n" +
- " \n" +
- " Pride And Prejudice \n" +
- " 24.95 \n" +
- " \n" +
- " \n" +
- " The Handmaid's Tale \n" +
- " 29.95 \n" +
- " \n" +
- "");
- }
-
- return doc;
-}
\ No newline at end of file
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CPP/source.cpp
deleted file mode 100644
index e2a7b610d8e..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CPP/source.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
-
- // Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "- wrench
" );
-
- // Add a price element.
- XmlElement^ newElem = doc->CreateElement( "price" );
- newElem->InnerText = "10.95";
- doc->DocumentElement->AppendChild( newElem );
-
- // Save the document to a file and auto-indent the output.
- XmlTextWriter^ writer = gcnew XmlTextWriter( "data.xml", nullptr );
- writer->Formatting = Formatting::Indented;
- doc->Save( writer );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/CPP/source.cpp
deleted file mode 100644
index c2c17bfded5..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Load XML data which includes white space, but ignore
- //any white space in the file.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->PreserveWhitespace = false;
- doc->Load( "book.xml" );
-
- //Save the document as is (no white space).
- Console::WriteLine( "Display the modified XML..." );
- doc->PreserveWhitespace = true;
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CPP/source.cpp
deleted file mode 100644
index 5f22526fb55..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CPP/source.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "Pride And Prejudice" );
-
- //Create a reader.
- XmlTextReader^ reader = gcnew XmlTextReader( "cd.xml" );
- reader->MoveToContent(); //Move to the cd element node.
-
- //Create a node representing the cd element node.
- XmlNode^ cd = doc->ReadNode( reader );
-
- //Insert the new node into the document.
- doc->DocumentElement->AppendChild( cd );
- Console::WriteLine( "Display the modified XML..." );
- doc->Save( Console::Out );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CPP/source.cpp
deleted file mode 100644
index 2bfdcba7729..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CPP/source.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-int main()
-{
-
- // Create the XmlDocument.
- XmlDocument^ doc = gcnew XmlDocument;
- doc->LoadXml( "- wrench
" );
-
- // Add a price element.
- XmlElement^ newElem = doc->CreateElement( "price" );
- newElem->InnerText = "10.95";
- doc->DocumentElement->AppendChild( newElem );
-
- // Save the document to a file. White space is
- // preserved (no white space).
- doc->PreserveWhitespace = true;
- doc->Save( "data.xml" );
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/CPP/source.cpp
deleted file mode 100644
index a3dd876f834..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::Xml;
-using namespace System::Xml::Xsl;
-using namespace System::Data;
-using namespace System::Windows::Forms;
-
-//
-void WriteXml( XmlDocument^ doc )
-{
- XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out );
- writer->Formatting = Formatting::Indented;
- doc->WriteContentTo( writer );
- writer->Flush();
- Console::WriteLine();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/CPP/source.cpp
deleted file mode 100644
index 254d4e4b649..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/CPP/source.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-#using
-#using
-#using
-#using
-
-using namespace System;
-using namespace System::Xml;
-using namespace System::Xml::Xsl;
-using namespace System::Data;
-using namespace System::Windows::Forms;
-
-//
-void WriteXml( XmlDocument^ doc )
-{
- XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out );
- writer->Formatting = Formatting::Indented;
- doc->WriteTo( writer );
- writer->Flush();
- Console::WriteLine();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp
deleted file mode 100644
index ff06ae7ba94..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlValidatingReader^ reader = nullptr;
- try
- {
-
- //Create the string to parse.
- String^ xmlFrag = " ";
-
- //Create the XmlNamespaceManager.
- NameTable^ nt = gcnew NameTable;
- XmlNamespaceManager^ nsmgr = gcnew XmlNamespaceManager( nt );
-
- //Create the XmlParserContext.
- XmlParserContext^ context = gcnew XmlParserContext( nullptr,nsmgr,nullptr,XmlSpace::None );
-
- //Create the XmlValidatingReader .
- reader = gcnew XmlValidatingReader( xmlFrag,XmlNodeType::Element,context );
-
- //Read the attributes on the root element.
- reader->MoveToContent();
- if ( reader->HasAttributes )
- {
- for ( int i = 0; i < reader->AttributeCount; i++ )
- {
- reader->MoveToAttribute( i );
- Console::WriteLine( "{0} = {1}", reader->Name, reader->Value );
-
- }
- reader->MoveToElement();
- }
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CPP/source.cpp
deleted file mode 100644
index a62f1c24651..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CPP/source.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlValidatingReader^ reader = nullptr;
- XmlTextReader^ txtreader = nullptr;
- try
- {
-
- //Create the validating reader.
- txtreader = gcnew XmlTextReader( "http://localhost/uri.xml" );
- reader = gcnew XmlValidatingReader( txtreader );
- reader->ValidationType = ValidationType::None;
-
- //Parse the file and display the base URI for each node.
- while ( reader->Read() )
- {
- Console::WriteLine( "({0}) {1}", reader->NodeType, reader->BaseURI );
- }
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CPP/source.cpp
deleted file mode 100644
index 05e5e364a1d..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CPP/source.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the validating reader.
- XmlTextReader^ txtreader = gcnew XmlTextReader( "attrs.xml" );
- XmlValidatingReader^ reader = gcnew XmlValidatingReader( txtreader );
-
- //Read the ISBN attribute.
- reader->MoveToContent();
- String^ isbn = reader->GetAttribute( "ISBN" );
- Console::WriteLine( "The ISBN value: {0}", isbn );
-
- //Close the reader.
- reader->Close();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/CPP/source.cpp
deleted file mode 100644
index 2ce1e6eba01..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/CPP/source.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the validating reader.
- XmlTextReader^ txtreader = gcnew XmlTextReader( "book1.xml" );
- txtreader->WhitespaceHandling = WhitespaceHandling::None;
- XmlValidatingReader^ reader = gcnew XmlValidatingReader( txtreader );
- reader->ValidationType = ValidationType::None;
-
- //Parse the file and each node and its value.
- while ( reader->Read() )
- {
- if ( reader->HasValue )
- Console::WriteLine( "({0}) {1}={2}", reader->NodeType, reader->Name, reader->Value );
- else
- Console::WriteLine( "({0}) {1}", reader->NodeType, reader->Name );
- }
-
-
- //Close the reader.
- reader->Close();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp
deleted file mode 100644
index bd57e805816..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlTextReader^ txtreader = nullptr;
- XmlValidatingReader^ reader = nullptr;
- try
- {
-
- //Implement the readers.
- txtreader = gcnew XmlTextReader( "elems.xml" );
- reader = gcnew XmlValidatingReader( txtreader );
-
- //Parse the XML and display the text content of each of the elements.
- while ( reader->Read() )
- {
- if ( reader->IsStartElement() )
- {
- if ( reader->IsEmptyElement )
- Console::WriteLine( "<{0}/>", reader->Name );
- else
- {
- Console::Write( "<{0}> ", reader->Name );
- reader->Read(); //Read the start tag.
- if ( reader->IsStartElement() )
-
- //Handle nested elements.
- Console::Write( "\r\n<{0}>", reader->Name );
- Console::WriteLine( reader->ReadString() ); //Read the text content of the element.
- }
- }
- }
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp
deleted file mode 100644
index 3ce23489cc5..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlValidatingReader^ reader = nullptr;
- try
- {
-
- //Create the XML fragment to be parsed.
- String^ xmlFrag = "";
-
- //Create the XmlParserContext.
- XmlParserContext^ context;
- String^ subset = "";
- context = gcnew XmlParserContext( nullptr,nullptr,"book",nullptr,nullptr,subset,"","",XmlSpace::None );
-
- //Create the reader and set it to not expand general entities.
- reader = gcnew XmlValidatingReader( xmlFrag,XmlNodeType::Element,context );
- reader->ValidationType = ValidationType::None;
- reader->EntityHandling = EntityHandling::ExpandCharEntities;
-
- //Read the misc attribute. Because EntityHandling is set to
- //ExpandCharEntities, the attribute is parsed into multiple text
- //and entity reference nodes.
- reader->MoveToContent();
- reader->MoveToAttribute( "misc" );
- while ( reader->ReadAttributeValue() )
- {
- if ( reader->NodeType == XmlNodeType::EntityReference )
-
- //To expand the entity, call ResolveEntity.
- Console::WriteLine( "{0} {1}", reader->NodeType, reader->Name );
- else
- Console::WriteLine( "{0} {1}", reader->NodeType, reader->Value );
- }
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp
deleted file mode 100644
index cdcfa93664a..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
-
- //Create the validating reader.
- XmlTextReader^ txtreader = gcnew XmlTextReader( "attrs.xml" );
- XmlValidatingReader^ reader = gcnew XmlValidatingReader( txtreader );
-
- //Read the genre attribute.
- reader->MoveToContent();
- reader->MoveToFirstAttribute();
- String^ genre = reader->Value;
- Console::WriteLine( "The genre value: {0}", genre );
-
- //Close the reader.
- reader->Close();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp
deleted file mode 100644
index 805e896e1d7..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlTextReader^ txtreader = nullptr;
- XmlValidatingReader^ reader = nullptr;
- String^ filename = "items.xml";
- try
- {
-
- //Load the reader with the data file and ignore all white space nodes.
- txtreader = gcnew XmlTextReader( filename );
- txtreader->WhitespaceHandling = WhitespaceHandling::None;
-
- //Implement the validating reader over the text reader.
- reader = gcnew XmlValidatingReader( txtreader );
- reader->ValidationType = ValidationType::None;
-
- //Parse the file and display each of the nodes.
- while ( reader->Read() )
- {
- switch ( reader->NodeType )
- {
- case XmlNodeType::Element:
- Console::Write( "<{0}>", reader->Name );
- break;
-
- case XmlNodeType::Text:
- Console::Write( reader->Value );
- break;
-
- case XmlNodeType::CDATA:
- Console::Write( "", reader->Value );
- break;
-
- case XmlNodeType::ProcessingInstruction:
- Console::Write( "{0} {1}?>", reader->Name, reader->Value );
- break;
-
- case XmlNodeType::Comment:
- Console::Write( "", reader->Value );
- break;
-
- case XmlNodeType::XmlDeclaration:
- Console::Write( "" );
- break;
-
- case XmlNodeType::Document:
- break;
-
- case XmlNodeType::DocumentType:
- Console::Write( "Name, reader->Value );
- break;
-
- case XmlNodeType::EntityReference:
- Console::Write( reader->Name );
- break;
-
- case XmlNodeType::EndElement:
- Console::Write( "{0}>", reader->Name );
- break;
- }
- }
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp
deleted file mode 100644
index 233a1ec1a99..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-int main()
-{
- XmlValidatingReader^ reader = nullptr;
- XmlTextReader^ txtreader = nullptr;
- try
- {
-
- //Create and load the XmlTextReader with the XML file.
- txtreader = gcnew XmlTextReader( "book1.xml" );
- txtreader->WhitespaceHandling = WhitespaceHandling::None;
-
- //Create the XmlValidatingReader over the XmlTextReader.
- //Set the reader to not expand general entities.
- reader = gcnew XmlValidatingReader( txtreader );
- reader->ValidationType = ValidationType::None;
- reader->EntityHandling = EntityHandling::ExpandCharEntities;
- reader->MoveToContent(); //Move to the root element.
- reader->Read(); //Move to title start tag.
- reader->Skip(); //Skip the title element.
-
- //Read the misc start tag. The reader is now positioned on
- //the entity reference node.
- reader->ReadStartElement();
-
- //Because EntityHandling is set to ExpandCharEntities, you must call
- //ResolveEntity to expand the entity. The entity replacement text is
- //then parsed and returned as a child node.
- Console::WriteLine( "Expand the entity..." );
- reader->ResolveEntity();
- Console::WriteLine( "The entity replacement text is returned as a text node." );
- reader->Read();
- Console::WriteLine( "NodeType: {0} Value: {1}", reader->NodeType, reader->Value );
- Console::WriteLine( "An EndEntity node closes the entity reference scope." );
- reader->Read();
- Console::WriteLine( "NodeType: {0} Name: {1}", reader->NodeType, reader->Name );
- }
- finally
- {
- if ( reader != nullptr )
- reader->Close();
- }
-
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CPP/source.cpp
deleted file mode 100644
index 211a6e4604b..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CPP/source.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-//
-#using
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-using namespace System::Xml::Schema;
-
-public ref class SchemaCollectionSample
-{
-private:
- XmlTextReader^ reader;
- XmlValidatingReader^ vreader;
- Boolean m_success;
-
-public:
- SchemaCollectionSample()
- {
- reader = nullptr;
- vreader = nullptr;
- m_success = true;
-
- //Load the schema collection.
- XmlSchemaCollection^ xsc = gcnew XmlSchemaCollection;
- String^ schema = "books.xsd";
- String^ schema1 = "schema1.xdr";
- xsc->Add( "urn:bookstore-schema", schema ); //XSD schema
- xsc->Add( "urn:newbooks-schema", schema1 ); //XDR schema
- String^ doc1 = "booksSchema.xml";
- String^ doc2 = "booksSchemaFail.xml";
- String^ doc3 = "newbooks.xml";
-
- //Validate the files using schemas stored in the collection.
- Validate( doc1, xsc ); //Should pass.
- Validate( doc2, xsc ); //Should fail.
- Validate( doc3, xsc ); //Should fail.
- }
-
-
-private:
- void Validate( String^ filename, XmlSchemaCollection^ xsc )
- {
- m_success = true;
- Console::WriteLine();
- Console::WriteLine( "Validating XML file {0}...", filename );
- reader = gcnew XmlTextReader( filename );
-
- //Create a validating reader.
- vreader = gcnew XmlValidatingReader( reader );
-
- //Validate using the schemas stored in the schema collection.
- vreader->Schemas->Add( xsc );
-
- //Set the validation event handler
- vreader->ValidationEventHandler += gcnew ValidationEventHandler( this, &SchemaCollectionSample::ValidationCallBack );
-
- //Read and validate the XML data.
- while ( vreader->Read() )
- {}
-
- Console::WriteLine( "Validation finished. Validation {0}", (m_success == true ? (String^)"successful" : "failed") );
- Console::WriteLine();
-
- //Close the reader.
- vreader->Close();
- }
-
- void ValidationCallBack( Object^ /*sender*/, ValidationEventArgs^ args )
- {
- m_success = false;
- Console::Write( "\r\n\tValidation error: {0}", args->Message );
- }
-
-};
-
-int main()
-{
- gcnew SchemaCollectionSample;
-}
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CPP/source.cpp
deleted file mode 100644
index bb70d44f9ea..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CPP/source.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-using namespace System::Xml::Schema;
-public ref class Sample
-{
-private:
- XmlTextReader^ txtreader;
- XmlValidatingReader^ reader;
- Boolean m_success;
-
-public:
- Sample()
- {
- txtreader = nullptr;
- reader = nullptr;
- m_success = true;
-
- //Validate file against the XSD schema.
- //The validation should fail.
- Validate( "notValidXSD.xml" );
- }
-
-
-private:
- void Validate( String^ filename )
- {
- try
- {
- Console::WriteLine( "Validating XML file {0}", filename );
- txtreader = gcnew XmlTextReader( filename );
- reader = gcnew XmlValidatingReader( txtreader );
-
- // Set the validation event handler
- reader->ValidationEventHandler += gcnew ValidationEventHandler( this, &Sample::ValidationEventHandle );
-
- // Read XML data
- while ( reader->Read() )
- {}
- Console::WriteLine( "Validation finished. Validation {0}", (m_success == true ? (String^)"successful" : "failed") );
- }
- finally
- {
-
- //Close the reader.
- if ( reader != nullptr )
- reader->Close();
- }
-
- }
-
-
- //Display the validation error.
- void ValidationEventHandle( Object^ /*sender*/, ValidationEventArgs^ args )
- {
- m_success = false;
- Console::WriteLine( "\r\n\tValidation error: {0}", args->Message );
- }
-
-};
-
-int main()
-{
- gcnew Sample;
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CPP/source.cpp b/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CPP/source.cpp
deleted file mode 100644
index a803c48b3ad..00000000000
--- a/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CPP/source.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-//
-#using
-
-using namespace System;
-using namespace System::IO;
-using namespace System::Xml;
-using namespace System::Xml::Schema;
-public ref class Sample
-{
-private:
- XmlTextReader^ txtreader;
- XmlValidatingReader^ reader;
- Boolean m_success;
-
-public:
- Sample()
- {
- txtreader = nullptr;
- reader = nullptr;
- m_success = true;
- String^ doc1 = "notValid.xml";
- String^ doc2 = "cdDTD.xml";
- String^ doc3 = "book1.xml";
-
- //Parse the files and validate when requested.
- Validate( doc1, ValidationType::XDR ); //Validation should fail.
- Validate( doc2, ValidationType::DTD ); //Validation should fail.
- Validate( doc3, ValidationType::None ); //No validation performed.
- }
-
-
-private:
- void Validate( String^ filename, ValidationType vt )
- {
- try
- {
-
- //Implement the readers. Set the ValidationType.
- txtreader = gcnew XmlTextReader( filename );
- reader = gcnew XmlValidatingReader( txtreader );
- reader->ValidationType = vt;
-
- //If the reader is set to validate, set the event handler.
- if ( vt == ValidationType::None )
- Console::WriteLine( "\nParsing XML file {0}", filename );
- else
- {
- Console::WriteLine( "\nValidating XML file {0}", filename );
- m_success = true;
-
- //Set the validation event handler.
- reader->ValidationEventHandler += gcnew ValidationEventHandler( this, &Sample::ValidationCallBack );
- }
-
- // Read XML data
- while ( reader->Read() )
- {}
- if ( vt == ValidationType::None )
- Console::WriteLine( "Finished parsing file." );
- else
- Console::WriteLine( "Validation finished. Validation {0}", m_success ? (String^)"successful" : "failed" );
- }
- finally
- {
-
- //Close the reader.
- if ( reader != nullptr )
- reader->Close();
- }
-
- }
-
-
- //Display the validation errors.
- void ValidationCallBack( Object^ /*sender*/, ValidationEventArgs^ args )
- {
- m_success = false;
- Console::Write( "\r\n\tValidation error: {0}", args->Message );
- }
-
-};
-
-int main()
-{
- gcnew Sample;
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Data/XmlDocument.cctor/CPP/docload.cpp b/snippets/cpp/VS_Snippets_Data/XmlDocument.cctor/CPP/docload.cpp
deleted file mode 100644
index cf02bc534b8..00000000000
--- a/snippets/cpp/VS_Snippets_Data/XmlDocument.cctor/CPP/docload.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-#using
-
-using namespace System;
-using namespace System::Xml;
-using namespace System::Xml::Schema;
-
-ref class XmlDocumentSample
-{
-private:
- static XmlReader^ reader;
- static String^ filename = "bookdtd.xml";
-
- // Display the validation error.
- static void ValidationCallback(Object^ sender, ValidationEventArgs^ args)
- {
- Console::WriteLine("Validation error loading: {0}", filename);
- Console::WriteLine(args->Message);
- }
-
-public:
- static void Main()
- {
- ValidationEventHandler^ eventHandler = gcnew ValidationEventHandler(XmlDocumentSample::ValidationCallback);
-
- try
- {
- // Create the validating reader and specify DTD validation.
- XmlReaderSettings^ settings = gcnew XmlReaderSettings();
- settings->DtdProcessing = DtdProcessing::Parse;
- settings->ValidationType = ValidationType::DTD;
- settings->ValidationEventHandler += eventHandler;
-
- reader = XmlReader::Create(filename, settings);
-
- // Pass the validating reader to the XML document.
- // Validation fails due to an undefined attribute, but the
- // data is still loaded into the document.
- XmlDocument^ doc = gcnew XmlDocument();
- doc->Load(reader);
- Console::WriteLine(doc->OuterXml);
- }
- finally
- {
- if (reader != nullptr)
- reader->Close();
- }
- }
-};
-
-int main()
-{
- XmlDocumentSample::Main();
- return 0;
-}
-//
\ No newline at end of file
diff --git a/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp b/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp
deleted file mode 100644
index 6f24d42284f..00000000000
--- a/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-
-//
-#using
-
-using namespace System;
-using namespace System::Net;
-using namespace System::Net::Security;
-using namespace System::Net::Sockets;
-using namespace System::Security::Authentication;
-using namespace System::Security::Principal;
-using namespace System::Text;
-using namespace System::IO;
-using namespace System::Threading;
-
-// ClientState is the AsyncState object.
-private ref class ClientState
-{
-private:
- AuthenticatedStream^ authStream;
- TcpClient^ client;
- array^buffer;
- StringBuilder^ message;
- ManualResetEvent^ waiter;
-
-internal:
- ClientState( AuthenticatedStream^ a, TcpClient^ theClient )
- {
- authStream = a;
- client = theClient;
- message = nullptr;
- buffer = gcnew array(2048);
- waiter = gcnew ManualResetEvent( false );
- }
-
-internal:
- property TcpClient^ Client
- {
- TcpClient^ get()
- {
- return client;
- }
- }
-
- property AuthenticatedStream^ AuthStream
- {
- AuthenticatedStream^ get()
- {
- return authStream;
- }
- }
-
- property array^ Buffer
- {
- array^ get()
- {
- return buffer;
- }
-
- }
-
- property StringBuilder^ Message
- {
- StringBuilder^ get()
- {
- if ( message == nullptr )
- message = gcnew StringBuilder;
-
- return message;
- }
-
- }
-
- property ManualResetEvent^ Waiter
- {
- ManualResetEvent^ get()
- {
- return waiter;
- }
-
- }
-
-};
-
-public ref class AsynchronousAuthenticatingTcpListener
-{
-public:
- int Main()
- {
-
- // Create an IPv4 TCP/IP socket.
- TcpListener^ listener = gcnew TcpListener( IPAddress::Any,11000 );
-
- // Listen for incoming connections.
- listener->Start();
- while ( true )
- {
- TcpClient^ clientRequest = nullptr;
-
- // Application blocks while waiting for an incoming connection.
- // Type CNTL-C to terminate the server.
- clientRequest = listener->AcceptTcpClient();
- Console::WriteLine( L"Client connected." );
-
- // A client has connected.
- try
- {
- AuthenticateClient( clientRequest );
- }
- catch ( Exception^ e )
- {
- Console::WriteLine( e );
- continue;
- }
-
- }
- }
-
-
- //
- static void AuthenticateClient( TcpClient^ clientRequest )
- {
- NetworkStream^ stream = clientRequest->GetStream();
-
- // Create the NegotiateStream.
- NegotiateStream^ authStream = gcnew NegotiateStream( stream,false );
-
- // Save the current client and NegotiateStream instance
- // in a ClientState object.
- ClientState^ cState = gcnew ClientState( authStream,clientRequest );
-
- // Listen for the client authentication request.
- authStream->BeginAuthenticateAsServer( gcnew AsyncCallback( EndAuthenticateCallback ), cState );
-
- // Wait until the authentication completes.
- cState->Waiter->WaitOne();
- cState->Waiter->Reset();
- authStream->BeginRead( cState->Buffer, 0, cState->Buffer->Length, gcnew AsyncCallback( EndReadCallback ), cState );
- cState->Waiter->WaitOne();
-
- // Finished with the current client.
- authStream->Close();
- clientRequest->Close();
- }
-
-
- //
- // The following method is invoked by the
- // BeginServerAuthenticate callback delegate.
- //
- static void EndAuthenticateCallback( IAsyncResult^ ar )
- {
-
- // Get the saved data.
- ClientState^ cState = dynamic_cast(ar->AsyncState);
- TcpClient^ clientRequest = cState->Client;
- NegotiateStream^ authStream = dynamic_cast(cState->AuthStream);
- Console::WriteLine( L"Ending authentication." );
-
- // Any exceptions that occurred during authentication are
- // thrown by the EndServerAuthenticate method.
- try
- {
-
- // This call blocks until the authentication is complete.
- authStream->EndAuthenticateAsServer( ar );
- }
- catch ( AuthenticationException^ e )
- {
- Console::WriteLine( e );
- Console::WriteLine( L"Authentication failed - closing connection." );
- cState->Waiter->Set();
- return;
- }
- catch ( Exception^ e )
- {
- Console::WriteLine( e );
- Console::WriteLine( L"Closing connection." );
- cState->Waiter->Set();
- return;
- }
-
-
- // Display properties of the authenticated client.
- IIdentity^ id = authStream->RemoteIdentity;
- Console::WriteLine( L"{0} was authenticated using {1}.", id->Name, id->AuthenticationType );
- cState->Waiter->Set();
- }
-
-
- //
- //
- static void EndReadCallback( IAsyncResult^ ar )
- {
-
- // Get the saved data.
- ClientState^ cState = dynamic_cast(ar->AsyncState);
- TcpClient^ clientRequest = cState->Client;
- NegotiateStream^ authStream = dynamic_cast(cState->AuthStream);
-
- // Get the buffer that stores the message sent by the client.
- int bytes = -1;
-
- // Read the client message.
- try
- {
- bytes = authStream->EndRead( ar );
- cState->Message->Append( Encoding::UTF8->GetChars( cState->Buffer, 0, bytes ) );
- if ( bytes != 0 )
- {
- authStream->BeginRead( cState->Buffer, 0, cState->Buffer->Length, gcnew AsyncCallback( EndReadCallback ), cState );
- return;
- }
- }
- catch ( Exception^ e )
- {
-
- // A real application should do something
- // useful here, such as logging the failure.
- Console::WriteLine( L"Client message exception:" );
- Console::WriteLine( e );
- cState->Waiter->Set();
- return;
- }
-
- IIdentity^ id = authStream->RemoteIdentity;
- Console::WriteLine( L"{0} says {1}", id->Name, cState->Message );
- cState->Waiter->Set();
- }
-
- //
-};
-
-void main()
-{
- AsynchronousAuthenticatingTcpListener^ aatl = gcnew AsynchronousAuthenticatingTcpListener;
- aatl->Main();
-}
-
-//
diff --git a/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp b/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp
deleted file mode 100644
index 1a0a913e1d9..00000000000
--- a/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-
-//
-#using
-
-using namespace System;
-using namespace System::Net;
-using namespace System::Net::Security;
-using namespace System::Net::Sockets;
-using namespace System::Security::Principal;
-
-//
-static void DisplayStreamProperties( NegotiateStream^ stream )
-{
- Console::WriteLine( L"Can read: {0}", stream->CanRead );
- Console::WriteLine( L"Can write: {0}", stream->CanWrite );
- Console::WriteLine( L"Can seek: {0}", stream->CanSeek );
- try
- {
-
- // If the underlying stream supports it, display the length.
- Console::WriteLine( L"Length: {0}", stream->Length );
- }
- catch ( NotSupportedException^ )
- {
- Console::WriteLine( L"Cannot get the length of the underlying stream." );
- }
-
- if ( stream->CanTimeout )
- {
- Console::WriteLine( L"Read time-out: {0}", stream->ReadTimeout );
- Console::WriteLine( L"Write time-out: {0}", stream->WriteTimeout );
- }
-}
-
-
-//
-//
-static void DisplayAuthenticationProperties( NegotiateStream^ stream )
-{
- Console::WriteLine( L"IsAuthenticated: {0}", stream->IsAuthenticated );
- Console::WriteLine( L"IsMutuallyAuthenticated: {0}", stream->IsMutuallyAuthenticated );
- Console::WriteLine( L"IsEncrypted: {0}", stream->IsEncrypted );
- Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
- Console::WriteLine( L"ImpersonationLevel: {0}", stream->ImpersonationLevel );
- Console::WriteLine( L"IsServer: {0}", stream->IsServer );
-}
-
-
-//
-//
-int main()
-{
-
- //
- // Establish the remote endpoint for the socket.
- // For this example, use the local machine.
- IPHostEntry^ ipHostInfo = Dns::GetHostEntry( Dns::GetHostName() );
- IPAddress^ ipAddress = ipHostInfo->AddressList[ 0 ];
-
- // Client and server use port 11000.
- IPEndPoint^ remoteEP = gcnew IPEndPoint( ipAddress,11000 );
-
- // Create a TCP/IP socket.
- TcpClient^ client = gcnew TcpClient;
-
- // Connect the socket to the remote endpoint.
- client->Connect( remoteEP );
- Console::WriteLine( L"Client connected to {0}.", remoteEP );
-
- // Ensure the client does not close when there is
- // still data to be sent to the server.
- client->LingerState = (gcnew LingerOption( true,0 ));
-
- // Request authentication.
- NetworkStream^ clientStream = client->GetStream();
- NegotiateStream^ authStream = gcnew NegotiateStream( clientStream );
-
- // Request authentication for the client only (no mutual authentication).
- // Authenicate using the client's default credetials.
- // Permit the server to impersonate the client to access resources on the server only.
- // Request that data be transmitted using encryption and data signing.
- authStream->AuthenticateAsClient( dynamic_cast(CredentialCache::DefaultCredentials),
- L"",
- ProtectionLevel::EncryptAndSign,
- TokenImpersonationLevel::Impersonation );
-
- //
- DisplayAuthenticationProperties( authStream );
- DisplayStreamProperties( authStream );
- if ( authStream->CanWrite )
- {
-
- // Encode the test data into a byte array.
- array^message = System::Text::Encoding::UTF8->GetBytes( L"Hello from the client." );
- authStream->Write( message, 0, message->Length );
- authStream->Flush();
- Console::WriteLine( L"Sent {0} bytes.", message->Length );
- }
-
-
- // Close the client connection.
- authStream->Close();
- Console::WriteLine( L"Client closed." );
-}
-
-//
-//
diff --git a/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncServer/CPP/NclNegoSyncServer.cpp b/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncServer/CPP/NclNegoSyncServer.cpp
deleted file mode 100644
index b02ceda8bc7..00000000000
--- a/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncServer/CPP/NclNegoSyncServer.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-
-#using
-
-using namespace System;
-using namespace System::Net;
-using namespace System::Net::Security;
-using namespace System::Net::Sockets;
-using namespace System::Security::Principal;
-using namespace System::Text;
-using namespace System::IO;
-using namespace System::Threading;
-
-//
-static void AuthenticateClient( TcpClient^ clientRequest )
-{
- NetworkStream^ stream = clientRequest->GetStream();
-
- // Create the NegotiateStream.
- NegotiateStream^ authStream = gcnew NegotiateStream( stream,false );
-
- // Perform the server side of the authentication.
- authStream->AuthenticateAsServer();
-
- // Display properties of the authenticated client.
- IIdentity^ id = authStream->RemoteIdentity;
- Console::WriteLine( L"{0} was authenticated using {1}.", id->Name, id->AuthenticationType );
-
- // Read a message from the client.
- array^buffer = gcnew array(2048);
- int charLength = authStream->Read( buffer, 0, buffer->Length );
- String^ messageData = gcnew String( Encoding::UTF8->GetChars( buffer, 0, buffer->Length ) );
- Console::WriteLine( L"READ {0}", messageData );
-
- // Finished with the current client.
- authStream->Close();
-
- // Close the client connection.
- clientRequest->Close();
-}
-
-
-//
-int main()
-{
-
- // Create an IPv4 TCP/IP socket.
- TcpListener^ listener = gcnew TcpListener( IPAddress::Any,11000 );
-
- // Listen for incoming connections.
- listener->Start();
- while ( true )
- {
- TcpClient^ clientRequest = nullptr;
-
- // Application blocks while waiting for an incoming connection.
- // Type CNTL-C to terminate the server.
- clientRequest = listener->AcceptTcpClient();
-
- // A client has connected.
- try
- {
- AuthenticateClient( clientRequest );
- }
- catch ( Exception^ e )
- {
- Console::WriteLine( e );
- continue;
- }
-
- Console::WriteLine( L"Client connected." );
- }
-}
-
diff --git a/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp b/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp
deleted file mode 100644
index 8a961ac9aff..00000000000
--- a/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-
-//
-#using
-
-using namespace System;
-using namespace System::Net;
-using namespace System::Net::Security;
-using namespace System::Net::Sockets;
-using namespace System::Text;
-
-//
-// The following class displays the properties of an authenticatedStream.
-public ref class AuthenticatedStreamReporter
-{
-public:
- static void DisplayProperties( AuthenticatedStream^ stream )
- {
- Console::WriteLine( L"IsAuthenticated: {0}", stream->IsAuthenticated );
- Console::WriteLine( L"IsMutuallyAuthenticated: {0}", stream->IsMutuallyAuthenticated );
- Console::WriteLine( L"IsEncrypted: {0}", stream->IsEncrypted );
- Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
- Console::WriteLine( L"IsServer: {0}", stream->IsServer );
- }
-
-};
-
-
-//
-public ref class ASynchronousAuthenticatingTcpClient
-{
-private:
- static TcpClient^ client = nullptr;
-
-public:
- void Main()
- {
-
- //
- //
- // Establish the remote endpoint for the socket.
- // For this example, use the local machine.
- IPHostEntry^ ipHostInfo = Dns::GetHostEntry( Dns::GetHostName() );
- IPAddress^ ipAddress = ipHostInfo->AddressList[ 0 ];
-
- // Client and server use port 11000.
- IPEndPoint^ remoteEP = gcnew IPEndPoint( ipAddress,11000 );
-
- // Create a TCP/IP socket.
- client = gcnew TcpClient;
-
- // Connect the socket to the remote endpoint.
- client->Connect( remoteEP );
- Console::WriteLine( L"Client connected to {0}.", remoteEP );
-
- // Ensure the client does not close when there is
- // still data to be sent to the server.
- client->LingerState = (gcnew LingerOption( true,0 ));
-
- //
- // Request authentication.
- NetworkStream^ clientStream = client->GetStream();
- NegotiateStream^ authStream = gcnew NegotiateStream( clientStream,false );
-
- //
- // Pass the NegotiateStream as the AsyncState object
- // so that it is available to the callback delegate.
- IAsyncResult^ ar = authStream->BeginAuthenticateAsClient( gcnew AsyncCallback( EndAuthenticateCallback ), authStream );
-
- //
- Console::WriteLine( L"Client waiting for authentication..." );
-
- // Wait until the result is available.
- ar->AsyncWaitHandle->WaitOne();
-
- // Display the properties of the authenticated stream.
- AuthenticatedStreamReporter::DisplayProperties( authStream );
-
- // Send a message to the server.
- // Encode the test data into a byte array.
- array^message = Encoding::UTF8->GetBytes( L"Hello from the client." );
- ar = authStream->BeginWrite( message, 0, message->Length, gcnew AsyncCallback( EndWriteCallback ), authStream );
-
- //
- ar->AsyncWaitHandle->WaitOne();
- Console::WriteLine( L"Sent {0} bytes.", message->Length );
-
- // Close the client connection.
- authStream->Close();
- Console::WriteLine( L"Client closed." );
- }
-
-
- //
- // The following method is called when the authentication completes.
- static void EndAuthenticateCallback( IAsyncResult^ ar )
- {
- Console::WriteLine( L"Client ending authentication..." );
- NegotiateStream^ authStream = dynamic_cast(ar->AsyncState);
-
- // End the asynchronous operation.
- authStream->EndAuthenticateAsClient( ar );
-
- // Console.WriteLine("AllowedImpersonation: {0}", authStream.AllowedImpersonation);
- }
-
-
- //
- //
- // The following method is called when the write operation completes.
- static void EndWriteCallback( IAsyncResult^ ar )
- {
- Console::WriteLine( L"Client ending write operation..." );
- NegotiateStream^ authStream = dynamic_cast(ar->AsyncState);
-
- // End the asynchronous operation.
- authStream->EndWrite( ar );
- }
-
- //
-};
-
-void main()
-{
- ASynchronousAuthenticatingTcpClient^ aatc = gcnew ASynchronousAuthenticatingTcpClient;
- aatc->Main();
-}
-//
-
diff --git a/xml/System.Net.Security/AuthenticatedStream.xml b/xml/System.Net.Security/AuthenticatedStream.xml
index 66238e3686c..78a5daa35b3 100644
--- a/xml/System.Net.Security/AuthenticatedStream.xml
+++ b/xml/System.Net.Security/AuthenticatedStream.xml
@@ -59,12 +59,9 @@
The security protocol implemented by a class that derives from together with the security protocols supported on the client and server will determine the security features that are available to an application. The and classes inherit from and implement the Negotiate and Secure Sockets Layer security protocols, respectively.
-
-
## Examples
The following example demonstrates displaying the properties of an authenticated stream.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
@@ -336,12 +333,9 @@ The following example demonstrates displaying the properties of an authenticated
## Remarks
The methods called to perform authentication are defined in the classes that inherit from .
-
-
## Examples
The following example demonstrates displaying the value of this property.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
@@ -394,12 +388,9 @@ The following example demonstrates displaying the value of this property.
## Remarks
Encryption helps to protect the privacy of the data; namely, it helps to ensure that while data is in transit, it cannot be deciphered by third parties.
-
-
## Examples
The following example demonstrates displaying the value of this property.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
@@ -452,12 +443,9 @@ The following example demonstrates displaying the value of this property.
## Remarks
Not all security protocols support mutual authentication. To determine whether mutual authentication is supported by the security protocol implemented in a class that inherits from , check the class documentation.
-
-
## Examples
The following example demonstrates displaying the value of this property.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
@@ -510,12 +498,9 @@ The following example demonstrates displaying the value of this property.
## Remarks
Most security protocols used for client-server authentication define specific behavior and requirements for supplying credentials for authentication based on whether you are the client or the server.
-
-
## Examples
The following example demonstrates displaying the value of this property.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
@@ -568,12 +553,9 @@ The following example demonstrates displaying the value of this property.
## Remarks
Data signing helps to protect the integrity of the data; namely, it helps the recipient determine whether the data has been tampered with while in transit.
-
-
## Examples
The following example demonstrates displaying the value of this property.
-:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb" id="Snippet6":::
diff --git a/xml/System.Net.Security/NegotiateStream.xml b/xml/System.Net.Security/NegotiateStream.xml
index 350ed0ef56c..c33c59a773c 100644
--- a/xml/System.Net.Security/NegotiateStream.xml
+++ b/xml/System.Net.Security/NegotiateStream.xml
@@ -59,11 +59,9 @@
## Remarks
Use the class for authentication and to help secure information transmitted between a client and a server. Using , you can do the following.
-- Send the client's credentials to the server for Impersonation or Delegation.
-
-- Request server authentication.
-
-- Encrypt and/or sign data before transmitting it.
+- Send the client's credentials to the server for Impersonation or Delegation.
+- Request server authentication.
+- Encrypt and/or sign data before transmitting it.
Authentication must be performed before transmitting information. Clients request authentication using the synchronous methods, which block until the authentication completes, or the asynchronous methods, which do not block while waiting for the authentication to complete. Servers request authentication using the synchronous or asynchronous methods. The client, and optionally the server, is authenticated using the Negotiate security protocol. The Kerberos protocol is used for authentication if both client and server support it; otherwise NTLM is used. The class performs the authentication using the Security Support Provider Interface (SSPI).
@@ -75,18 +73,15 @@
The transmits data using a stream that you supply when creating the . When you supply this underlying stream, you have the option to specify whether closing the also closes the underlying stream.
-
-
## Examples
+
The following example demonstrates the client side of a client-server connection that uses the . The client authenticates and sends a message to the server asynchronously.
-[!code-cpp[NclNegoAsyncClient#0](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#0)]
[!code-csharp[NclNegoAsyncClient#0](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#0)]
[!code-vb[NclNegoAsyncClient#0](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#0)]
The following code example demonstrates the server side of a client-server connection that uses the to authenticate the client and read a message sent by the client.
-[!code-cpp[NclNegoAsyncServer#0](~/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp#0)]
[!code-csharp[NclNegoAsyncServer#0](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#0)]
]]>
@@ -159,9 +154,9 @@ The following code example demonstrates the server side of a client-server conne
@@ -216,9 +211,9 @@ The following code example demonstrates the server side of a client-server conne
When you specify `true` for the `leaveStreamOpen` parameter, closing the has no effect on the `innerStream` stream; you must explicitly close `innerStream` when you no longer need it.
## Examples
+
The following example demonstrates calling this constructor. This code example is part of a larger example provided for the class.
-[!code-cpp[NclNegoAsyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#1)]
[!code-csharp[NclNegoAsyncClient#1](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#1)]
[!code-vb[NclNegoAsyncClient#1](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#1)]
@@ -1700,12 +1695,10 @@ The following example demonstrates calling this constructor. This code example i
If the authentication fails, you receive an or an . In this case, you can retry the authentication with a different credential.
-
-
## Examples
+
The following example demonstrates calling this method to begin an asynchronous authentication for the client.
-[!code-cpp[NclNegoAsyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#2)]
[!code-csharp[NclNegoAsyncClient#2](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#2)]
[!code-vb[NclNegoAsyncClient#2](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#2)]
@@ -2576,12 +2569,10 @@ The following example demonstrates calling this method to begin an asynchronous
You cannot call this method until you have successfully authenticated. To authenticate, call one of the , , , , , or methods.
-
-
## Examples
+
The following code example demonstrates starting an asynchronous read operation. This code example is part of a larger example provided for the class.
- [!code-cpp[NclNegoAsyncServer#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp#1)]
[!code-csharp[NclNegoAsyncServer#1](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#1)]
]]>
@@ -2686,18 +2677,15 @@ The following example demonstrates calling this method to begin an asynchronous
You cannot call this method until you have successfully authenticated. To authenticate, call one of the , , , , , or methods.
-
-
## Examples
+
The following example demonstrates beginning an asynchronous write operation.
-[!code-cpp[NclNegoAsyncClient#3](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#3)]
[!code-csharp[NclNegoAsyncClient#3](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#3)]
[!code-vb[NclNegoAsyncClient#3](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#3)]
The following method is called when the operation completes.
-[!code-cpp[NclNegoAsyncClient#4](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#4)]
[!code-csharp[NclNegoAsyncClient#4](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#4)]
[!code-vb[NclNegoAsyncClient#4](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#4)]
@@ -2770,13 +2758,11 @@ The following method is called when the operation completes.
## Remarks
If successful authentication has occurred, this property returns the value returned by invoking the property on the underlying stream. The underlying stream is specified when you create an instance of the class.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -2826,13 +2812,11 @@ The following method is called when the operation completes.
## Remarks
You should not attempt to set the position of the object or its underlying stream. The underlying stream is specified when you create an instance of the class.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -2887,10 +2871,10 @@ The following method is called when the operation completes.
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -2944,10 +2928,10 @@ The following method is called when the operation completes.
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -3231,13 +3215,11 @@ The following method is called when the operation completes.
You cannot call this method until you have successfully authenticated. To authenticate, call one of the , , , , , or methods.
-
-
## Examples
- The following code example demonstrates ending an asynchronous read operation. For an example that demonstrates starting the operation, see .
- [!code-cpp[NclNegoAsyncServer#3](~/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp#3)]
- [!code-csharp[NclNegoAsyncServer#3](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#3)]
+The following code example demonstrates ending an asynchronous read operation. For an example that demonstrates starting the operation, see .
+
+[!code-csharp[NclNegoAsyncServer#3](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#3)]
]]>
@@ -3302,12 +3284,10 @@ Authentication has not occurred.
To perform this operation synchronously, use the method.
-
-
## Examples
+
The following example demonstrates a method that is called to complete the asynchronous write operation. For an example that demonstrates starting the operation, see .
-[!code-cpp[NclNegoAsyncClient#4](~/snippets/cpp/VS_Snippets_Remoting/NclNegoasyncClient/CPP/NclNegoasyncClient.cpp#4)]
[!code-csharp[NclNegoAsyncClient#4](~/snippets/csharp/System.Net.Security/AuthenticatedStream/Overview/client.cs#4)]
[!code-vb[NclNegoAsyncClient#4](~/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb#4)]
@@ -3368,13 +3348,11 @@ Authentication has not occurred.
## Remarks
This method invokes on the underlying stream.
-
-
## Examples
- The following code example demonstrates flushing the stream.
- [!code-cpp[NclNegoSyncClient#4](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#4)]
- [!code-csharp[NclNegoSyncClient#4](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#4)]
+The following code example demonstrates flushing the stream.
+
+[!code-csharp[NclNegoSyncClient#4](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#4)]
]]>
@@ -3471,13 +3449,11 @@ Authentication has not occurred.
## Remarks
You must successfully authenticate before calling this method. Clients specify the impersonation level when they request authentication by calling one of the or methods. If you authenticate without specifying a , is used.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3529,13 +3505,11 @@ Authentication has not occurred.
## Remarks
Clients authenticate by calling the or methods. Servers authenticate by calling the or methods.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3586,13 +3560,11 @@ Authentication has not occurred.
## Remarks
Encryption helps to protect the privacy of the data; namely, it helps to ensure that while data is in transit it cannot be deciphered by third parties.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3646,13 +3618,11 @@ Authentication has not occurred.
The Negotiate protocol selects either NTLM or Kerberos depending on the security protocols supported by the client and server. NTLM does not support mutual authentication.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3705,13 +3675,11 @@ Authentication has not occurred.
To authenticate as the server, call the or methods.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3762,13 +3730,11 @@ Authentication has not occurred.
## Remarks
Data signing helps to protect the integrity of the data; namely, it helps the recipient determine whether the data has been tampered with while in transit.
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#1)]
- [!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#1](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#1)]
]]>
@@ -3821,10 +3787,10 @@ Authentication has not occurred.
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -3940,13 +3906,11 @@ Authentication has not occurred.
To perform this operation asynchronously, use the method.
-
-
## Examples
- The following code example demonstrates reading from a .
- [!code-cpp[NclNegoSyncServer#1](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncServer/CPP/NclNegoSyncServer.cpp#1)]
- [!code-csharp[NclNegoSyncServer#1](~/snippets/csharp/System.Net.Security/NegotiateStream/Read/server.cs#1)]
+The following code example demonstrates reading from a .
+
+[!code-csharp[NclNegoSyncServer#1](~/snippets/csharp/System.Net.Security/NegotiateStream/Read/server.cs#1)]
]]>
@@ -4104,10 +4068,10 @@ This method reads asynchronously as much data as is available into `buffer` and
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
@@ -4157,13 +4121,11 @@ This method reads asynchronously as much data as is available into `buffer` and
## Remarks
When accessed by the client, this property returns a containing the Service Principal Name (SPN) of the server and the authentication protocol used. When accessed by the server, this property returns a that describes the client. If the is not available, client information is returned to the server in a .
-
-
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoAsyncServer#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoAsyncServer/CPP/NclNegoAsyncServer.cpp#2)]
- [!code-csharp[NclNegoAsyncServer#2](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoAsyncServer#2](~/snippets/csharp/System.Net.Security/NegotiateStream/Overview/server.cs#2)]
]]>
@@ -4326,13 +4288,11 @@ This method reads asynchronously as much data as is available into `buffer` and
The class does not support multiple simultaneous write operations. If you attempt to start a write operation while another write operation is already executing on the same stream, a exception will be thrown.
-
-
## Examples
- The following code example demonstrates writing to a .
- [!code-cpp[NclNegoSyncClient#4](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#4)]
- [!code-csharp[NclNegoSyncClient#4](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#4)]
+The following code example demonstrates writing to a .
+
+[!code-csharp[NclNegoSyncClient#4](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#4)]
]]>
@@ -4521,10 +4481,10 @@ This method reads asynchronously as much data as is available into `buffer` and
If the underlying stream is a , is in milliseconds and is set to by default so that write operations do not time out.
## Examples
- The following code example demonstrates displaying the value of this property.
- [!code-cpp[NclNegoSyncClient#2](~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp#2)]
- [!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
+The following code example demonstrates displaying the value of this property.
+
+[!code-csharp[NclNegoSyncClient#2](~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs#2)]
]]>
diff --git a/xml/System.Net.Security/ProtectionLevel.xml b/xml/System.Net.Security/ProtectionLevel.xml
index c51aa85cd17..5e4f6d4bb9f 100644
--- a/xml/System.Net.Security/ProtectionLevel.xml
+++ b/xml/System.Net.Security/ProtectionLevel.xml
@@ -43,19 +43,16 @@
Indicates the security services requested for an authenticated stream.
- class.
-
-
-
-## Examples
- The following code example demonstrates creating and using a client-side .
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/NclNegoSyncClient/CPP/NclNegoSyncClient.cpp" id="Snippet0":::
- :::code language="csharp" source="~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs" id="Snippet0":::
-
+ class.
+
+## Examples
+ The following code example demonstrates creating and using a client-side .
+
+ :::code language="csharp" source="~/snippets/csharp/System.Net.Security/NegotiateStream/.ctor/client.cs" id="Snippet0":::
+
]]>
diff --git a/xml/System.Xml.Schema/XmlSchemaCollection.xml b/xml/System.Xml.Schema/XmlSchemaCollection.xml
index 815e79f23fd..8f412e3fdf1 100644
--- a/xml/System.Xml.Schema/XmlSchemaCollection.xml
+++ b/xml/System.Xml.Schema/XmlSchemaCollection.xml
@@ -114,7 +114,7 @@
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -160,7 +160,7 @@
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -221,7 +221,7 @@
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -292,7 +292,7 @@
> If the `XmlSchemaCollection` is being accessed using the property, the `Add` method uses the `XmlResolver` specified by the property.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -354,7 +354,7 @@
> If the `XmlSchemaCollection` is being accessed using the property, the `Add` method uses the `XmlResolver` specified by the property.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -437,14 +437,11 @@ schemaColl.Add("urn:author", "names.xsd");
> If the `XmlSchemaCollection` is being accessed using the property, the `Add` method uses the `XmlResolver` specified by the property.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
-
-
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
## Examples
The following example validates three XML files using schemas stored in the `XmlSchemaCollection`.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlValidatingReader/Schemas/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/VB/source.vb" id="Snippet1":::
@@ -546,7 +543,7 @@ schemaColl.Add("urn:author", "names.xsd");
> If the `XmlSchemaCollection` is being accessed using the property, the `Add` method uses the `XmlResolver` specified by the property.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -697,7 +694,7 @@ schemaColl.Add("urn:author", "names.xsd");
If the schema being added contains references to other namespaces (through `include` and `import` elements or the `x-schema` attribute), the schemas for these other namespaces are loaded for validation purposes only. Unlike the original schema, these other schemas are not explicitly added to the schema collection. As a result, they are not accessible using any of the collection methods or properties.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -721,7 +718,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -777,7 +774,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
@@ -841,7 +838,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -896,7 +893,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -949,7 +946,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -1000,7 +997,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
@@ -1071,7 +1068,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
@@ -1136,7 +1133,7 @@ schemaColl.Add("urn:author", "names.xsd");
## Remarks
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
]]>
@@ -1445,7 +1442,7 @@ schemaColl.Add("urn:author", "names.xsd");
These events occur when the schemas are added to the collection. If an event handler is not provided, an is thrown on any validation errors where the is `XmlSeverityType.Error`. To specify an event handler, define a callback function and add it to the `ValidationEventHandler`.
> [!IMPORTANT]
-> The class is obsolete in the .NET Framework version 2.0 and has been replaced by the class.
+> The class is obsolete in .NET Framework version 2.0 and has been replaced by the class.
diff --git a/xml/System.Xml/XmlDocument.xml b/xml/System.Xml/XmlDocument.xml
index 0f87bcae068..c78bab30e62 100644
--- a/xml/System.Xml/XmlDocument.xml
+++ b/xml/System.Xml/XmlDocument.xml
@@ -119,15 +119,15 @@
is passed to the method and a is provided to notify users of any validation errors. In this example a validation error is found, but the document is still loaded. Alternatively, you can define a validating to throw an exception and stop the load process when a validation error is found by not specifying the . For more information about validating XML data, see the Remarks section of the reference page.
- [!code-cpp[XmlDocument.cctor#1](~/snippets/cpp/VS_Snippets_Data/XmlDocument.cctor/CPP/docload.cpp#1)]
- [!code-csharp[XmlDocument.cctor#1](~/snippets/csharp/System.Xml/XmlDocument/.ctor/docload.cs#1)]
- [!code-vb[XmlDocument.cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlDocument.cctor/VB/docload.vb#1)]
+The following is an example of load-time validation. A document type definition (DTD) validating is passed to the method and a is provided to notify users of any validation errors. In this example a validation error is found, but the document is still loaded. Alternatively, you can define a validating to throw an exception and stop the load process when a validation error is found by not specifying the . For more information about validating XML data, see the Remarks section of the reference page.
- The example uses the `bookDTD.xml` file as input.
+[!code-csharp[XmlDocument.cctor#1](~/snippets/csharp/System.Xml/XmlDocument/.ctor/docload.cs#1)]
+[!code-vb[XmlDocument.cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlDocument.cctor/VB/docload.vb#1)]
- [!code-xml[XmlDocument.cctor#2](~/snippets/xml/VS_Snippets_Data/XmlDocument.cctor/XML/bookdtd.xml#2)]
+The example uses the `bookDTD.xml` file as input.
+
+[!code-xml[XmlDocument.cctor#2](~/snippets/xml/VS_Snippets_Data/XmlDocument.cctor/XML/bookdtd.xml#2)]
]]>
@@ -346,12 +346,10 @@
If `deep` is `true`, the cloned node includes all the child nodes, otherwise only the `XmlDocument` node is cloned. See the method to see how this method behaves on other node types.
-
-
## Examples
- The following example shows the difference between a deep and shallow clone.
- [!code-cpp[Classic WebData XmlDocument.CloneNode Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/CPP/source.cpp#1)]
+The following example shows the difference between a deep and shallow clone.
+
[!code-csharp[Classic WebData XmlDocument.CloneNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/CloneNode/source.cs#1)]
[!code-vb[Classic WebData XmlDocument.CloneNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CloneNode Example/VB/source.vb#1)]
@@ -421,12 +419,10 @@
## Remarks
The `XmlAttribute` can be added to an using the method.
-
-
## Examples
- The following creates an attribute and adds it to an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/CPP/source.cpp#1)]
+The following creates an attribute and adds it to an XML document.
+
[!code-csharp[Classic WebData XmlDocument.CreateAttribute Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateAttribute/source.cs#1)]
[!code-vb[Classic WebData XmlDocument.CreateAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateAttribute Example/VB/source.vb#1)]
@@ -648,12 +644,10 @@
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), CDataSection nodes are allowed within Element nodes and in EntityReference nodes when the EntityReference node is not a child of an Attribute node.
-
-
## Examples
- The following example creates a CDATA node and adds it to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateCDataSection Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/CPP/source.cpp#1)]
+The following example creates a CDATA node and adds it to the document.
+
[!code-csharp[Classic WebData XmlDocument.CreateCDataSection Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateCDataSection/source.cs#1)]
[!code-vb[Classic WebData XmlDocument.CreateCDataSection Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateCDataSection Example/VB/source.vb#1)]
@@ -724,14 +718,12 @@
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), Comment nodes are only allowed within Document, Element and EntityReference nodes, when the EntityReference node is not a child of an Attribute node.
-
-
## Examples
- The following example creates a comment and adds it to an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateComment Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateComment Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateComment/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateComment Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/VB/source.vb#1)]
+The following example creates a comment and adds it to an XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateComment Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateComment/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateComment Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateComment Example/VB/source.vb#1)]
]]>
@@ -861,14 +853,12 @@
## Remarks
DocumentFragment nodes cannot be inserted into a document. However, you can insert children of the DocumentFragment node into a document.
-
-
## Examples
- The following example adds new nodes to an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateDocumentFragment Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateDocumentFragment Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateDocumentFragment/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateDocumentFragment Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/VB/source.vb#1)]
+The following example adds new nodes to an XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateDocumentFragment Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateDocumentFragment/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateDocumentFragment Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentFragment Example/VB/source.vb#1)]
]]>
@@ -950,14 +940,12 @@
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), DocumentType nodes are only allowed within Document nodes. Each can have only one DocumentType node. The DocumentType node must also be inserted before the root element of the `XmlDocument` (if the document already has a root element, you cannot add a DocumentType node).
If the passed parameters do not combine to build a valid `XmlDocumentType`, an exception is thrown.
-
-
## Examples
- The following example creates a DocumentType node and adds it to an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateDocumentType Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateDocumentType Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateDocumentType/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateDocumentType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/VB/source.vb#1)]
+The following example creates a DocumentType node and adds it to an XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateDocumentType Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateDocumentType/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateDocumentType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateDocumentType Example/VB/source.vb#1)]
]]>
@@ -1034,14 +1022,12 @@
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), Element nodes are allowed within Document and Element nodes, and in EntityReference nodes when the EntityReference node is not a child of an Attribute node.
-
-
## Examples
- The following example creates a new element and adds it to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/VB/source.vb#1)]
+The following example creates a new element and adds it to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/VB/source.vb#1)]
]]>
@@ -1221,14 +1207,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example adds a new element to the existing XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source1.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/VB/source.vb#1)]
+The following example adds a new element to the existing XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source1.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/VB/source.vb#1)]
]]>
@@ -1301,14 +1285,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), EntityReference nodes are only allowed within Element, Attribute and EntityReference nodes.
-
-
## Examples
- The following example creates two entity reference nodes and inserts them into an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateEntityReference Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateEntityReference Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateEntityReference/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateEntityReference Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/VB/source.vb#1)]
+The following example creates two entity reference nodes and inserts them into an XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateEntityReference Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateEntityReference/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateEntityReference Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateEntityReference Example/VB/source.vb#1)]
]]>
@@ -1527,7 +1509,8 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
@@ -1678,11 +1661,11 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
## Examples
- The following example creates a new element and inserts it into an XML document.
- [!code-cpp[Classic WebData XmlDocument.CreateNode Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateNode/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/VB/source.vb#1)]
+The following example creates a new element and inserts it into an XML document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateNode/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode Example/VB/source.vb#1)]
]]>
@@ -1788,11 +1771,11 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
## Examples
- The following example adds a new element to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateNode2 Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateNode2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateNode/source2.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateNode2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/VB/source.vb#1)]
+The following example adds a new element to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateNode2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateNode/source2.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateNode2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateNode2 Example/VB/source.vb#1)]
]]>
@@ -1864,14 +1847,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), ProcessingInstruction nodes are only allowed within Document, Element, and EntityReference nodes, when the EntityReference node is not a child of an Attribute node.
-
-
## Examples
- The following example creates a ProcessingInstruction node and adds it to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateProcessingInstruction Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateProcessingInstruction Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateProcessingInstruction/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateProcessingInstruction Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/VB/source.vb#1)]
+The following example creates a ProcessingInstruction node and adds it to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateProcessingInstruction Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateProcessingInstruction/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateProcessingInstruction Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/VB/source.vb#1)]
]]>
@@ -1940,14 +1921,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
Although this method creates the new object in the context of the document, it does not automatically add the new object to the document tree. To add the new object, you must explicitly call one of the node insert methods.
-
-
## Examples
- The following example adds significant white space to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateSignificantWhitespace Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateSignificantWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateSignificantWhitespace/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateSignificantWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/VB/source.vb#1)]
+The following example adds significant white space to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateSignificantWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateSignificantWhitespace/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateSignificantWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateSignificantWhitespace Example/VB/source.vb#1)]
]]>
@@ -2016,14 +1995,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
According to the W3C [Extensible Markup Language (XML) 1.0 recommendation](https://www.w3.org/TR/1998/REC-xml-19980210), Text nodes are only allowed within Element, Attribute and EntityReference nodes.
-
-
## Examples
- The following example creates a new element and adds it to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/VB/source.vb#1)]
+The following example creates a new element and adds it to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement Example/VB/source.vb#1)]
]]>
@@ -2092,14 +2069,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
Although this method creates the new object in the context of the document, it does not automatically add the new object to the document tree. To add the new object, you must explicitly call one of the node insert methods.
-
-
## Examples
- The following example adds white space to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateWhitespace Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateWhitespace/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/VB/source.vb#1)]
+The following example adds white space to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateWhitespace/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateWhitespace Example/VB/source.vb#1)]
]]>
@@ -2185,14 +2160,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example creates an XML declaration and adds it to the document.
- [!code-cpp[Classic WebData XmlDocument.CreateXmlDeclaration Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateXmlDeclaration Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateXmlDeclaration/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateXmlDeclaration Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/VB/source.vb#1)]
+The following example creates an XML declaration and adds it to the document.
+
+[!code-csharp[Classic WebData XmlDocument.CreateXmlDeclaration Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateXmlDeclaration/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateXmlDeclaration Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateXmlDeclaration Example/VB/source.vb#1)]
]]>
@@ -2254,13 +2227,13 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
Pride And Prejudice
@@ -2325,16 +2298,14 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
An `XmlDocument` can have one and only one child with equal to DocumentType.
> [!NOTE]
-> This property is read-only. To change the DocumentType node, delete the existing node, create a new one using the method, and add the new node to the document.
-
-
+> This property is read-only. To change the DocumentType node, delete the existing node, create a new one using the method, and add the new node to the document.
## Examples
- The following example gets and displays the DOCTYPE declaration for the document.
- [!code-cpp[Classic WebData XmlDocument.DocumentType Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.DocumentType Example#1](~/snippets/csharp/System.Xml/XmlDocument/DocumentType/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.DocumentType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/VB/source.vb#1)]
+The following example gets and displays the DOCTYPE declaration for the document.
+
+[!code-csharp[Classic WebData XmlDocument.DocumentType Example#1](~/snippets/csharp/System.Xml/XmlDocument/DocumentType/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.DocumentType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.DocumentType Example/VB/source.vb#1)]
]]>
@@ -2402,14 +2373,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
> [!NOTE]
> The DOM implementation must have information which defines which attributes are of type ID. Although attributes of type ID can be defined in either XSD schemas or DTDs, this version of the product only supports those defined in DTDs. Attributes with the name "ID" are not of type ID unless so defined in the DTD. Implementations where it is unknown whether the attributes are of type ID are expected to return `null`.
-
-
## Examples
- The following example uses the `GetElementById` method.
- [!code-cpp[Classic WebData XmlDocument.GetElementById Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.GetElementById Example#1](~/snippets/csharp/System.Xml/XmlDocument/GetElementById/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.GetElementById Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/VB/source.vb#1)]
+The following example uses the `GetElementById` method.
+
+[!code-csharp[Classic WebData XmlDocument.GetElementById Example#1](~/snippets/csharp/System.Xml/XmlDocument/GetElementById/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.GetElementById Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.GetElementById Example/VB/source.vb#1)]
The example uses the file, `ids.xml`, as input.
@@ -2499,14 +2468,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
> [!NOTE]
> It is recommended that you use the or method instead of the method.
-
-
## Examples
- The following example creates a `XmlDocument` object and uses the `GetElementsByTagName` method and the resulting object to display all the book titles.
- [!code-cpp[Classic WebData XmlDocument.GetElementsByTagName Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.GetElementsByTagName Example#1](~/snippets/csharp/System.Xml/XmlDocument/Overview/source1.cs#1)]
- [!code-vb[Classic WebData XmlDocument.GetElementsByTagName Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/VB/source.vb#1)]
+The following example creates a `XmlDocument` object and uses the `GetElementsByTagName` method and the resulting object to display all the book titles.
+
+[!code-csharp[Classic WebData XmlDocument.GetElementsByTagName Example#1](~/snippets/csharp/System.Xml/XmlDocument/Overview/source1.cs#1)]
+[!code-vb[Classic WebData XmlDocument.GetElementsByTagName Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.GetElementsByTagName Example/VB/source.vb#1)]
The example uses the `books.xml` file as input.
@@ -2635,14 +2602,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
Although the `XmlDocument` objects share the same implementation, to move nodes from one document to another you must use the method.
-
-
## Examples
- The following example creates a new `XmlDocument` using another document's implementation.
- [!code-cpp[Classic WebData XmlDocument.Implementation Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.Implementation Example#1](~/snippets/csharp/System.Xml/XmlDocument/Implementation/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.Implementation Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/VB/source.vb#1)]
+The following example creates a new `XmlDocument` using another document's implementation.
+
+[!code-csharp[Classic WebData XmlDocument.Implementation Example#1](~/snippets/csharp/System.Xml/XmlDocument/Implementation/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.Implementation Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Implementation Example/VB/source.vb#1)]
]]>
@@ -2734,18 +2699,16 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
*Although DocumentType nodes can be imported, a document can only have one DocumentType. If the document currently has a DocumentType node, it must be removed before adding a new one.
-
-
## Examples
- The following example imports a book node from a second XML document into the original XML document.
- [!code-cpp[Classic WebData XmlDocument.ImportNode Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.ImportNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/ImportNode/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.ImportNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/VB/source.vb#1)]
+The following example imports a book node from a second XML document into the original XML document.
- The example uses the file, `books.xml`, as input.
+[!code-csharp[Classic WebData XmlDocument.ImportNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/ImportNode/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.ImportNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.ImportNode Example/VB/source.vb#1)]
- [!code-xml[Classic WebData XslTransform.Transform7 Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/XML/books.xml#2)]
+The example uses the file, `books.xml`, as input.
+
+[!code-xml[Classic WebData XslTransform.Transform7 Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/XML/books.xml#2)]
]]>
@@ -2993,14 +2956,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This property is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example shows how to use the `IsReadOnly` property.
- [!code-cpp[Classic WebData XmlDocument.IsReadOnly Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.IsReadOnly Example#1](~/snippets/csharp/System.Xml/XmlDocument/IsReadOnly/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.IsReadOnly Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/VB/source.vb#1)]
+The following example shows how to use the `IsReadOnly` property.
+
+[!code-csharp[Classic WebData XmlDocument.IsReadOnly Example#1](~/snippets/csharp/System.Xml/XmlDocument/IsReadOnly/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.IsReadOnly Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.IsReadOnly Example/VB/source.vb#1)]
]]>
@@ -3141,14 +3102,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example uses the class to load a string of XML data into the `XmlDocument` object.
- [!code-cpp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source1.cs#1)]
- [!code-vb[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/VB/source.vb#1)]
+The following example uses the class to load a string of XML data into the `XmlDocument` object.
+
+[!code-csharp[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/CreateElement/source1.cs#1)]
+[!code-vb[Classic WebData XmlDocument.CreateElement2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateElement2 Example/VB/source.vb#1)]
]]>
@@ -3300,7 +3259,7 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
## Remarks
> [!NOTE]
-> The `Load` method always preserves significant white space. The property determines whether or not insignificant white space, that is white space in element content, is preserved. The default is `false`; white space in element content is not preserved.
+> The `Load` method always preserves significant white space. The property determines whether or not insignificant white space, that is white space in element content, is preserved. The default is `false`; white space in element content is not preserved.
If the reader is in the initial state ( =ReadState.Initial), `Load` consumes the entire contents of the reader and builds the DOM from what it finds.
@@ -3326,18 +3285,16 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example loads the last book node of the `books.xml` file into the XML document.
- [!code-cpp[Classic WebData XmlDocument.Load2 Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.Load2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/Load/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.Load2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/VB/source.vb#1)]
+The following example loads the last book node of the `books.xml` file into the XML document.
- The example uses the file, `books.xml`, as input.
+[!code-csharp[Classic WebData XmlDocument.Load2 Example#1](~/snippets/csharp/System.Xml/XmlDocument/Load/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.Load2 Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Load2 Example/VB/source.vb#1)]
- [!code-xml[Classic WebData XslTransform.Transform7 Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/XML/books.xml#2)]
+The example uses the file, `books.xml`, as input.
+
+[!code-xml[Classic WebData XslTransform.Transform7 Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XslTransform.Transform7 Example/XML/books.xml#2)]
]]>
@@ -3412,14 +3369,12 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example loads XML into an `XmlDocument` object and saves it out to a file.
- [!code-cpp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/csharp/System.Xml/XmlDocument/LoadXml/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/VB/source.vb#1)]
+The following example loads XML into an `XmlDocument` object and saves it out to a file.
+
+[!code-csharp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/csharp/System.Xml/XmlDocument/LoadXml/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/VB/source.vb#1)]
]]>
@@ -4147,18 +4102,16 @@ elem=doc.CreateElement("xy", "item", "urn:abc");
This method is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example shows how to strip white space from a file.
- [!code-cpp[Classic WebData XmlDocument.PreserveWhitespace Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.PreserveWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/PreserveWhitespace/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.PreserveWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/VB/source.vb#1)]
+The following example shows how to strip white space from a file.
- The example uses the file `book.xml` as input.
+[!code-csharp[Classic WebData XmlDocument.PreserveWhitespace Example#1](~/snippets/csharp/System.Xml/XmlDocument/PreserveWhitespace/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.PreserveWhitespace Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/VB/source.vb#1)]
- [!code-xml[Classic WebData XmlDocument.PreserveWhitespace Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/XML/source.xml#2)]
+The example uses the file `book.xml` as input.
+
+[!code-xml[Classic WebData XmlDocument.PreserveWhitespace Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlDocument.PreserveWhitespace Example/XML/source.xml#2)]
]]>
@@ -4233,18 +4186,16 @@ while (reader.MoveToNextAttribute())
`ReadNode` does consume the attribute value though, which means after calling `ReadNode` on an attribute, returns `false`.
-
-
## Examples
- The following example uses `ReadNode` to create a new node and then inserts the new node into the document.
- [!code-cpp[Classic WebData XmlDocument.ReadNode Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.ReadNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/ReadNode/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.ReadNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/VB/source.vb#1)]
+The following example uses `ReadNode` to create a new node and then inserts the new node into the document.
+
+[!code-csharp[Classic WebData XmlDocument.ReadNode Example#1](~/snippets/csharp/System.Xml/XmlDocument/ReadNode/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.ReadNode Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/VB/source.vb#1)]
- The example uses the file, `cd.xml`, as input.
+The example uses the file, `cd.xml`, as input.
- [!code-xml[Classic WebData XmlDocument.ReadNode Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/XML/source.xml#2)]
+[!code-xml[Classic WebData XmlDocument.ReadNode Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlDocument.ReadNode Example/XML/source.xml#2)]
]]>
@@ -4467,14 +4418,12 @@ doc.Save(Console.Out);
Note that only the method enforces a well-formed XML document. All other `Save` overloads only guarantee a well-formed fragment.
-
-
## Examples
- The following example loads XML into an XmlDocument object, modifies it, and then saves it to a file named data.xml.
- [!code-cpp[Classic WebData XmlDocument.Save Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.Save Example#1](~/snippets/csharp/System.Xml/XmlDocument/Save/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.Save Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/VB/source.vb#1)]
+The following example loads XML into an XmlDocument object, modifies it, and then saves it to a file named data.xml.
+
+[!code-csharp[Classic WebData XmlDocument.Save Example#1](~/snippets/csharp/System.Xml/XmlDocument/Save/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.Save Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.Save Example/VB/source.vb#1)]
The data.xml file will contain the following XML: `- wrench10.95
`.
@@ -4556,14 +4505,12 @@ doc.Save(Console.Out);
Note that only the method enforces a well-formed XML document. All other `Save` overloads only guarantee a well-formed fragment.
-
-
## Examples
- The following example loads XML into an `XmlDocument` object and saves it out to a file.
- [!code-cpp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/csharp/System.Xml/XmlDocument/LoadXml/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/VB/source.vb#1)]
+The following example loads XML into an `XmlDocument` object and saves it out to a file.
+
+[!code-csharp[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/csharp/System.Xml/XmlDocument/LoadXml/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.LoadXml Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.LoadXml Example/VB/source.vb#1)]
]]>
@@ -4748,30 +4695,25 @@ doc.Save(Console.Out);
## Remarks
The method validates the XML data in the against the schemas contained in the property. The method performs infoset augmentation. Specifically, after successful validation, schema defaults are applied, text values are converted to atomic values as necessary, and type information is associated with validated information items. The result is a previously un-typed XML sub-tree in the replaced with a typed sub-tree.
- The following are important notes to consider when using the method.
-
-- Schema location hints like `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` are ignored.
-
-- Inline schemas are ignored.
-
-- If schema validation errors occur during validation the becomes partially validated with some nodes with correct type information and some without.
-
-- The validation process includes checking for uniqueness and reference constraints (`xs:ID`, `xs:IDREF`, `xs:key`, `xs:keyref`, and `xs:unique`).
-
+Consider the following points when using the method:
+- Schema location hints like `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` are ignored.
+- Inline schemas are ignored.
+- If schema validation errors occur during validation the becomes partially validated with some nodes with correct type information and some without.
+- The validation process includes checking for uniqueness and reference constraints (`xs:ID`, `xs:IDREF`, `xs:key`, `xs:keyref`, and `xs:unique`).
## Examples
- The following example illustrates use of the method. The example creates an that contains an associated XSD schema using the and objects. The example then uses the class to incorrectly modify the typed value of an element in the XML document generating a schema validation error.
- [!code-cpp[XPathValidation#1](~/snippets/cpp/VS_Snippets_Data/XPathValidation/CPP/XPathValidation.cpp#1)]
- [!code-csharp[XPathValidation#1](~/snippets/csharp/System.Xml/XmlDocument/Validate/XPathValidation.cs#1)]
- [!code-vb[XPathValidation#1](~/snippets/visualbasic/VS_Snippets_Data/XPathValidation/VB/XPathValidation.vb#1)]
+The following example illustrates use of the method. The example creates an that contains an associated XSD schema using the and objects. The example then uses the class to incorrectly modify the typed value of an element in the XML document generating a schema validation error.
+
+[!code-csharp[XPathValidation#1](~/snippets/csharp/System.Xml/XmlDocument/Validate/XPathValidation.cs#1)]
+[!code-vb[XPathValidation#1](~/snippets/visualbasic/VS_Snippets_Data/XPathValidation/VB/XPathValidation.vb#1)]
- The example takes the `contosoBooks.xml` and `contosoBooks.xsd` files as input.
+The example takes the `contosoBooks.xml` and `contosoBooks.xsd` files as input.
- [!code-xml[XPathXMLExamples#2](~/snippets/xml/VS_Snippets_Data/XPathXMLExamples/XML/contosoBooks.xml#2)]
+[!code-xml[XPathXMLExamples#2](~/snippets/xml/VS_Snippets_Data/XPathXMLExamples/XML/contosoBooks.xml#2)]
- [!code-xml[XPathXMLExamples#3](~/snippets/xml/VS_Snippets_Data/XPathXMLExamples/XML/contosoBooks.xsd#3)]
+[!code-xml[XPathXMLExamples#3](~/snippets/xml/VS_Snippets_Data/XPathXMLExamples/XML/contosoBooks.xsd#3)]
]]>
@@ -4839,11 +4781,11 @@ doc.Save(Console.Out);
The following are important notes to consider when using the method.
-- Schema location hints like `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` are ignored.
+- Schema location hints like `xsi:schemaLocation` or `xsi:noNamespaceSchemaLocation` are ignored.
-- Inline schemas are ignored.
+- Inline schemas are ignored.
-- If schema validation errors occur during validation the becomes partially validated with some nodes with correct type information and some without.
+- If schema validation errors occur during validation the becomes partially validated with some nodes with correct type information and some without.
If the node to validate is the root node, the validation process includes checking for uniqueness and reference constraints (`xs:ID`, `xs:IDREF`, `xs:key`, `xs:keyref`, and `xs:unique`); otherwise, uniqueness and reference constraints are omitted.
@@ -4913,14 +4855,12 @@ doc.Save(Console.Out);
The property determines the encoding that is written out. If the `Encoding` property does not have a value, the `XmlDocument` is written out without an encoding attribute.
-
-
## Examples
- The following example displays the document onscreen.
- [!code-cpp[Classic WebData XmlDocument.WriteContentTo Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.WriteContentTo Example#1](~/snippets/csharp/System.Xml/XmlDocument/WriteContentTo/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.WriteContentTo Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/VB/source.vb#1)]
+The following example displays the document.
+
+[!code-csharp[Classic WebData XmlDocument.WriteContentTo Example#1](~/snippets/csharp/System.Xml/XmlDocument/WriteContentTo/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.WriteContentTo Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.WriteContentTo Example/VB/source.vb#1)]
]]>
@@ -4980,14 +4920,12 @@ doc.Save(Console.Out);
The property determines the encoding that is written out. If the `Encoding` property does not have a value, the `XmlDocument` is written out without an encoding attribute.
-
-
## Examples
- The following example displays the document onscreen.
- [!code-cpp[Classic WebData XmlDocument.WriteTo Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlDocument.WriteTo Example#1](~/snippets/csharp/System.Xml/XmlDocument/WriteTo/source.cs#1)]
- [!code-vb[Classic WebData XmlDocument.WriteTo Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/VB/source.vb#1)]
+The following example displays the document.
+
+[!code-csharp[Classic WebData XmlDocument.WriteTo Example#1](~/snippets/csharp/System.Xml/XmlDocument/WriteTo/source.cs#1)]
+[!code-vb[Classic WebData XmlDocument.WriteTo Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.WriteTo Example/VB/source.vb#1)]
]]>
@@ -5049,13 +4987,13 @@ doc.Save(Console.Out);
## Remarks
The `XmlResolver` can be used to load DTDs or expand entity references. Using the property, you can set credentials on the `XmlResolver` to access resources stored on a secure network resource.
-- If the document was not loaded using an (that is, if it was loaded using a stream, file, and so on) the `XmlResolver` on the `XmlDocument` is always used.
+- If the document was not loaded using an (that is, if it was loaded using a stream, file, and so on) the `XmlResolver` on the `XmlDocument` is always used.
-- If the document was loaded with an , the resolver on the `XmlTextReader` is used to resolve any DTD references in the DocumentType node. The resolver on the `XmlDocument` is used to expand any entity references.
+- If the document was loaded with an , the resolver on the `XmlTextReader` is used to resolve any DTD references in the DocumentType node. The resolver on the `XmlDocument` is used to expand any entity references.
-- If the document was loaded with an , the resolver on the `XmlDocument` is never used.
+- If the document was loaded with an , the resolver on the `XmlDocument` is never used.
-- If the document was loaded with a class that extends `XmlReader` and the `XmlReader` cannot resolve entities ( returns `false`), the `XmlResolver` on the `XmlDocument` is used to resolve any references in the DocumentType node and to expand any entity references.
+- If the document was loaded with a class that extends `XmlReader` and the `XmlReader` cannot resolve entities ( returns `false`), the `XmlResolver` on the `XmlDocument` is used to resolve any references in the DocumentType node and to expand any entity references.
> [!NOTE]
> If the `XmlDocument` is loaded using an that had an `XmlResolver` set to it, the `XmlResolver` on the `XmlReader` is not cached by the `XmlDocument` after completes.
@@ -5070,24 +5008,22 @@ doc.Save(Console.Out);
This property is a Microsoft extension to the Document Object Model (DOM).
-
-
## Examples
- The following example loads an XML document which includes a reference to a DTD file. The `XmlResolver` property is used to set the credentials necessary to access the network resource.
- [!code-cpp[XmlDocument.XmlResolver#1](~/snippets/cpp/VS_Snippets_Data/XmlDocument.XmlResolver/CPP/docresolver.cpp#1)]
- [!code-csharp[XmlDocument.XmlResolver#1](~/snippets/csharp/System.Xml/XmlDocument/XmlResolver/docresolver.cs#1)]
- [!code-vb[XmlDocument.XmlResolver#1](~/snippets/visualbasic/VS_Snippets_Data/XmlDocument.XmlResolver/VB/docresolver.vb#1)]
+The following example loads an XML document which includes a reference to a DTD file. The `XmlResolver` property is used to set the credentials necessary to access the network resource.
+
+[!code-csharp[XmlDocument.XmlResolver#1](~/snippets/csharp/System.Xml/XmlDocument/XmlResolver/docresolver.cs#1)]
+[!code-vb[XmlDocument.XmlResolver#1](~/snippets/visualbasic/VS_Snippets_Data/XmlDocument.XmlResolver/VB/docresolver.vb#1)]
- The example uses the following data files as input.
+The example uses the following data files as input.
- `book5.xml`
+`book5.xml`
- [!code-xml[XmlDocument.XmlResolver#2](~/snippets/xml/VS_Snippets_Data/XmlDocument.XmlResolver/XML/book5.xml#2)]
+[!code-xml[XmlDocument.XmlResolver#2](~/snippets/xml/VS_Snippets_Data/XmlDocument.XmlResolver/XML/book5.xml#2)]
- `books.dtd`
+`books.dtd`
- [!code-xml[XmlDocument.XmlResolver#3](~/snippets/xml/VS_Snippets_Data/XmlDocument.XmlResolver/XML/books.dtd#3)]
+[!code-xml[XmlDocument.XmlResolver#3](~/snippets/xml/VS_Snippets_Data/XmlDocument.XmlResolver/XML/books.dtd#3)]
]]>
diff --git a/xml/System.Xml/XmlProcessingInstruction.xml b/xml/System.Xml/XmlProcessingInstruction.xml
index 129f6cf1f23..034f2e87cb1 100644
--- a/xml/System.Xml/XmlProcessingInstruction.xml
+++ b/xml/System.Xml/XmlProcessingInstruction.xml
@@ -255,7 +255,6 @@
## Examples
The following example creates a processing instruction node and adds it to a document.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlDocument/CreateProcessingInstruction/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/VB/source.vb" id="Snippet1":::
@@ -525,7 +524,6 @@
## Examples
The following example creates a processing instruction node and adds it to a document.
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlDocument/CreateProcessingInstruction/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlDocument.CreateProcessingInstruction Example/VB/source.vb" id="Snippet1":::
diff --git a/xml/System.Xml/XmlValidatingReader.xml b/xml/System.Xml/XmlValidatingReader.xml
index 608452bd314..86aadee8075 100644
--- a/xml/System.Xml/XmlValidatingReader.xml
+++ b/xml/System.Xml/XmlValidatingReader.xml
@@ -154,28 +154,26 @@
When external document type definitions (DTDs) or schemas are needed for validation, the property sets the object to use for resolving external resources.
-
-
## Examples
- The following example validates two documents.
- [!code-cpp[XmlValidatingReader.Cctor#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.Cctor/CPP/valid_xsd2.cpp#1)]
- [!code-csharp[XmlValidatingReader.Cctor#1](~/snippets/csharp/System.Xml/XmlValidatingReader/.ctor/valid_xsd2.cs#1)]
- [!code-vb[XmlValidatingReader.Cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.Cctor/VB/valid_xsd2.vb#1)]
+The following example validates two documents.
- The sample uses the following input files:
+[!code-csharp[XmlValidatingReader.Cctor#1](~/snippets/csharp/System.Xml/XmlValidatingReader/.ctor/valid_xsd2.cs#1)]
+[!code-vb[XmlValidatingReader.Cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.Cctor/VB/valid_xsd2.vb#1)]
- `notValidXSD.xml`
+The sample uses the following input files:
- [!code-xml[XmlValidatingReader.Cctor#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/notvalidxsd.xml#2)]
+`notValidXSD.xml`
- `books.xsd`
+[!code-xml[XmlValidatingReader.Cctor#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/notvalidxsd.xml#2)]
- [!code-xml[XmlValidatingReader.Cctor#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/books.xsd#3)]
+`books.xsd`
- `inlineXSD.xml`
+[!code-xml[XmlValidatingReader.Cctor#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/books.xsd#3)]
- [!code-xml[XmlValidatingReader.Cctor#4](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/inlinexsd.xml#4)]
+`inlineXSD.xml`
+
+[!code-xml[XmlValidatingReader.Cctor#4](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/inlinexsd.xml#4)]
]]>
@@ -340,10 +338,9 @@
If this reader will be validating by using XML-Data Reduced (XDR) or XML Schema definition language (XSD) schemas, use the property to specify the that contains the schemas (the `XmlParserContext` does not need to supply the DocumentType information).
-
-
## Examples
- The following example reads an XML fragment. It uses an `XmlParserContext` and its to handle namespace matching.
+
+The following example reads an XML fragment. It uses an `XmlParserContext` and its to handle namespace matching.
[!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)]
[!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)]
@@ -403,14 +400,12 @@
This property is relevant to `Element`, `DocumentType`, and `XmlDeclaration` nodes only. (Other node types do not have attributes.)
-
-
## Examples
- The following example reads all the elements on the root node.
- [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)]
- [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)]
+The following example reads all the elements on the root node.
+
+[!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)]
+[!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)]
]]>
@@ -466,20 +461,18 @@
A networked XML document is comprised of chunks of data aggregated by using various World Wide Web Consortium (W3C) standard inclusion mechanisms and therefore contains nodes that come from different places. document type definition (DTD) entities are an example of this, but this is not limited to DTDs. The base URI tells you where these nodes came from. If there is no base URI for the nodes being returned (for example, they were parsed from an in-memory string), String.Empty is returned.
-
-
## Examples
- The following example parses a file and displays the base URI of each node.
- [!code-cpp[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/BaseURI/source.cs#1)]
- [!code-vb[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/VB/source.vb#1)]
+The following example parses a file and displays the base URI of each node.
+
+[!code-csharp[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/BaseURI/source.cs#1)]
+[!code-vb[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/VB/source.vb#1)]
- The example uses the file, `uri.xml`, as input.
+The example uses the file, `uri.xml`, as input.
- [!code-xml[Classic WebData XmlValidatingReader.BaseURI Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/XML/source.xml#2)]
+[!code-xml[Classic WebData XmlValidatingReader.BaseURI Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/XML/source.xml#2)]
- The `style.xml` file contains the XML text ``.
+The `style.xml` file contains the XML text ``.
]]>
@@ -692,14 +685,12 @@
> [!NOTE]
> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page.
-
-
## Examples
- The following example displays each node including its depth, line number, and line position.
- [!code-cpp[IXmlLineInfo#1](~/snippets/cpp/VS_Snippets_Data/IXmlLineInfo/CPP/lineinfo.cpp#1)]
- [!code-csharp[IXmlLineInfo#1](~/snippets/csharp/System.Xml/IXmlLineInfo/Overview/lineinfo.cs#1)]
- [!code-vb[IXmlLineInfo#1](~/snippets/visualbasic/VS_Snippets_Data/IXmlLineInfo/VB/lineinfo.vb#1)]
+The following example displays each node including its depth, line number, and line position.
+
+[!code-csharp[IXmlLineInfo#1](~/snippets/csharp/System.Xml/IXmlLineInfo/Overview/lineinfo.cs#1)]
+[!code-vb[IXmlLineInfo#1](~/snippets/visualbasic/VS_Snippets_Data/IXmlLineInfo/VB/lineinfo.vb#1)]
]]>
@@ -841,11 +832,11 @@
| 1 | SignificantWhitespace | | |
## Examples
- The following example uses the `ResolveEntity` method to expand a general entity.
-[!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/EntityHandling/source.cs#1)]
- [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)]
+The following example uses the `ResolveEntity` method to expand a general entity.
+
+[!code-csharp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/EntityHandling/source.cs#1)]
+[!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)]
The example uses the file, `book1.xml`, as input.
@@ -1037,14 +1028,12 @@
If the reader is positioned on a `DocumentType` node, this method can be used to get the PUBLIC and SYSTEM literals, for example, `reader.GetAttribute("PUBLIC")`
-
-
## Examples
- The following example gets the value of the ISBN attribute.
- [!code-cpp[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/GetAttribute/source.cs#1)]
- [!code-vb[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/VB/source.vb#1)]
+The following example gets the value of the ISBN attribute.
+
+[!code-csharp[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/GetAttribute/source.cs#1)]
+[!code-vb[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/VB/source.vb#1)]
The example uses the file, `attrs.xml`, as input.
@@ -1258,14 +1247,12 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/);
|`Whitespace`|The white space between markup.|
|`XmlDeclaration`|The content of the declaration.|
-
-
## Examples
- The following example reads in XML with various data types and displays each of the nodes.
- [!code-cpp[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/CPP/source.cpp#1)]
- [!code-csharp[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/HasValue/source.cs#1)]
- [!code-vb[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/VB/source.vb#1)]
+The following example reads in XML with various data types and displays each of the nodes.
+
+[!code-csharp[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/HasValue/source.cs#1)]
+[!code-vb[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/VB/source.vb#1)]
]]>
@@ -1320,12 +1307,10 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/);
> [!NOTE]
> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page.
-
-
## Examples
- The following example displays all attributes nodes on the root element.
- [!code-cpp[XmlValidatingReader.IsDefault#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CPP/readdefattr.cpp#1)]
+The following example displays all attributes nodes on the root element.
+
[!code-csharp[XmlValidatingReader.IsDefault#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsDefault/readdefattr.cs#1)]
[!code-vb[XmlValidatingReader.IsDefault#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.IsDefault/VB/readdefattr.vb#1)]
@@ -1401,12 +1386,10 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/);
If default content has been added to an element due to schema validation, `IsEmptyElement` still returns `true`. It has no bearing on whether or not the element has a default value. In other words, `IsEmptyElement` simply reports whether or not the element in the source document had an end element tag.
-
-
## Examples
- The following example displays the text content of each element.
- [!code-cpp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp#1)]
+The following example displays the text content of each element.
+
[!code-csharp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsEmptyElement/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)]
@@ -1697,7 +1680,8 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
## Examples
- The following example reads an XML fragment.
+
+The following example reads an XML fragment.
[!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)]
[!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)]
@@ -1838,12 +1822,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
> [!NOTE]
> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page.
-
-
## Examples
- The following example reads all the elements on the root node.
- [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)]
+The following example reads all the elements on the root node.
+
[!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)]
@@ -1906,12 +1888,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
After calling this method, the , , and properties reflect the properties of that attribute.
-
-
## Examples
- The following example reads an attribute with text and entity reference nodes.
- [!code-cpp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp#1)]
+The following example reads an attribute with text and entity reference nodes.
+
[!code-csharp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToAttribute/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)]
@@ -2038,12 +2018,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
Use this method to return to an element after navigating through its attributes. This method moves the reader to one of the following node types: `Element`, `DocumentType`, or `XmlDeclaration`.
-
-
## Examples
- The following example reads all the elements on the root node.
- [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)]
+The following example reads all the elements on the root node.
+
[!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)]
@@ -2100,12 +2078,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
> [!NOTE]
> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page.
-
-
## Examples
- The following example reads an XML fragment.
- [!code-cpp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp#1)]
+The following example reads an XML fragment.
+
[!code-csharp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToFirstAttribute/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)]
@@ -2164,12 +2140,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
If the current node is an element node, this method is equivalent to . If `MoveToNextAttribute` returns `true`, the reader moves to the next attribute; otherwise, the position of the reader does not change.
-
-
## Examples
- The following example reads an XML fragment.
- [!code-cpp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp#1)]
+The following example reads an XML fragment.
+
[!code-csharp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToFirstAttribute/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)]
@@ -2244,12 +2218,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
> [!NOTE]
> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page.
-
-
## Examples
- The following example reads an XML file and displays each of the nodes.
- [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)]
+The following example reads an XML file and displays each of the nodes.
+
[!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)]
@@ -2364,7 +2336,8 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
## Examples
- The following example reads an XML fragment.
+
+The following example reads an XML fragment.
[!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)]
[!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)]
@@ -2477,12 +2450,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
This property never returns the following `XmlNodeType` types: `Document`, `DocumentFragment`, `Entity`, or `Notation`.
-
-
## Examples
- The following example reads an XML file and displays each of the nodes.
- [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)]
+The following example reads an XML file and displays each of the nodes.
+
[!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)]
@@ -2544,7 +2515,8 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
## Examples
- The following example reads an XML fragment.
+
+The following example reads an XML fragment.
[!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)]
[!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)]
@@ -2656,12 +2628,10 @@ If the reader is positioned on a `DocumentType` node, this method can be used to
When a reader is first created and initialized, there is no information available. You must call `Read` to read the first node.
-
-
## Examples
- The following example reads an XML file and displays each node.
- [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)]
+The following example reads an XML file and displays each node.
+
[!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)]
@@ -2755,12 +2725,10 @@ reader.MoveToAttribute("name");
}
```
-
-
## Examples
- The following example reads an attribute with text and entity reference nodes.
- [!code-cpp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp#1)]
+The following example reads an attribute with text and entity reference nodes.
+
[!code-csharp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToAttribute/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)]
@@ -3240,12 +3208,10 @@ The text node can be either an element or an attribute text node.
|ExpandEntities|Returns expanded character and general entities. This is the default.|
|ExpandCharEntities|Returns the text content up to but not including a general entity reference. This means a general entity causes ReadString to stop. You must call `Read` to step over the entity reference.|
-
-
## Examples
- The following example displays the text content of each of the elements.
- [!code-cpp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp#1)]
+The following example displays the text content of each of the elements.
+
[!code-csharp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsEmptyElement/source.cs#1)]
[!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)]
@@ -3316,12 +3282,10 @@ The text node can be either an element or an attribute text node.
> [!CAUTION]
> After calling