Issue Type: Bug Bug
Affects Versions: 1.x Maintenance
Assignee: Jörg Schaible
Components: Core
Created: 03/Jun/13 2:16 PM
Description:

In the latest trunk code, it appears it's impossible to parse XML that contains unknown elements with predefined converters, such as <url>. I tried both ignoring them the old way, by overriding shouldSerializeMember with a "definedIn != Object.class" check, or the new way, calling xStream.ignoreUnknownElements().

This is a blocker for us, because there's no workaround.

Here's a self-contained unit test to reproduce this problem with XStream 1.4.5-20130321.143015-2:

	public void testHandlingUnknownURLField() {
		final XStream xStream = new XStream();
		xStream.ignoreUnknownElements();
		xStream.processAnnotations(MyTestClass.class);
		
		final String xmlWithNewField = "<myTestClass><id>123</id><url>http://www.google.com</url></myTestClass>";
		
		final MyTestClass c1 = (MyTestClass) xStream.fromXML(xmlWithNewField);
		assertNotNull(c1);
	}

	@XStreamAlias("myTestClass")
	public class MyTestClass implements Serializable {
		public MyTestClass() {}
	}
Project: XStream
Priority: Blocker Blocker
Reporter: Matthew Lieder
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to