XPathNavigator.MoveToFollowing 메서드

정의

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

오버로드

MoveToFollowing(XPathNodeType, XPathNavigator)

지정된 경계 내에서 문서 순서에 따라 XPathNavigator를 지정된 XPathNodeType의 다음 요소로 이동합니다.

MoveToFollowing(String, String, XPathNavigator)

지정된 경계 내에서 문서 순서에 따라 XPathNavigator를 지정된 로컬 이름 및 네임스페이스 URI를 사용하는 요소로 이동합니다.

MoveToFollowing(XPathNodeType)

문서 순서에 따라 지정된 XPathNodeType의 다음 요소로 XPathNavigator를 이동합니다.

MoveToFollowing(String, String)

문서 순서에 따라 XPathNavigator를 지정된 로컬 이름 및 네임스페이스 URI를 사용하는 요소로 이동합니다.

MoveToFollowing(XPathNodeType, XPathNavigator)

지정된 경계 내에서 문서 순서에 따라 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입니다. XPathNodeTypeAttribute 또는 Namespace일 수 없습니다.

end
XPathNavigator

다음 요소를 검색하는 동안 현재 XPathNavigator가 벗어나지 않을 요소 경계에 있는 XPathNavigator 개체입니다.

반환

Boolean

XPathNavigator가 성공적으로 이동하면 true이고, 그러지 않으면 false입니다.

예제

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

    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

이 예제에서는 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 특성 또는 네임스페이스 노드로 이동하지 않습니다. 매개 변수 값이 XPathNodeType Attribute 아니면 Namespace메서드가 MoveToFollowing 반환 false 되고 위치가 XPathNavigator 변경되지 않습니다.

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

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

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

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

적용 대상

MoveToFollowing(String, String, XPathNavigator)

지정된 경계 내에서 문서 순서에 따라 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 개체입니다.

반환

Boolean

XPathNavigator가 성공적으로 이동하면 true이고, 그러지 않으면 false입니다.

예제

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

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)

이 예제에서는 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)

문서 순서에 따라 지정된 XPathNodeType의 다음 요소로 XPathNavigator를 이동합니다.

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입니다. XPathNodeTypeAttribute 또는 Namespace일 수 없습니다.

반환

Boolean

XPathNavigator가 성공적으로 이동하면 true이고, 그러지 않으면 false입니다.

예제

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

    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)

이 예제에서는 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)

문서 순서에 따라 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입니다.

반환

Boolean

XPathNavigator가 성공적으로 이동하면 true이고, 그러지 않으면 false입니다.

예제

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

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)

이 예제에서는 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 는 변경되지 않습니다.

적용 대상