I had downloaded JAXP Winter Pack on Debian Linux. I have JDK1.2.2 I use an XML file with very large CData sections( that keep SQL text ). DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); ....................... File f = new File("some_file.xml"); DocumentBuilder builder = factory.newDocumentBuilder(); xmlConfig= builder.parse(f); ........................................... When I find node, that contain <![CDATA[....big...big SQL,many lines ]]> NodeList textChildren = ndSQL.getChildNodes(); Node dataNode; for (int j = 0; j<textChildren.getLength();j++){ dataNode = textChildren.item(j); switch (dataNode.getNodeType()) { case Node.CDATA_SECTION_NODE: System.out.print( dataNode.getNodeValue() ); break; case Node.TEXT_NODE: System.out.print( dataNode.getNodeValue() ); break; } }
getNodeValue of corresponding CDataSection returns only first line!("select.."), its getLength() returns 9(!); and when I print whole DOM tree, using something like: ......................................... TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); DOMSource source = new DOMSource(xmlConfig); StreamResult result = new StreamResult(System.out); transformer.transform(source, result); .................................., I see, that EACH CData section is stripped: <![CDATA[only first line... ]]> Actually, these code snippets - only from testing module; that was used in servlet to serve requests for data; and output to httpResponse; but the fact is that during parsing, each CDATA section is stripped. I am quite unhappy of this. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]