You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Vitor Rodrigues <vi...@inescporto.pt> on 2001/04/30 11:40:43 UTC

Q: Problem with DOMParser

Hello,

I'm using xerces-1.2.1 to parse xml files. The problem is that the parser
can't determine if text is ignorable even when i put the property
"fIncludeIgnorableWhitespace" set to true. When parsing files with CR the
parser identifies a node text and include it in the DOM tree. The only way
that i can find is to serialize the file before parsing it.
Anyone can help me with this problem?

Thanks,
Vitor Rodrigues

This is the comment is the source file DOMParser.java:

/**
     * This feature determines whether text nodes that can be
     * considered "ignorable whitespace" are included in the DOM
     * tree.
     * <p>
     * Note: The only way that the parser can determine if text
     * is ignorable is by reading the associated grammar
     * and having a content model for the document. When
     * ignorable whitespace text nodes *are* included in
     * the DOM tree, they will be flagged as ignorable.
     * The ignorable flag can be queried by calling the
     * TextImpl#isIgnorableWhitespace():boolean method.
     *
     * @param include True to include ignorable whitespace text nodes;
     *                false to not include ignorable whitespace text
     *                nodes.
     *
     * @see #getIncludeIgnorableWhitespace
     */
    public void setIncludeIgnorableWhitespace(boolean include)
        throws SAXNotRecognizedException, SAXNotSupportedException {
        fIncludeIgnorableWhitespace = include;
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org