XPathNavigator.MoveToFollowing 메서드

정의

XPathNavigator 문서 순서대로 지정된 요소로 이동합니다.

오버로드

Name Description
MoveToFollowing(XPathNodeType, XPathNavigator)

XPathNavigator 지정된 요소의 XPathNodeType 다음 요소로 문서 순서대로 지정된 경계로 이동합니다.

MoveToFollowing(String, String, XPathNavigator)

XPathNavigator 로컬 이름 및 네임스페이스 URI가 지정된 요소로 문서 순서대로 지정된 경계로 이동합니다.

MoveToFollowing(XPathNodeType)

지정한 XPathNavigator 문서 순서의 XPathNodeType 다음 요소로 이동합니다.

MoveToFollowing(String, String)

XPathNavigator 로컬 이름 및 네임스페이스 URI가 문서 순서로 지정된 요소로 이동합니다.

MoveToFollowing(XPathNodeType, XPathNavigator)

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

XPathNavigator 지정된 요소의 XPathNodeType 다음 요소로 문서 순서대로 지정된 경계로 이동합니다.

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

매개 변수

type
XPathNodeType

XPathNodeType 요소의 요소입니다. 이XPathNodeType(가) AttributeNamespace 수 없거나

end
XPathNavigator

XPathNavigator 다음 요소를 검색하는 동안 현재 XPathNavigator 가 과거로 이동하지 않는 요소 경계에 배치된 개체입니다.

반품

성공적으로 이동하면 고, 그렇지 않으면 .입니다.

예제

다음 예제 XPathNavigator 에서는 파일의 contosoBooks.xml 루트에서 다음 price 요소로 이동합니다. 메서드를 XPathNavigator 사용하여 개체의 복제본이 Clone 만들어집니다. 요소에 XPathNavigator 배치된 복제price된 복제는 경계로 사용됩니다. 복제 XPathNavigator 된 위치의 변경 내용은 원래 XPathNavigator위치에 영향을 미치지 않습니다. 원본 XPathNavigator 은 메서드를 사용하여 contosoBooks.xml 파일의 MoveToRoot 루트로 다시 이동합니다. 작성자의 제목과 이름과 성은 메서드와 MoveToFollowingXPathNodeType다음을 사용하여 Text 검색됩니다. 메서드는 MoveToFollowing 요소 경계에 도달할 때까지 true를 price 반환합니다.

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

이 예제에서는 파일을 입력으로 사용합니다 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>

설명

  • 메서드는 MoveToFollowing 특성 또는 네임스페이스 노드로 이동하지 않습니다. 매개 변수 값이 XPathNodeTypeAttribute 거나 Namespace메서드가 MoveToFollowing 반환 false 되고 위치가 XPathNavigator 변경되지 않은 경우

  • XPathNavigator 매개 변수로 전달된 경계가 현재 XPathNavigator 위치 뒤의 위치에 있지 않으면 무시됩니다.

  • 매개 변수로 전달된 경계가 다음 노드인 XPathNavigator 경우 null 지정한 XPathNodeType 다음 노드는 문서 순서대로 배치됩니다.

  • 메서드를 MoveToFollowing 사용하여 특성 또는 네임스페이스 노드로 이동할 수 없습니다. XPathNavigator 매개 변수로 전달된 경계가 특성 또는 네임스페이스 노드 위에 배치되는 경우 부모 요소의 첫 번째 자식 노드에 배치된 경계 매개 변수와 동일합니다XPathNavigator. 이렇게 하면 경계 매개 변수가 배치된 특성 또는 네임스페이스 노드의 XPathNavigator 부모 요소를 이 메서드와 일치시킬 수 있습니다.

  • 메서드가 MoveToFollowing 반환 false되는 경우 위치 XPathNavigator 는 변경되지 않습니다.

적용 대상

MoveToFollowing(String, String, XPathNavigator)

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

XPathNavigator 로컬 이름 및 네임스페이스 URI가 지정된 요소로 문서 순서대로 지정된 경계로 이동합니다.

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

매개 변수

localName
String

요소의 로컬 이름입니다.

namespaceURI
String

요소의 네임스페이스 URI입니다.

end
XPathNavigator

XPathNavigator 다음 요소를 검색하는 동안 현재 XPathNavigator 가 과거로 이동하지 않는 요소 경계에 배치된 개체입니다.

반품

성공적으로 이동하면 고, 그렇지 않으면 .입니다.

예제

다음 예제 XPathNavigator 에서는 파일의 contosoBooks.xml 루트에서 다음 book 요소로 이동합니다. 개체의 XPathNavigator 복제본은 메서드를 Clone 사용하여 만들어지고 요소에서 book 다음 first-name 요소로 이동됩니다. 요소에 XPathNavigator 배치된 복제first-name된 복제는 경계로 사용됩니다. 복제 XPathNavigator 된 위치의 변경 내용은 원래 XPathNavigator위치에 영향을 미치지 않습니다. 그런 다음 원래 XPathNavigator 는 매개 변수로 전달된 경계가 있는 메서드를 price 사용하여 다음 MoveToFollowing 요소로 이동하려고 시도합니다. 다음 price 요소가 경계를 벗어나므로 이 이동은 실패합니다. 그런 다음 원래 XPathNavigator 는 동일한 메서드를 사용하여 경계 앞에 있는 다음 title 요소로 이동하려고 시도하고 성공합니다.

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)

이 예제에서는 파일을 입력으로 사용합니다 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>

설명

  • XPathNavigator 매개 변수로 전달된 경계가 현재 XPathNavigator 위치 뒤의 위치에 있지 않으면 무시됩니다.

  • XPathNavigator 경계 매개 변수인 경우 로컬 이름과 네임스페이null스 URI가 지정된 다음 요소는 문서 순서대로 배치됩니다.

  • 메서드를 MoveToFollowing 사용하여 특성 또는 네임스페이스 노드로 이동할 수 없습니다. XPathNavigator 매개 변수로 전달된 경계가 특성 또는 네임스페이스 노드 위에 배치되는 경우 부모 요소의 첫 번째 자식 노드에 배치된 경계 매개 변수와 동일합니다XPathNavigator. 이렇게 하면 경계 매개 변수가 배치된 특성 또는 네임스페이스 노드의 XPathNavigator 부모 요소를 이 메서드와 일치시킬 수 있습니다.

  • 메서드가 MoveToFollowing 반환 false되는 경우 위치 XPathNavigator 는 변경되지 않습니다.

적용 대상

MoveToFollowing(XPathNodeType)

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

지정한 XPathNavigator 문서 순서의 XPathNodeType 다음 요소로 이동합니다.

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

매개 변수

type
XPathNodeType

XPathNodeType 요소의 요소입니다. 이XPathNodeType(가) AttributeNamespace 수 없거나

반품

성공적으로 이동하면 고, 그렇지 않으면 .입니다.

예제

다음 예제 XPathNavigator 에서는 파일의 contosoBooks.xml 루트에서 다음 bookstore 요소로 이동합니다.

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)

이 예제에서는 파일을 입력으로 사용합니다 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>

설명

적용 대상

MoveToFollowing(String, String)

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

XPathNavigator 로컬 이름 및 네임스페이스 URI가 문서 순서로 지정된 요소로 이동합니다.

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

매개 변수

localName
String

요소의 로컬 이름입니다.

namespaceURI
String

요소의 네임스페이스 URI입니다.

반품

성공적으로 이동하면 고, 그렇지 않으면 .입니다.

예제

다음 예제 XPathNavigator 에서는 파일의 contosoBooks.xml 루트에서 첫 번째 price 요소로 이동합니다.

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)

이 예제에서는 파일을 입력으로 사용합니다 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>

설명

메서드가 MoveToFollowing 반환 false되는 경우 위치 XPathNavigator 는 변경되지 않습니다.

적용 대상