java & xml 질문입니다.
꿈
생략
Element mustWork=doc.createElement(해야할일);
Element work=doc.createElement(할일);
mustWork.appendChild(work);
doc.appendChild(mustWork);
XmlDocument xmlDocument=(XmlDocument)doc;
xmlDocument.write(new OutputStreamWriter(System.out));
}catch(ParserConfigurationException e){
System.out.println(해당 문서를 해석하는 파서를 생성하지 못했습니다);
}catch(IOException e){
System.out.println(해당 파일을 열지 못했습니다);
}
}
public static void main(String[] args) {
new ElementCreateTest();
}
}
xml문서형태로 프롬프트창에 출력했습니다. 그런데 encoding을 euc-kr로 바꾸려고 합니다..
바꾸는 메서드가 존재하나요? 알려주세요,..꾸벅..
?xml version=1.0 encoding=MS949?
해야할일
할일 /
/해야할일
-
겨라
아.... 감사합니다.꾸벅..
-
놓아줄게요
xmlDocument.write(new OutputStreamWriter(System.out));를
xmlDocument.write(new OutputStreamWriter(System.out), \euc-kr\);로
하시면 되요. -
Together
어떤 방법으로 바꿀수 있을까요? 꾸벅