당신을 수행 자신의 글을 써야하거나 tinyxml2를 사용할 수 있습니까? SAX 파서없이 tinyxml2를 사용하여 문서를 알고있는 경우
같은 것을 시도 :
/* ------ Example 2: Lookup information. ---- */
{
XMLDocument doc;
doc.LoadFile("dream.xml");
// Structure of the XML file:
// - Element "PLAY" the root Element, which is the
// FirstChildElement of the Document
// - - Element "TITLE" child of the root PLAY Element
// - - - Text child of the TITLE Element
// Navigate to the title, using the convenience function,
// with a dangerous lack of error checking.
const char* title = doc.FirstChildElement("PLAY")->FirstChildElement("TITLE")->GetText();
printf("Name of play (1): %s\n", title);
// Text is just another Node to TinyXML-2. The more
// general way to get to the XMLText:
XMLText* textNode = doc.FirstChildElement("PLAY")->FirstChildElement("TITLE")->FirstChild()->ToText();
title = textNode->Value();
printf("Name of play (2): %s\n", title);
}
당신이 SAX 파서를 사용하려는 경우, tinyxml2 모드 그뿐만 아니라 지원합니다. 예를 들어, cocos2d-x로 넘어 가서 tinyxml2를 호출하고 서브 클래스 인 CCSAXParser 클래스를 살펴보면 거의 모든 XML 파일을 구문 분석 할 수 있습니다.
출처 : tinyXML2 cocos2d-x
가 사용할 언어를 선택합니다. XML 코드를 쉽게 파싱 할 수있는 라이브러리를 사용하지 않는 이유는 무엇입니까? – nio
같은 질문에 대한 위대한 답변을 읽어 보시기 바랍니다. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – yonosoytu
그냥 기다리고 있습니다. 누군가 XHTML 응답에 연결될 때까지 ... (편집 : 오, 잠깐, 거기 간다.) – acdcjunior