Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10832

simpleTypeConvert always returns Null for Document, Document Type and Notation Node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Release Branch 16.11, Release Branch 18.12, Release Branch 17.12, Trunk
    • 16.11.06
    • None
    • None

    Description

      simpleTypeConvert always returns Null for Document, Document Type and Notation Node

      The ObjectType.simpleTypeConvert method always returns null for Document, Document Type and Notation Node.

      As per the current code, getTextContent() method is used get text content of the node and its descendants but the node.getTextContent() always return Null for the following Node type
      DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE [1]

      if (obj instanceof Node) {
          Node node = (Node) obj;
          String nodeValue =  node.getTextContent();
          if ("String".equals(type) || "java.lang.String".equals(type)) {
            return nodeValue;
          }
          return simpleTypeConvert(nodeValue, type, format, timeZone, locale, noTypeFail);
      }
      

      Since we can't get the text value of Document, Document Type and Notation Node, we should simply return the same object.

      [1] https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()

      Attachments

        1. OFBIZ-10832.patch
          0.8 kB
          Swapnil Mane

        Issue Links

          Activity

            People

              swapnilmmane Swapnil Mane
              swapnilmmane Swapnil Mane
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: