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

XmlDocumentProperties missing version and encoding

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Version 1.0.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              jacobd Jacob Danner
              Reporter:
              susannasj Susanna Sjöholm

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment