Dil

XPathNavigator.MoveToFollowing Yöntem

Tanım

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

Aşırı Yüklemeler

Name Description
MoveToFollowing(XPathNodeType, XPathNavigator)

öğesini XPathNavigator belirtilen öğesinin 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, belge sırasına göre belirtilen sınıra 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)

Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs

öğesini XPathNavigator belirtilen öğesinin 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

end
XPathNavigator

Aşağıdaki XPathNavigator öğeyi ararken geçerlinin XPathNavigator geçmediği öğe sınırında konumlandırılan nesne.

Döndürülenler

true XPathNavigator başarılı bir ş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 XPathNavigator konumlandırılan kopyalanan price, 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 yöntemi MoveToFollowingXPathNodeTypekullanılarak Text alınır. yöntemi, MoveToFollowing öğe sınırına ulaşılana price kadar true döndürür.

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, contosoBooks.xml dosyasını giriş olarak alır.

<?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

  • yöntemi öznitelik MoveToFollowing veya ad alanı düğümlerine taşınmaz. XPathNodeType Parametre değeri veya AttributeNamespace iseMoveToFollowing, 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 olarak geçirilen sınır aşağıdaki düğüm ise null belirtilen XPathNodeType belge sırasına göre bulunur.

  • Yöntemler MoveToFollowing öznitelik veya ad alanı düğümlerine taşımak için kullanılamaz. XPathNavigator Parametre olarak geçirilen sınır bir öznitelik veya ad alanı düğümü üzerinde konumlandırılırsa, üst öğesinin XPathNavigator ilk alt düğümünde konumlandırılmış sınır parametresine eşdeğerdir. Bu, sınır parametresinin konumlandırılacağı ö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)

Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs

öğesini XPathNavigator yerel adı ve ad alanı URI'sini belirtilen öğeye, belge sırasına göre belirtilen sınıra 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

Aşağıdaki XPathNavigator öğeyi ararken geçerlinin XPathNavigator geçmediği öğe sınırında konumlandırılan nesne.

Döndürülenler

true XPathNavigator başarılı bir ş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 XPathNavigator konumlandırılan kopyalanan first-name, 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 price aşağıdaki MoveToFollowing öğeye geçmeyi 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 = 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, contosoBooks.xml dosyasını giriş olarak alır.

<?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, 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. XPathNavigator Parametre olarak geçirilen sınır bir öznitelik veya ad alanı düğümü üzerinde konumlandırılırsa, üst öğesinin XPathNavigator ilk alt düğümünde konumlandırılmış sınır parametresine eşdeğerdir. Bu, sınır parametresinin konumlandırılacağı ö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)

Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
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

Döndürülenler

true XPathNavigator başarılı bir ş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 = 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, contosoBooks.xml dosyasını giriş olarak alır.

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

Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
XPathNavigator.cs
Kaynak:
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 XPathNavigator başarılı bir ş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 = 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, contosoBooks.xml dosyasını giriş olarak alır.

<?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