當前位置: 首頁>>代碼示例>>Java>>正文


Java CDATASection.appendData方法代碼示例

本文整理匯總了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);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:35,代碼來源:DOMBuilder.java

示例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);
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:35,代碼來源:DOMBuilder.java


注:本文中的org.w3c.dom.CDATASection.appendData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。