You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by kk...@apache.org on 2004/10/29 02:45:21 UTC
cvs commit: xml-xmlbeans/samples/template/SampleTemplate .cvsignore
kkrouse 2004/10/28 17:45:21
Modified: samples build.xml
samples/substitutiongroup/SubstitutionGroup/src/org/apache/xmlbeans/samples/substitutiongroup
SubstitutionGroup.java SubstitutionGroupTest.java
Added: samples .cvsignore
samples/cursor/MixedContent .cvsignore
samples/enumeration/SchemaEnum .cvsignore
samples/substitutiongroup/SubstitutionGroup .cvsignore
samples/template/SampleTemplate .cvsignore
Log:
minor change to substitution group sample
adding OrderMatters and DateTime sample
Revision Changes Path
1.3 +66 -4 xml-xmlbeans/samples/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xmlbeans/samples/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.xml 18 Oct 2004 15:57:05 -0000 1.2
+++ build.xml 29 Oct 2004 00:45:21 -0000 1.3
@@ -20,8 +20,10 @@
<target name="clean" depends="
clean-SampleTemplate,
clean-MixedContent,
+ clean-OrderMatters,
clean-SchemaEnum,
- clean-SubstitutionGroup">
+ clean-SubstitutionGroup,
+ clean-DateTime">
<delete dir="build"/>
</target>
@@ -33,6 +35,10 @@
<ant dir="cursor/MixedContent" target="clean"/>
</target>
+ <target name="clean-OrderMatters">
+ <ant dir="cursor/OrderMatters" target="clean"/>
+ </target>
+
<target name="clean-SchemaEnum">
<ant dir="enumeration/SchemaEnum" target="clean"/>
</target>
@@ -41,13 +47,19 @@
<ant dir="substitutiongroup/SubstitutionGroup" target="clean"/>
</target>
+ <target name="clean-DateTime">
+ <ant dir="values/DateTime" target="clean"/>
+ </target>
+
<!-- ========================== build ==== -->
<target name="build" depends="
build-SampleTemplate,
build-MixedContent,
+ build-OrderMatters,
build-SchemaEnum,
- build-SubstitutionGroup">
+ build-SubstitutionGroup,
+ build-DateTime">
</target>
<target name="build-SampleTemplate">
@@ -58,6 +70,10 @@
<ant dir="cursor/MixedContent" target="build"/>
</target>
+ <target name="build-OrderMatters">
+ <ant dir="cursor/OrderMatters" target="build"/>
+ </target>
+
<target name="build-SchemaEnum">
<ant dir="enumeration/SchemaEnum" target="build"/>
</target>
@@ -66,14 +82,20 @@
<ant dir="substitutiongroup/SubstitutionGroup" target="build"/>
</target>
+ <target name="build-DateTime">
+ <ant dir="values/DateTime" target="build"/>
+ </target>
+
<!-- ========================== test ==== -->
<!-- to ensure all samples build and run -->
<target name="test" depends="
test-SampleTemplate,
test-MixedContent,
+ test-OrderMatters,
test-SchemaEnum,
- test-SubstitutionGroup">
+ test-SubstitutionGroup,
+ test-DateTime">
</target>
<target name="test-SampleTemplate">
@@ -84,6 +106,10 @@
<ant dir="cursor/MixedContent" target="test"/>
</target>
+ <target name="test-OrderMatters">
+ <ant dir="cursor/OrderMatters" target="test"/>
+ </target>
+
<target name="test-SchemaEnum">
<ant dir="enumeration/SchemaEnum" target="test"/>
</target>
@@ -92,13 +118,19 @@
<ant dir="substitutiongroup/SubstitutionGroup" target="test"/>
</target>
+ <target name="test-DateTime">
+ <ant dir="values/DateTime" target="test"/>
+ </target>
+
<!-- ========================== dist ==== -->
<target name="dist" depends="
dist-SampleTemplate,
dist-MixedContent,
+ dist-OrderMatters,
dist-SchemaEnum,
- dist-SubstitutionGroup">
+ dist-SubstitutionGroup,
+ dist-DateTime">
<zip destfile="build/samples.zip"
basedir=".."
includes="samples/**"
@@ -143,6 +175,21 @@
/>
</target>
+ <target name="dist-OrderMatters">
+ <mkdir dir="build"/>
+ <zip destfile="build/OrderMatters.zip"
+ basedir="cursor"
+ includes="OrderMatters/**"
+ excludes="OrderMatters/build/**"
+ />
+ <tar destfile="build/OrderMatters.tgz"
+ basedir="cursor"
+ includes="OrderMatters/**"
+ excludes="OrderMatters/build/**"
+ compression="gzip"
+ />
+ </target>
+
<target name="dist-SchemaEnum">
<mkdir dir="build"/>
<zip destfile="build/SchemaEnum.zip"
@@ -169,6 +216,21 @@
basedir="substitutiongroup"
includes="SubstitutionGroup/**"
excludes="SubstitutionGroup/build/**"
+ compression="gzip"
+ />
+ </target>
+
+ <target name="dist-DateTime">
+ <mkdir dir="build"/>
+ <zip destfile="build/DateTime.zip"
+ basedir="values"
+ includes="DateTime/**"
+ excludes="DateTime/build/**"
+ />
+ <tar destfile="build/DateTime.tgz"
+ basedir="values"
+ includes="DateTime/**"
+ excludes="DateTime/build/**"
compression="gzip"
/>
</target>
1.1 xml-xmlbeans/samples/.cvsignore
Index: .cvsignore
===================================================================
build
1.1 xml-xmlbeans/samples/cursor/MixedContent/.cvsignore
Index: .cvsignore
===================================================================
build
1.1 xml-xmlbeans/samples/enumeration/SchemaEnum/.cvsignore
Index: .cvsignore
===================================================================
build
1.1 xml-xmlbeans/samples/substitutiongroup/SubstitutionGroup/.cvsignore
Index: .cvsignore
===================================================================
build
1.2 +21 -15 xml-xmlbeans/samples/substitutiongroup/SubstitutionGroup/src/org/apache/xmlbeans/samples/substitutiongroup/SubstitutionGroup.java
Index: SubstitutionGroup.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/samples/substitutiongroup/SubstitutionGroup/src/org/apache/xmlbeans/samples/substitutiongroup/SubstitutionGroup.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SubstitutionGroup.java 18 Oct 2004 15:55:25 -0000 1.1
+++ SubstitutionGroup.java 29 Oct 2004 00:45:21 -0000 1.2
@@ -102,8 +102,10 @@
// comment as defined in Easypo.xsd.
for (int i=0;i<invHeaders.length;i++){
System.out.println("\nInvoiceHeader["+i+"]");
- System.out.println("Element Name (Local Part): " + invHeaders[i].xgetComment().newCursor().getName().getLocalPart());
+ XmlCursor cursor = invHeaders[i].xgetComment().newCursor();
+ System.out.println("Element Name (Local Part): " + cursor.getName().getLocalPart());
System.out.println("Element Value: " + invHeaders[i].getComment().trim());
+ cursor.dispose();
}
}
@@ -132,13 +134,15 @@
book.setId(1000);
book.setTitle("Where the Red Fern Grows");
invHeaders.setProduct(book);
- invHeaders.getProduct().newCursor().setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "book"));
-
- // Creating a new comment - with substitution group member bill-comment element.
- invHeaders.setComment("This is a new bill-comment");
- XmlCursor cursor = invHeaders.xgetComment().newCursor();
- cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "bill-comment"));
- cursor.dispose();
+ XmlCursor cursor = invHeaders.getProduct().newCursor();
+ cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "book"));
+ cursor.dispose();
+
+ // Creating a new comment - with substitution group member bill-comment element.
+ invHeaders.setComment("This is a new bill-comment");
+ cursor = invHeaders.xgetComment().newCursor();
+ cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "bill-comment"));
+ cursor.dispose();
// Add another invoice-header.
invHeaders = purchaseOrderElement.addNewInvoiceHeader();
@@ -157,13 +161,15 @@
clothing.setId(2000);
clothing.setColor(ClothingType.Color.BLUE);
invHeaders.setProduct(clothing);
- invHeaders.getProduct().newCursor().setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "clothing"));
-
- // Creating a new comment - with substitution group member bill-comment element.
- invHeaders.setComment("This is a new bill-comment");
- cursor = invHeaders.xgetComment().newCursor();
- cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "ship-comment"));
- cursor.dispose();
+ cursor = invHeaders.getProduct().newCursor();
+ cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "clothing"));
+ cursor.dispose();
+
+ // Creating a new comment - with substitution group member bill-comment element.
+ invHeaders.setComment("This is a new bill-comment");
+ cursor = invHeaders.xgetComment().newCursor();
+ cursor.setName(new QName("http://xmlbeans.apache.org/samples/substitutiongroup/easypo", "ship-comment"));
+ cursor.dispose();
// Validate it.
validateXml(poDoc);
1.2 +3 -3 xml-xmlbeans/samples/substitutiongroup/SubstitutionGroup/src/org/apache/xmlbeans/samples/substitutiongroup/SubstitutionGroupTest.java
Index: SubstitutionGroupTest.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/samples/substitutiongroup/SubstitutionGroup/src/org/apache/xmlbeans/samples/substitutiongroup/SubstitutionGroupTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SubstitutionGroupTest.java 18 Oct 2004 15:55:25 -0000 1.1
+++ SubstitutionGroupTest.java 29 Oct 2004 00:45:21 -0000 1.2
@@ -34,14 +34,14 @@
SubstitutionGroup sample = new SubstitutionGroup();
// Create a schema type instance from the XML indicated by the path.
- SubstitutionGroup subGrp = new SubstitutionGroup();
- PurchaseOrderDocument poDoc = subGrp.parseXml(args[0]);
+ SubstitutionGroup subGrp = new SubstitutionGroup();
+ PurchaseOrderDocument poDoc = subGrp.parseXml(args[0]);
// Validate the XML.
assert sample.validateXml(poDoc);
// Create a new document that adds two elements.
- PurchaseOrderDocument newDoc = sample.createDocument(poDoc, args[1]);
+ PurchaseOrderDocument newDoc = sample.createDocument(poDoc, args[1]);
// Validate the XML.
assert sample.validateXml(newDoc);
1.1 xml-xmlbeans/samples/template/SampleTemplate/.cvsignore
Index: .cvsignore
===================================================================
build
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org