---
sourceDocument: 호주 API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/api-reference

 Release :

    - australia

ft:locale :

    - ko-KR

ft:publication_title :

    - 호주 API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# XMLNodeIterator - 범위 지정됨

# XMLNodeIterator - 범위 지정됨 {#ariaid-title1}

* 릴리스 버전: Australia
* 
* 업데이트 날짜 2026년 03월 12일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 2분

XMLNodeIterator API는 XML 문서의 노드를 반복하는 메서드를 제공합니다.

XMLNodeIterator 개체의 독립 실행형 인스턴스를 만들기 위한 생성자가 없습니다. XMLNodeIterator 객체를 만들려면 [XMLNode 객체](https://servicenow-prod.fluidtopics.net/5HF9qzFjqbZceq6ctsQFSw#c_XMLNodeScopedAPI "XMLNode API는 XML 노드에서 값을 쿼리하는 메서드를 제공합니다. XML 문자열을 포함하는 XMLDocument2 객체에서 XMLNode가 추출됩니다.")의 getChildNodeIterator() 메서드를 사용합니다.

## XMLNodeIterator - hasNext() {#ariaid-title2}

반복에 더 많은 요소가 있는 경우 예를 반환합니다.
{#r_ScopedXMLNodeIteratorHasNext__table_d2h_pfc_2r__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 안 함 |   |   |
[표 1. 매개변수]

{#r_ScopedXMLNodeIteratorHasNext__table_d2h_pfc_2r} {#r_ScopedXMLNodeIteratorHasNext__table_dcg_pg5_1r__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 반복에 더 많은 요소가 있는 경우 예입니다. |
[표 2. 반환]

{#r_ScopedXMLNodeIteratorHasNext__table_dcg_pg5_1r}  

    var xmlString = "<test>" +
                    "  <one>" +
                    "    <two att=\"xxx\">abcd1234</two>" +
                    "    <three boo=\"yah\" att=\"yyy\">1234abcd</three>" +
                    "    <two>another</two>" +
                    "  </one>" +
                    "  <number>1234</number>" +
                    "</test>";
    var xmlDoc = new XMLDocument2();
    xmlDoc.parseXML(xmlString);
    var node = xmlDoc.getNode('//one');
    var iter= node.getChildNodeIterator();
    gs.info(iter.hasNext());

## XMLNodeIterator - next() {#ariaid-title3}

반복의 다음 요소를 가져옵니다. XML이 "예쁜 형식"인 경우 반환된 요소는 공백/탭의 #text 노드일 수 있습니다.
{#r_ScopedXMLNodeIteratorNext__table_asl_4fc_2r__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 안 함 |   |   |
[표 3. 매개변수]

{#r_ScopedXMLNodeIteratorNext__table_asl_4fc_2r} {#r_ScopedXMLNodeIteratorNext__table_dnj_dh5_1r__entry__2}

| 유형 | 설명 |
|-|-|
| XML 노드 | 반복의 다음 요소입니다. |
[표 4. 반환]

{#r_ScopedXMLNodeIteratorNext__table_dnj_dh5_1r}  

    var xmlString = "<test>" +
                    "  <one>" +
                    "    <two att=\"xxx\">abcd1234</two>" +
                    "    <three boo=\"yah\" att=\"yyy\">1234abcd</three>" +
                    "    <two>another</two>" +
                    "  </one>" +
                    "  <number>1234</number>" +
                    "</test>";
    var xmlDoc = new XMLDocument2();
    xmlDoc.parseXML(xmlString);
    var node = xmlDoc.getNode('//one');
    var iter= node.getChildNodeIterator();
    while(iter.hasNext()) {
       var n = iter.next();
       gs.info('Node name: ' +  n.getNodeName());
       gs.info('Node value: ' +  n.getNodeValue());
    }

출력:

    Node name: #text
    Node value:     
    Node name: two
    Node value: null
    Node name: #text
    Node value:     
    Node name: three
    Node value: null
    Node name: #text
    Node value:     
    Node name: two
    Node value: null
    Node name: #text
    Node value:


