[Design of JBossXB] - How to force strict validation?
by rob.stryker@jboss.com
I've been trying this out for a while... no success.
Schema:
<xsd:schema xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="garbageRoot" type="root-type"/>
<xsd:complexType name="root-type">
<xsd:annotation>
<xsd:appinfo>
<jbxb:class impl="garbage.XbGarbageRoot"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:schema>
XbGarbageRoot (POJO):
public class XbGarbageRoot {
private String name;
public XbGarbageRoot() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Test case:
public class ParseTest extends TestCase {
private static final String SCHEMA = "/home/rob/apps/eclipse/workspaces/work/garbage/src/schema.xsd";
private static final String DATA = "/home/rob/apps/eclipse/workspaces/work/garbage/data/test.xml";
public void testABC() {
try {
File f = new File(SCHEMA);
InputStream stream = new FileInputStream(f);
SchemaBinding binding = XsdBinder.bind(stream, "UTF-8", null);
stream.close();
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
binding.setStrictSchema(true);
FileInputStream dataStream = new FileInputStream(new File(DATA));
Object xmlObject = unmarshaller.unmarshal(dataStream, binding);
System.out.println("object is " + xmlObject);
} catch( Exception e ) {
// GOOD! I want XB to fail!
return;
}
fail("data file should not have validated!");
}
}
Clearly, i'm setting that it should use a strict schema... but it's not throwing an exception. Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132014#4132014
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132014
18 years, 1 month
[Design of JBoss Build System] - Re: JBossAS CR1 build plan
by scott.stark@jboss.org
These are the jbossas related dependencies I see:
<version.org.jboss.jbossas_jboss-as-aspects>5.0.0.Beta4</version.org.jboss.jbossas_jboss-as-aspects>
<version.org.jboss.jbossas_jboss-as-connector>5.0.0.Beta4</version.org.jboss.jbossas_jboss-as-connector>
<version.org.jboss.jbossas_jboss-as-iiop>5.0.0.Beta4</version.org.jboss.jbossas_jboss-as-iiop>
<version.org.jboss.jbossas_jboss-as-naming>5.0.0.Beta4</version.org.jboss.jbossas_jboss-as-naming>
<version.org.jboss_jnpserver>5.0.0.Beta4</version.org.jboss_jnpserver>
The last two should essentially be the same thing, and even then I'm not sure why there is a dependency on the implementation vs the javax.naming apis. I'm going through the ejb3 dependencies to see what type of additions to the integration project are needed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131999#4131999
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131999
18 years, 1 month