本文整理匯總了Java中org.w3c.dom.CDATASection.appendData方法的典型用法代碼示例。如果您正苦於以下問題:Java CDATASection.appendData方法的具體用法?Java CDATASection.appendData怎麽用?Java CDATASection.appendData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.w3c.dom.CDATASection
的用法示例。
在下文中一共展示了CDATASection.appendData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: cdata
import org.w3c.dom.CDATASection; //導入方法依賴的package包/類
/**
* Receive notification of cdata.
*
* <p>The Parser will call this method to report each chunk of
* character data. SAX parsers may return all contiguous character
* data in a single chunk, or they may split it into several
* chunks; however, all of the characters in any single event
* must come from the same external entity, so that the Locator
* provides useful information.</p>
*
* <p>The application must not attempt to read from the array
* outside of the specified range.</p>
*
* <p>Note that some parsers will report whitespace using the
* ignorableWhitespace() method rather than this one (validating
* parsers must do so).</p>
*
* @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.
* @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException
{
if(isOutsideDocElem()
&& com.sun.org.apache.xml.internal.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
return; // avoid DOM006 Hierarchy request error
String s = new String(ch, start, length);
CDATASection section =(CDATASection) m_currentNode.getLastChild();
section.appendData(s);
}
示例2: cdata
import org.w3c.dom.CDATASection; //導入方法依賴的package包/類
/**
* Receive notification of cdata.
*
* <p>The Parser will call this method to report each chunk of
* character data. SAX parsers may return all contiguous character
* data in a single chunk, or they may split it into several
* chunks; however, all of the characters in any single event
* must come from the same external entity, so that the Locator
* provides useful information.</p>
*
* <p>The application must not attempt to read from the array
* outside of the specified range.</p>
*
* <p>Note that some parsers will report whitespace using the
* ignorableWhitespace() method rather than this one (validating
* parsers must do so).</p>
*
* @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.
* @see #ignorableWhitespace
* @see org.xml.sax.Locator
*/
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException
{
if(isOutsideDocElem()
&& org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length))
return; // avoid DOM006 Hierarchy request error
String s = new String(ch, start, length);
CDATASection section =(CDATASection) m_currentNode.getLastChild();
section.appendData(s);
}