section.appendData(s);
section.appendData(s);
Element element = doc.getDocumentElement(); CDATASection cdata = doc.createCDATASection("mycdata"); cdata.appendData("contents"); element.appendChild(cdata);
private Node appendToCursor(String data) { if (cursor == null) { Element doc = document.getDocumentElement(); if( doc != null ){ cursor = doc; } else { cursor = document; } } if (cursor.getNodeType() == Node.CDATA_SECTION_NODE) { CDATASection section = (CDATASection) cursor; section.appendData(data); return section; } else { return appendToCursor(document.createTextNode(data)); } }
/** * Receive notification of character data. * * @param ch * The characters from the XML document. * @param start * The start position in the array. * @param length * The number of characters to read from the array. */ @Override public void characters(char[] ch, int start, int length) throws SAXException { if (getState() == State.DOCUMENTATION) { if (getMixedContentState() == MixedContentState.CDATA) { this.currentMixedContentCDataSection.appendData(new String( ch, start, length)); } else if (getMixedContentState() != MixedContentState.ENTITY) { this.currentMixedContentNode .appendChild(this.mixedContentDocument .createTextNode(new String(ch, start, length))); } } }
/** * Characters. */ public void characters(XMLString text, Augmentations augs) throws XNIException { if (fInCDATASection) { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE) { CDATASection cdata = (CDATASection) node; cdata.appendData(text.toString()); } else { CDATASection cdata = fDocument.createCDATASection(text.toString()); fCurrentNode.appendChild(cdata); } } else { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.TEXT_NODE) { Text textNode = (Text) node; textNode.appendData(text.toString()); } else { Text textNode = fDocument.createTextNode(text.toString()); fCurrentNode.appendChild(textNode); } } } // characters(XMLString,Augmentations)
/** * Characters. */ public void characters(XMLString text, Augmentations augs) throws XNIException { if (fInCDATASection) { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE) { CDATASection cdata = (CDATASection) node; cdata.appendData(text.toString()); } else { CDATASection cdata = fDocument.createCDATASection(text.toString()); fCurrentNode.appendChild(cdata); } } else { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.TEXT_NODE) { Text textNode = (Text) node; textNode.appendData(text.toString()); } else { Text textNode = fDocument.createTextNode(text.toString()); fCurrentNode.appendChild(textNode); } } } // characters(XMLString,Augmentations)
/** Characters. */ public void characters(XMLString text, Augmentations augs) throws XNIException { if (fInCDATASection) { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE) { CDATASection cdata = (CDATASection)node; cdata.appendData(text.toString()); } else { CDATASection cdata = fDocument.createCDATASection(text.toString()); fCurrentNode.appendChild(cdata); } } else { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.TEXT_NODE) { Text textNode = (Text)node; textNode.appendData(text.toString()); } else { Text textNode = fDocument.createTextNode(text.toString()); fCurrentNode.appendChild(textNode); } } } // characters(XMLString,Augmentations)
/** Characters. */ @Override public void characters(XMLString text, Augmentations augs) throws XNIException { if (fInCDATASection) { final Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE) { final CDATASection cdata = (CDATASection)node; cdata.appendData(text.toString()); } else { final CDATASection cdata = fDocument.createCDATASection(text.toString()); fCurrentNode.appendChild(cdata); } } else { final Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.TEXT_NODE) { final Text textNode = (Text)node; textNode.appendData(text.toString()); } else { final Text textNode = fDocument.createTextNode(text.toString()); fCurrentNode.appendChild(textNode); } } }
section.appendData(s);
/** Characters. */ public void characters(XMLString text, Augmentations augs) throws XNIException { if (fInCDATASection) { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.CDATA_SECTION_NODE) { CDATASection cdata = (CDATASection)node; cdata.appendData(text.toString()); } else { CDATASection cdata = fDocument.createCDATASection(text.toString()); fCurrentNode.appendChild(cdata); } } else { Node node = fCurrentNode.getLastChild(); if (node != null && node.getNodeType() == Node.TEXT_NODE) { Text textNode = (Text)node; textNode.appendData(text.toString()); } else { Text textNode = fDocument.createTextNode(text.toString()); fCurrentNode.appendChild(textNode); } } } // characters(XMLString,Augmentations)
section.appendData(s);
section.appendData(s);
section.appendData(s);
section.appendData(s);
section.appendData(s);
section.appendData(s);