XStream
  1. XStream
  2. XSTR-656

DomReader.getAttribute(String name) does not escape attribute name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4
    • Component/s: IO
    • Labels:
      None
    • JDK version and platform:
      Sun 1.6.0_18 for Windows

      Description

      DomReader.getAttribute(String) does not escape the given attribute name. XppReader escapes it. Following a test case for reproducing this error.

      public class DomReaderAttributeUnescapingTest {
      @Test
      public void xStream() throws Exception

      { XStream xStream = new XStream(new DomDriver()); xStream.useAttributeFor(Serialized.class, "_data"); Serialized original = new Serialized("x"); String xml = xStream.toXML(original); Serialized copy = (Serialized) xStream.fromXML(xml); assertEquals("x", copy.getData()); }

      private static class Serialized
      {
      private String _data;

      public Serialized(String data)

      { _data = data; }

      public String getData()

      { return _data; }

      }
      }

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Stefan Fromm
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: