XPathNavigator.MoveToFollowing Yöntem

Tanım

öğesini XPathNavigator belge sırasına göre belirtilen öğeye taşır.

Aşırı Yüklemeler

MoveToFollowing(XPathNodeType, XPathNavigator)

öğesini XPathNavigator belirtilen öğenin aşağıdaki öğesine XPathNodeType , belirtilen sınıra belge sırasına göre taşır.

MoveToFollowing(String, String, XPathNavigator)

öğesini XPathNavigator yerel adı ve ad alanı URI'sini belirtilen öğeye, belirtilen sınıra belge sırasına göre taşır.

MoveToFollowing(XPathNodeType)

öğesini XPathNavigator belge sırasına göre belirtilen öğesinin XPathNodeType aşağıdaki öğesine taşır.

MoveToFollowing(String, String)

öğesini XPathNavigator , yerel adı ve ad alanı URI'sini belge sırasına göre belirtilen öğeye taşır.

MoveToFollowing(XPathNodeType, XPathNavigator)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

öğesini XPathNavigator belirtilen öğenin aşağıdaki öğesine XPathNodeType , belirtilen sınıra belge sırasına göre taşır.

public:
 virtual bool MoveToFollowing(System::Xml::XPath::XPathNodeType type, System::Xml::XPath::XPathNavigator ^ end);
public virtual bool MoveToFollowing (System.Xml.XPath.XPathNodeType type, System.Xml.XPath.XPathNavigator? end);
public virtual bool MoveToFollowing (System.Xml.XPath.XPathNodeType type, System.Xml.XPath.XPathNavigator end);
abstract member MoveToFollowing : System.Xml.XPath.XPathNodeType * System.Xml.XPath.XPathNavigator -> bool
override this.MoveToFollowing : System.Xml.XPath.XPathNodeType * System.Xml.XPath.XPathNavigator -> bool
Public Overridable Function MoveToFollowing (type As XPathNodeType, end As XPathNavigator) As Boolean

Parametreler

type
XPathNodeType

XPathNodeType öğesinin öğesi. XPathNodeType veya NamespaceolamazAttribute.

end
XPathNavigator

Öğe XPathNavigator sınırında konumlandırılan nesne, geçerli XPathNavigator öğe aşağıdaki öğeyi ararken geçmişe taşınmaz.

Döndürülenler

true başarılı bir XPathNavigator şekilde taşındıysa; değilse, false.

Örnekler

Aşağıdaki örnekte, XPathNavigator dosyasının kökünden contosoBooks.xml aşağıdaki price öğeye taşınır. yöntemini kullanarak nesnesinin XPathNavigatorClone bir kopyası oluşturulur. Öğesinde price konumlandırılan kopyalanan XPathNavigator, sınır olarak kullanılır. Kopyalanan XPathNavigator konumundaki değişiklikler özgün XPathNavigatoröğesini etkilemez. Özgün XPathNavigator dosya, yöntemi kullanılarak dosyanın köküne contosoBooks.xmlMoveToRoot geri taşınır. Yazarın başlığı ve adı ve soyadı yöntemi ve bir XPathNodeTypeTextkullanılarak alınırMoveToFollowing. Yöntem, MoveToFollowing öğe sınırına ulaşılana price kadar true değerini döndürür.

    XPathDocument^ document = gcnew XPathDocument("contosoBooks.xml");
    XPathNavigator^ navigator = document->CreateNavigator();

    navigator->MoveToFollowing("price", "http://www.contoso.com/books");
    XPathNavigator^ boundary = navigator->Clone();

    navigator->MoveToRoot();

while (navigator->MoveToFollowing(XPathNodeType::Text, boundary))
    {
        Console::WriteLine(navigator->OuterXml);
    }
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();

navigator.MoveToFollowing("price", "http://www.contoso.com/books");
XPathNavigator boundary = navigator.Clone();

navigator.MoveToRoot();

while (navigator.MoveToFollowing(XPathNodeType.Text, boundary))
{
    Console.WriteLine(navigator.OuterXml);
}
Dim document As XPathDocument = New XPathDocument("contosoBooks.xml")
Dim navigator As XPathNavigator = document.CreateNavigator()

navigator.MoveToFollowing("price", "http://www.contoso.com/books")
Dim boundary As XPathNavigator = navigator.Clone()

navigator.MoveToRoot()

While navigator.MoveToFollowing(XPathNodeType.Text, boundary)
    Console.WriteLine(navigator.OuterXml)
End While

Örnek, dosyayı giriş olarak alır contosoBooks.xml .

<?xml version="1.0" encoding="utf-8" ?>  
<bookstore xmlns="http://www.contoso.com/books">  
    <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0">  
        <title>The Autobiography of Benjamin Franklin</title>  
        <author>  
            <first-name>Benjamin</first-name>  
            <last-name>Franklin</last-name>  
        </author>  
        <price>8.99</price>  
    </book>  
    <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2">  
        <title>The Confidence Man</title>  
        <author>  
            <first-name>Herman</first-name>  
            <last-name>Melville</last-name>  
        </author>  
        <price>11.99</price>  
    </book>  
    <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6">  
        <title>The Gorgias</title>  
        <author>  
            <name>Plato</name>  
        </author>  
        <price>9.99</price>  
    </book>  
</bookstore>  

Açıklamalar

  • MoveToFollowing yöntemi öznitelik veya ad alanı düğümlerine taşınmaz. XPathNodeType Parametre değeri veya NamespaceMoveToFollowing iseAttribute, yöntemi döndürür false ve öğesinin XPathNavigator konumu değişmez.

  • XPathNavigator Parametre olarak geçirilen sınır, geçerli XPathNavigator konumun ardından konumlandırılmazsa yoksayılır.

  • XPathNavigator Parametre null olarak geçirilen sınır, belirtilen XPathNodeType bir sonraki düğümse belge sırasına göre bulunur.

  • Yöntemler MoveToFollowing öznitelik veya ad alanı düğümlerine taşımak için kullanılamaz. Parametre olarak geçirilen sınır bir özniteliğin XPathNavigator veya ad alanı düğümünün üzerine konumlandırıldıysa, üst öğesinin XPathNavigator ilk alt düğümünde konumlandırılmış olan sınır parametresine eşdeğerdir. Bu, sınır parametresinin konumlandırdığı özniteliğin veya ad alanı düğümünün üst öğesinin XPathNavigator bu yöntemle eşleştirilmesini sağlar.

  • MoveToFollowing yöntemi döndürürsefalse, öğesinin XPathNavigator konumu değişmez.

Şunlara uygulanır

MoveToFollowing(String, String, XPathNavigator)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

öğesini XPathNavigator yerel adı ve ad alanı URI'sini belirtilen öğeye, belirtilen sınıra belge sırasına göre taşır.

public:
 virtual bool MoveToFollowing(System::String ^ localName, System::String ^ namespaceURI, System::Xml::XPath::XPathNavigator ^ end);
public virtual bool MoveToFollowing (string localName, string namespaceURI, System.Xml.XPath.XPathNavigator? end);
public virtual bool MoveToFollowing (string localName, string namespaceURI, System.Xml.XPath.XPathNavigator end);
abstract member MoveToFollowing : string * string * System.Xml.XPath.XPathNavigator -> bool
override this.MoveToFollowing : string * string * System.Xml.XPath.XPathNavigator -> bool
Public Overridable Function MoveToFollowing (localName As String, namespaceURI As String, end As XPathNavigator) As Boolean

Parametreler

localName
String

Öğesinin yerel adı.

namespaceURI
String

öğesinin ad alanı URI'si.

end
XPathNavigator

Öğe XPathNavigator sınırında konumlandırılan nesne, geçerli XPathNavigator öğe aşağıdaki öğeyi ararken geçmişe taşınmaz.

Döndürülenler

true başarılı bir XPathNavigator şekilde taşındıysa; değilse, false.

Örnekler

Aşağıdaki örnekte, XPathNavigator dosyasının kökünden contosoBooks.xml aşağıdaki book öğeye taşınır. nesnesinin XPathNavigator bir kopyası yöntemi kullanılarak Clone yapılır ve öğesinden book aşağıdaki first-name öğeye taşınır. Öğesinde first-name konumlandırılan kopyalanan XPathNavigator, sınır olarak kullanılır. Kopyalanan XPathNavigator konumundaki değişiklikler özgün XPathNavigatoröğesini etkilemez. Özgün XPathNavigator daha sonra parametresi olarak geçirilen sınırı ile yöntemini kullanarak MoveToFollowing aşağıdaki price öğeye taşımayı dener. Aşağıdaki price öğe sınırın ötesinde olduğundan bu taşıma işlemi başarısız olur. Özgün XPathNavigator daha sonra aynı yöntemi kullanarak sınırdan önceki aşağıdaki title öğeye geçmeyi dener ve başarılı olur.

XPathDocument^ document = gcnew XPathDocument("contosoBooks.xml");
XPathNavigator^ navigator = document->CreateNavigator();

navigator->MoveToFollowing("book", "http://www.contoso.com/books");
XPathNavigator^ boundary = navigator->Clone();
boundary->MoveToFollowing("first-name", "http://www.contoso.com/books");

navigator->MoveToFollowing("price", "http://www.contoso.com/books", boundary);

Console::WriteLine("Position (after boundary): {0}", navigator->Name);
Console::WriteLine(navigator->OuterXml);

navigator->MoveToFollowing("title", "http://www.contoso.com/books", boundary);

Console::WriteLine("Position (before boundary): {0}", navigator->Name);
Console::WriteLine(navigator->OuterXml);
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();

navigator.MoveToFollowing("book", "http://www.contoso.com/books");
XPathNavigator boundary = navigator.Clone();
boundary.MoveToFollowing("first-name", "http://www.contoso.com/books");

navigator.MoveToFollowing("price", "http://www.contoso.com/books", boundary);

Console.WriteLine("Position (after boundary): {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);

navigator.MoveToFollowing("title", "http://www.contoso.com/books", boundary);

Console.WriteLine("Position (before boundary): {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
Dim document As XPathDocument = New XPathDocument("contosoBooks.xml")
Dim navigator As XPathNavigator = document.CreateNavigator()

navigator.MoveToFollowing("book", "http://www.contoso.com/books")
Dim boundary As XPathNavigator = navigator.Clone()
boundary.MoveToFollowing("first-name", "http://www.contoso.com/books")

navigator.MoveToFollowing("price", "http://www.contoso.com/books", boundary)

Console.WriteLine("Position (after boundary): {0}", navigator.Name)
Console.WriteLine(navigator.OuterXml)

navigator.MoveToFollowing("title", "http://www.contoso.com/books", boundary)

Console.WriteLine("Position (before boundary): {0}", navigator.Name)
Console.WriteLine(navigator.OuterXml)

Örnek, dosyayı giriş olarak alır contosoBooks.xml .

<?xml version="1.0" encoding="utf-8" ?>  
<bookstore xmlns="http://www.contoso.com/books">  
    <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0">  
        <title>The Autobiography of Benjamin Franklin</title>  
        <author>  
            <first-name>Benjamin</first-name>  
            <last-name>Franklin</last-name>  
        </author>  
        <price>8.99</price>  
    </book>  
    <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2">  
        <title>The Confidence Man</title>  
        <author>  
            <first-name>Herman</first-name>  
            <last-name>Melville</last-name>  
        </author>  
        <price>11.99</price>  
    </book>  
    <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6">  
        <title>The Gorgias</title>  
        <author>  
            <name>Plato</name>  
        </author>  
        <price>9.99</price>  
    </book>  
</bookstore>  

Açıklamalar

  • XPathNavigator Parametre olarak geçirilen sınır, geçerli XPathNavigator konumun ardından konumlandırılmazsa yoksayılır.

  • XPathNavigator Sınır parametresi isenull, belirtilen yerel ada ve ad alanı URI'sine sahip aşağıdaki öğe belge sırasına göre bulunur.

  • Yöntemler MoveToFollowing öznitelik veya ad alanı düğümlerine taşımak için kullanılamaz. Parametre olarak geçirilen sınır bir özniteliğin XPathNavigator veya ad alanı düğümünün üzerine konumlandırıldıysa, üst öğesinin XPathNavigator ilk alt düğümünde konumlandırılmış olan sınır parametresine eşdeğerdir. Bu, sınır parametresinin konumlandırdığı özniteliğin veya ad alanı düğümünün üst öğesinin XPathNavigator bu yöntemle eşleştirilmesini sağlar.

  • MoveToFollowing yöntemi döndürürsefalse, öğesinin XPathNavigator konumu değişmez.

Şunlara uygulanır

MoveToFollowing(XPathNodeType)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

öğesini XPathNavigator belge sırasına göre belirtilen öğesinin XPathNodeType aşağıdaki öğesine taşır.

public:
 virtual bool MoveToFollowing(System::Xml::XPath::XPathNodeType type);
public virtual bool MoveToFollowing (System.Xml.XPath.XPathNodeType type);
abstract member MoveToFollowing : System.Xml.XPath.XPathNodeType -> bool
override this.MoveToFollowing : System.Xml.XPath.XPathNodeType -> bool
Public Overridable Function MoveToFollowing (type As XPathNodeType) As Boolean

Parametreler

type
XPathNodeType

XPathNodeType öğesinin öğesi. XPathNodeType veya NamespaceolamazAttribute.

Döndürülenler

true başarılı bir XPathNavigator şekilde taşındıysa; değilse, false.

Örnekler

Aşağıdaki örnekte, XPathNavigator dosyasının kökünden contosoBooks.xml aşağıdaki bookstore öğeye taşınır.

    XPathDocument^ document = gcnew XPathDocument("contosoBooks.xml");
    XPathNavigator^ navigator = document->CreateNavigator();

navigator->MoveToFollowing(XPathNodeType::Element);

    Console::WriteLine("Position: {0}", navigator->Name);
    Console::WriteLine(navigator->OuterXml);
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();

navigator.MoveToFollowing(XPathNodeType.Element);

Console.WriteLine("Position: {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
Dim document As XPathDocument = New XPathDocument("contosoBooks.xml")
Dim navigator As XPathNavigator = document.CreateNavigator()

navigator.MoveToFollowing(XPathNodeType.Element)

Console.WriteLine("Position: {0}", navigator.Name)
Console.WriteLine(navigator.OuterXml)

Örnek, dosyayı giriş olarak alır contosoBooks.xml .

<?xml version="1.0" encoding="utf-8" ?>  
<bookstore xmlns="http://www.contoso.com/books">  
    <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0">  
        <title>The Autobiography of Benjamin Franklin</title>  
        <author>  
            <first-name>Benjamin</first-name>  
            <last-name>Franklin</last-name>  
        </author>  
        <price>8.99</price>  
    </book>  
    <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2">  
        <title>The Confidence Man</title>  
        <author>  
            <first-name>Herman</first-name>  
            <last-name>Melville</last-name>  
        </author>  
        <price>11.99</price>  
    </book>  
    <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6">  
        <title>The Gorgias</title>  
        <author>  
            <name>Plato</name>  
        </author>  
        <price>9.99</price>  
    </book>  
</bookstore>  

Açıklamalar

Şunlara uygulanır

MoveToFollowing(String, String)

Source:
XPathNavigator.cs
Source:
XPathNavigator.cs
Source:
XPathNavigator.cs

öğesini XPathNavigator , yerel adı ve ad alanı URI'sini belge sırasına göre belirtilen öğeye taşır.

public:
 virtual bool MoveToFollowing(System::String ^ localName, System::String ^ namespaceURI);
public virtual bool MoveToFollowing (string localName, string namespaceURI);
abstract member MoveToFollowing : string * string -> bool
override this.MoveToFollowing : string * string -> bool
Public Overridable Function MoveToFollowing (localName As String, namespaceURI As String) As Boolean

Parametreler

localName
String

Öğesinin yerel adı.

namespaceURI
String

öğesinin ad alanı URI'si.

Döndürülenler

true başarılı bir XPathNavigator şekilde taşındıysa; değilse, false.

Örnekler

Aşağıdaki örnekte , XPathNavigator dosyanın kökünden contosoBooks.xml ilk price öğeye taşınır.

XPathDocument^ document = gcnew XPathDocument("contosoBooks.xml");
XPathNavigator^ navigator = document->CreateNavigator();

navigator->MoveToFollowing("price", "http://www.contoso.com/books");

Console::WriteLine("Position: {0}", navigator->Name);
Console::WriteLine(navigator->OuterXml);
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();

navigator.MoveToFollowing("price", "http://www.contoso.com/books");

Console.WriteLine("Position: {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
Dim document As XPathDocument = New XPathDocument("contosoBooks.xml")
Dim navigator As XPathNavigator = document.CreateNavigator()

navigator.MoveToFollowing("price", "http://www.contoso.com/books")

Console.WriteLine("Position: {0}", navigator.Name)
Console.WriteLine(navigator.OuterXml)

Örnek, dosyayı giriş olarak alır contosoBooks.xml .

<?xml version="1.0" encoding="utf-8" ?>  
<bookstore xmlns="http://www.contoso.com/books">  
    <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0">  
        <title>The Autobiography of Benjamin Franklin</title>  
        <author>  
            <first-name>Benjamin</first-name>  
            <last-name>Franklin</last-name>  
        </author>  
        <price>8.99</price>  
    </book>  
    <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2">  
        <title>The Confidence Man</title>  
        <author>  
            <first-name>Herman</first-name>  
            <last-name>Melville</last-name>  
        </author>  
        <price>11.99</price>  
    </book>  
    <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6">  
        <title>The Gorgias</title>  
        <author>  
            <name>Plato</name>  
        </author>  
        <price>9.99</price>  
    </book>  
</bookstore>  

Açıklamalar

MoveToFollowing yöntemi döndürürsefalse, öğesinin XPathNavigator konumu değişmez.

Şunlara uygulanır