You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2004/08/20 22:51:03 UTC
cvs commit: ws-jaxme/src/xs/org/apache/ws/jaxme/xs/xml/impl XsEAppinfoImpl.java
jochen 2004/08/20 13:51:03
Modified: src/xs/org/apache/ws/jaxme/xs/junit Tag: Branch_R0_3
ParserTest.java
src/xs/org/apache/ws/jaxme/xs/xml/impl Tag: Branch_R0_3
XsEAppinfoImpl.java
Log:
The xs:appinfo element does now support embedded text.
Revision Changes Path
No revision
No revision
1.14.2.2 +27 -1 ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java
Index: ParserTest.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/junit/ParserTest.java,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -r1.14.2.1 -r1.14.2.2
--- ParserTest.java 11 Aug 2004 23:57:51 -0000 1.14.2.1
+++ ParserTest.java 20 Aug 2004 20:51:03 -0000 1.14.2.2
@@ -21,6 +21,8 @@
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.ws.jaxme.xs.XSAnnotation;
+import org.apache.ws.jaxme.xs.XSAppinfo;
import org.apache.ws.jaxme.xs.XSAttributable;
import org.apache.ws.jaxme.xs.XSAttribute;
import org.apache.ws.jaxme.xs.XSAttributeGroup;
@@ -1095,5 +1097,29 @@
public void testSimpleTypeRestriction2() throws Exception {
testSimpleTypeRestriction2(newXSParser());
testSimpleTypeRestriction2(newJAXBParser());
+ }
+
+ private void testAppInfoEmbeddedText(XSParser pParser) throws Exception {
+ final String schemaSource =
+ "<schema xmlns='http://www.w3.org/2001/XMLSchema'>\n" +
+ " <annotation><appinfo>foo</appinfo></annotation>\n" +
+ "</schema>\n";
+ InputSource isource = new InputSource(new StringReader(schemaSource));
+ isource.setSystemId("testSimpleTypeRestriction2.xsd");
+ XSSchema schema = pParser.parse(isource);
+ XSAnnotation[] annotations = schema.getAnnotations();
+ assertEquals(1, annotations.length);
+ XSAppinfo[] appinfos = annotations[0].getAppinfos();
+ assertEquals(1, appinfos.length);
+ Object[] childs = appinfos[0].getChilds();
+ assertEquals(1, childs.length);
+ assertEquals("foo", (String) childs[0]);
+ }
+
+ /** <p>Does the <code>xs:appinfo</code> element support embedded text?</p>
+ */
+ public void testAppInfoEmbeddedText() throws Exception {
+ testAppInfoEmbeddedText(newXSParser());
+ testAppInfoEmbeddedText(newJAXBParser());
}
}
No revision
No revision
1.3.2.1 +6 -0 ws-jaxme/src/xs/org/apache/ws/jaxme/xs/xml/impl/XsEAppinfoImpl.java
Index: XsEAppinfoImpl.java
===================================================================
RCS file: /home/cvs/ws-jaxme/src/xs/org/apache/ws/jaxme/xs/xml/impl/XsEAppinfoImpl.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- XsEAppinfoImpl.java 16 Feb 2004 23:39:44 -0000 1.3
+++ XsEAppinfoImpl.java 20 Aug 2004 20:51:03 -0000 1.3.2.1
@@ -109,4 +109,10 @@
throw new SAXException(e);
}
}
+
+ /** <p>Adds text to the appinfo contents.</p>
+ */
+ public void addText(String pText) {
+ addChild(pText);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org