XML 한글 커멘트1 [Tips] Python 에서 XML comment 처리 - Sample code 제공 1. Python으로 XML 처리할 때 comment 남겨두기 Python 에서 XML 처리할 때 많이 사용하는 ElementTree 기준으로 설명한다. Comment가 포함된 XML 파일을 ElementTree.parser() 사용해서 읽어 보면 Tree element 에 comment 는 포함되지 않는다. 만일 XML File 의 Comment 를 유지해야 하는 경우 아래와 같이 CommentedTreeBuilder class를 만들고 comment() 함수를 추가해야 한다. ElementTree 의 API 에 대한 설명은 https://docs.python.org/3.8/library/xml.etree.elementtree.html 에 자세하게 작성되어 있고, 내부 구현을 따라가보면 XML tree.. 2020. 6. 2. 이전 1 다음