Google Apps Script XmlService를 사용하고 있습니다 . Document 객체 에 대한 특정 조작 후 단일 문자열로 반환하고 싶습니다.
XML을 문자열로 읽고 XmlService를 사용하여 Document 객체로 변환하고 일부 노드를 삭제 한 다음 스프레드 시트의 함수의 결과로 XML을 반환하기 위해 다시 문자열이되기를 원합니다. 어떻게하나요? 나는 아무 소용이없는 문서를 검색했습니다.
당신은 두 가지 옵션이 있습니다 : getPrettyFormat
및getRawFormat
https://developers.google.com/apps-script/reference/xml-service/xml-service#getPrettyFormat
https://developers.google.com/apps-script/reference/xml-service/xml-service#getrawformat
// Log an XML document in human-readable form.
var xml = '<root><a><b>Text!</b><b>More text!</b></a></root>';
var document = XmlService.parse(xml);
var output = XmlService.getPrettyFormat()
.format(document);
Logger.log(output);
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다