큰 xml을 구문 분석 할 때 이상한 동작이 있습니다 (그러나 큰 사실로 인해 문제가 발생하는지 잘 모르겠습니다). 이 XML 형식이다 :Roku - 조작되지 않은 xml 구문 분석 안 함
<?xml version="1.0" encoding="UTF-8"?>
<webservice>
<control>
<operation>get_clips</operation>
<status>0</status>
</control>
<data>
<cat size="4" lang="EN"/>
<cat size="3" lang="EN"/>
' and 19 more other similar 'cat' elements
</data>
</webservice>
이것은 m.rawResponse
위의 XML 문자열입니다 코드입니다.
if m.rawResponse <> "" then
xml = CreateObject("roXMLElement")
print "################ "; m.rawResponse ' contains the entire xml
xml.Parse(m.rawResponse)
print "################ "; m.rawResponse ' contains the entire xml
' I've tried like this
categories = xml.data.GetChildElements()
print "number of categories: " ; categories.Count() ' prints 14
' and also like this
i = 0
for each categ in xml.data.cat
i = i +1
end for
print i ' prints 14
end if
문제는 21 개가 아닌 14 개의 고양이 요소 만 처리한다는 것입니다. 아이디어로 도와주세요. 감사합니다.
나중에 편집 구문 분석에 성공했는지 여부를 확인했습니다. 문제는 기호 &
관련이있다 - 나는 XML에 다음과 같은 라인을 가지고 :
<director>Donald Nij & Rick Senjin</director>
나는이 문제를 해결하지만 서버 측에서,하지만 로쿠 코드에 어떻게
? 인터넷을 통해 검색하는 솔루션을 찾을 수 없었습니다. Tks.
다른 19 '고양이'요소도 게시 해주세요. – Torious
@ 토리 스 : 질문을 업데이트했습니다 ... 문제가있는 곳이 조금 더 분명하지만 아직 해결 방법이 없습니다 ... – Paul
예'&'는 XML – Torious