コード例 #1
0
  /**
   * 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>The application must not attempt to read from the array outside of the specified range.
   *
   * <p>Note that some parsers will report whitespace using the ignorableWhitespace() method rather
   * than this one (validating parsers must do so).
   *
   * @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);

    append(m_doc.createCDATASection(s));
  }
コード例 #2
0
  /**
   * If available, when the disable-output-escaping attribute is used, output raw text without
   * escaping. A PI will be inserted in front of the node with the name "lotusxsl-next-is-raw" and a
   * value of "formatter-to-dom".
   *
   * @param ch Array containing the characters
   * @param start Index to start of characters in the array
   * @param length Number of characters in the array
   */
  public void charactersRaw(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);

    append(m_doc.createProcessingInstruction("xslt-next-is-raw", "formatter-to-dom"));
    append(m_doc.createTextNode(s));
  }
コード例 #3
0
  /**
   * Receive notification of character data.
   *
   * <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>The application must not attempt to read from the array outside of the specified range.
   *
   * <p>Note that some parsers will report whitespace using the ignorableWhitespace() method rather
   * than this one (validating parsers must do so).
   *
   * @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 characters(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

    if (m_inCData) {
      cdata(ch, start, length);

      return;
    }

    String s = new String(ch, start, length);
    Text text = m_doc.createTextNode(s);

    append(text);
  }