Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-966

XML object definition parser strips whitespaces from values

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.2.0
    • Component/s: Spring-NET-CORE
    • Labels:
      None

      Description

      see forum http://forum.springframework.net/showthread.php?p=12582#post12582

      only the inline syntax <property name="..." value="..." /> preserves whitespaces. Normal syntax <property name="..."><value>...</value></property> ignores whitespaces.

      changing ObjectNamespaceParser.GetTextValue() from

      protected string GetTextValue(XmlElement element, string name)
      {
      if (element == null || StringUtils.IsNullOrEmpty(element.InnerText))

      { return String.Empty; }
      return element.InnerText;
      }

      to

      protected string GetTextValue(XmlElement element, string name)
      {
      if (element == null || element.InnerText == null || element.InnerText.Length == 0)
      { return String.Empty; }

      return element.InnerText;
      }

      solves this and doesn't break any tests.

        Attachments

          Activity

            People

            • Assignee:
              oakinger Erich Eichinger
              Reporter:
              oakinger Erich Eichinger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: