You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by xm...@xml.apache.org on 2004/09/29 02:23:36 UTC

[jira] Closed: (XMLBEANS-42) Samples: Add MixedContent and SchemaEnum samples to sample set

Message:

   The following issue has been closed.

   Resolver: Kevin Krouse
       Date: Tue, 28 Sep 2004 5:21 PM

samples have been added to the website
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-42

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-42
    Summary: Samples: Add MixedContent and SchemaEnum samples to sample set
       Type: Task

     Status: Closed
   Priority: Minor
 Resolution: FIXED

    Project: XMLBeans
   Versions:
             unspecified

   Assignee: Kevin Krouse
   Reporter: Steven Traut

    Created: Fri, 9 Jul 2004 12:18 PM
    Updated: Tue, 28 Sep 2004 5:21 PM
Environment: Any.

Description:
I have two samples to submit for review: MixedContent and SchemaEnum. Descriptions from their readmes are below. Seems to me that potential sample-related tasks are:

- Review the code. Is it useful? Does it do what it should? Are there any poor practices illustrated?

- If the code is acceptable...

- Find a CVS location for the ZIPs. I suggest xml-xmlbeans/samples/<feature_area>/<sample_name>. So the SchemaEnum sample would have this structure in CVS:

xml-xmlbeans
    samples
        schema
            schemaenum
                SchemaEnum.zip
                <exploded files from zip>

- Explode the ZIPs and commit the ZIPs and their contents.

- Incorporate samples into the test process. Rather than "asserting" the main sample code, I've included a separate test class in each ZIP that asserts for valid XML (the easiest thing to get a boolean on). I'm hoping this leaves the sample code itself in a useful copy/paste state while still supporting test integration. It's a very large-grained approach, and maybe not useful. I'm a novice at the test thing. I'm open to suggestions.

- Create a "Samples" page on the web site and link to the ZIP files from it so they can be downloaded.

-----

I tried to follow a few guidelines on package names. Let me know (or feel free to change) if these won't work.

- Packages for main classes take the form: org.apache.xmlbeans.samples.schema.enumerations and org.apache.xmlbeans.samples.cursor

- Schema namespace URIs (and therefore packages for generated types) take the form: <sample package>.samplemainclassname.<names as needed to disambiguate schemas>

Each zip contains a readme.

-----

SchemaEnum
This sample illustrates how you can access XML values that are
defined in schema as enumerations. When a schema containing
enumerations is compiled, the generated Java types represent the
schema enumerations with Java enumerations. You can access these through their constants and corresponding int values.

MixedContent
This sample illustrates how you can work with mixed content XML by combining strong types generated from schema with an XmlCursor instance. The XmlCursor interface is provided with XMLBeans for just this kind of use. With strong types you can only get or set the full value of an element; by using a cursor you can "dive into" the contents of an element, manipulating child elements that are embedded in the content and surrounded by other text.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org