[jboss-dev-forums] [Design of JBossXB] - Re: Ignoring non-ignorable white space?
alex.loubyansky@jboss.com
do-not-reply at jboss.com
Fri Jun 8 05:56:00 EDT 2007
Actually, even with maxOccurs='unbounded', if the type is xsd:string it works if you expect an empty string.
public void testCollectionOverrideProperty() throws Exception
| {
| SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);
|
| schema.setIgnoreUnresolvedFieldOrClass(false);
|
| ClassMetaData classMetaData = new ClassMetaData();
| classMetaData.setImpl(Top.class.getName());
| ElementBinding element = schema.getElement(new QName(NS, "top"));
| assertNotNull(element);
| element.setClassMetaData(classMetaData);
|
| Top top = (Top) unmarshal("IgnorableWhitespaceContent.xml", schema, Top.class);
| assertNotNull(top.string);
| assertEquals(1, top.string.size());
| assertEquals("", top.string.get(0));
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4052483#4052483
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4052483
More information about the jboss-dev-forums
mailing list