Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-96

XmlDocumentProperties missing version and encoding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Version 1.0.3
    • None
    • None
    • Windows 2000, jdk 1.4.2_05

    Description

      The version and encoding properties are null in XmlDocumentProperties object after parsing a document, although the document begins with an xml declaration including version and encoding.

      Example
      --------
      String xml = ... //string that begins with <?xml version="1.0" encoding="UTF-8" ?>
      SomeDocument doc = SomeDocument.Factory.parse(xml);
      XmlDocumentProperties props = doc.documentProperties();
      String version = props.getVersion(); //=> should be "1.0" but is null!
      String encoding = props.getEncoding(); //=> should be "UTF-8" but is null!

      Parsing is ok otherwise and the document can be successfully validated. Only tested on 1.0.3.

      Is there a workaround? I.e. can version and encoding be retrieved from the XmlObject in another way? (I have not managed to retrieve it by using a cursor.)

      Also, I think it is an error that the xml declaration is not included when getting the xml as a string(e.g. using xmlText()) from a document. I would want the same result out as I had before parsing. Related to closed issue XMLBEANS-10.

      Attachments

        Activity

          People

            jacobd Jacob Danner
            susannasj Susanna Sjöholm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: