/** * XML 문자열을 DOM(Document) 객체로 변환 * @param xmlStr XML문자열 * @return * @throws Exception */ private static Document getStringToDOM(String xmlStr) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(new StringReader(xmlStr))); } /** * DOM(Document) 객체를 XML 문자열로 변환 * @param xmlStr XML문자열 * @return * @throws Exception */ private static String getDOMToString(Document doc) throws Exception { TransformerFactory transfac = TransformerFactory.newInstance(); Transformer trans = transfac.newTransformer(); trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); trans.setOutputProperty(OutputKeys.INDENT, "yes"); StringWriter sw = new StringWriter(); StreamResult result = new StreamResult(sw); DOMSource source = new DOMSource(doc); trans.transform(source, result); return sw.toString(); }
DOM
- XML 문자열을 DOM(Document) 객체로 변환, DOM(Document) 객체를 XML 문자열로 변환 2010.09.01
- js DOM table 컨트롤 2010.03.18
- DOM createElement 2009.09.05
XML 문자열을 DOM(Document) 객체로 변환, DOM(Document) 객체를 XML 문자열로 변환
2010. 9. 1. 19:01
js DOM table 컨트롤
2010. 3. 18. 16:02
index:
cell 1-1 | cell 1-2 |
cell 2-1 | cell 2-2 |
cell 3-1 | cell 3-2 |
DOM createElement
2009. 9. 5. 13:29
_divBG = document.createElement("div"); _divBG.style.position = "absolute"; _divBG.style.top = 0; _divBG.style.left = 0; _divBG.style.backgroundColor = "black"; _divBG.style.width = document.body.clientWidth; _divBG.style.height = document.body.clientHeight; _divBG.style.filter = "alpha(opacity=20)"; _divBG.style.zIndex = 99; _divBG.style.display = "block"; document.body.appendChild(_divBG);