Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-483

IgnoreWhitespace does not work for schema validation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 2.2.0
    • None
    • None
    • Operating System: All
      Platform: Other
    • 13543

    Description

      Before parsing a valid xml document that contains a reference to a valid xsl
      schema, I set the IgnoringElementContentWhitespace feature to true on the
      DocumentBuilderFactory, but the resulting Document still contains the TEXT
      Nodes containing whitespace. I was using jdk 1.4 and the latest
      xercesImpl.jar. This is the sample code:
      DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
      domFactory.setNamespaceAware(true);
      domFactory.setValidating(true);
      domFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
      domFactory.setIgnoringComments(true);
      domFactory.setIgnoringElementContentWhitespace(true);
      builder = domFactory.newDocumentBuilder();
      Document doc = builder.parse(xml);

      Attachments

        Activity

          People

            Unassigned Unassigned
            fjd@cysive.com Francisco Dominguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: