Results 1 to 2 of 2
  1. #1
    boy22 is offline Member
    Join Date
    Jul 2007
    Posts
    36
    Rep Power
    0

    Default org.xml.sax.SAXParseException: Content is not allowed in trailing section

    I'm trying to make an XMLDocument from a String with this information:
    Java Code:
    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Report SYSTEM "Report.dtd">
    <Report ><Person name="Jessey"><Date ="2007/1/2">
    </Date ></Person ></Report >
    This is the code used for creating the Document:
    Java Code:
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
    CharArrayReader characterStream = new CharArrayReader(xmlstring.toCharArray());
    InputSource is = new InputSource(characterStream);
    Document documentXML = documentBuilder.parse(is);
    and this error appears:
    Java Code:
    org.xml.sax.SAXParseException:
     Content is not allowed in trailing section.
    I don't know what is the problem.
    do you?
    thanks

  2. #2
    simon is offline Member
    Join Date
    Jul 2007
    Posts
    44
    Rep Power
    0

    Default

    try with xmlString.trim () and StringReader instead of the CharReader

Similar Threads

  1. Asbru Web Content Management 6.7.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-01-2008, 04:14 PM
  2. Replies: 1
    Last Post: 03-28-2008, 05:08 PM
  3. Two content panes in one GUI?
    By Leprechaun in forum New To Java
    Replies: 1
    Last Post: 01-31-2008, 04:02 AM
  4. No duplicates allowed in Sets
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-21-2008, 04:33 PM
  5. Replies: 1
    Last Post: 07-24-2007, 01:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •