You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Steve Traut (JIRA)" <xm...@xml.apache.org> on 2005/06/15 02:45:48 UTC

[jira] Created: (XMLBEANS-168) Review Any sample and add to sample repository

Review Any sample and add to sample repository
----------------------------------------------

         Key: XMLBEANS-168
         URL: http://issues.apache.org/jira/browse/XMLBEANS-168
     Project: XMLBeans
        Type: Improvement
  Components: Samples  
    Versions: TBD    
    Reporter: Steve Traut
    Priority: Minor
     Fix For: TBD
 Attachments: Any.zip

Here's a sample illustrating how to use xs:any. Zip with files coming momentarily. Here's the description:

This sample illustrates how you can use the XMLBeans API to work with 
XML based on schema that features xs:any particles. Unlike other schema 
types, xs:any in schema does not result in accessors when you use XMLBeans
to compile schema. Instead, your code must use alternate means to access
and create these parts of the XML. These alternate means include:

- Using XmlCursor instances to "walk" the XML, retrieving and creating
elements.
- Using the selectPath method to retrieve XML via XPath. 
- Using the selectChildren method to retrieve elements that are children
by name.
- Using the DOM API to "walk" the node tree, retrieving elements by
name and creating new elements.

When you run this sample, you'll see it print four blocks of information
in the console:
- Results of the Any.buildDocFromScratch method, which builds from scratch the 
XML contents of any.xml included with this sample.
- Results of the Any.editExistingDocWithSelectChildren method, which receives
any.xml and replaces one of its elements.
- Results of the Any.editExistingDocWithDOM method, which receives
any.xml and adds an element.
- Results of the Any.editExistingDocWithSelectPath method, which receives
any.xml, promotes one of its elements, and adds a new element.

To try out this sample:

1. Set XMLBEANS_HOME in your environment
2. Ant must be on your PATH
3. To compile the schemas and sample source, run "ant build"
4. To execute the sample, run "ant run"


-- 
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
-
For more information on JIRA, 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


[jira] Updated: (XMLBEANS-168) Review Any sample and add to sample repository

Posted by "Steve Traut (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-168?page=all ]

Steve Traut updated XMLBEANS-168:
---------------------------------

    Attachment: Any.zip

Zip with files for Any sample

> Review Any sample and add to sample repository
> ----------------------------------------------
>
>          Key: XMLBEANS-168
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-168
>      Project: XMLBeans
>         Type: Improvement
>   Components: Samples
>     Versions: TBD
>     Reporter: Steve Traut
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Any.zip
>
> Here's a sample illustrating how to use xs:any. Zip with files coming momentarily. Here's the description:
> This sample illustrates how you can use the XMLBeans API to work with 
> XML based on schema that features xs:any particles. Unlike other schema 
> types, xs:any in schema does not result in accessors when you use XMLBeans
> to compile schema. Instead, your code must use alternate means to access
> and create these parts of the XML. These alternate means include:
> - Using XmlCursor instances to "walk" the XML, retrieving and creating
> elements.
> - Using the selectPath method to retrieve XML via XPath. 
> - Using the selectChildren method to retrieve elements that are children
> by name.
> - Using the DOM API to "walk" the node tree, retrieving elements by
> name and creating new elements.
> When you run this sample, you'll see it print four blocks of information
> in the console:
> - Results of the Any.buildDocFromScratch method, which builds from scratch the 
> XML contents of any.xml included with this sample.
> - Results of the Any.editExistingDocWithSelectChildren method, which receives
> any.xml and replaces one of its elements.
> - Results of the Any.editExistingDocWithDOM method, which receives
> any.xml and adds an element.
> - Results of the Any.editExistingDocWithSelectPath method, which receives
> any.xml, promotes one of its elements, and adds a new element.
> To try out this sample:
> 1. Set XMLBEANS_HOME in your environment
> 2. Ant must be on your PATH
> 3. To compile the schemas and sample source, run "ant build"
> 4. To execute the sample, run "ant run"

-- 
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
-
For more information on JIRA, 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


[jira] Resolved: (XMLBEANS-168) Review Any sample and add to sample repository

Posted by "Rajiv Bala (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-168?page=all ]
     
Rajiv Bala resolved XMLBEANS-168:
---------------------------------

    Resolution: Fixed

Checked in with revision 191227

> Review Any sample and add to sample repository
> ----------------------------------------------
>
>          Key: XMLBEANS-168
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-168
>      Project: XMLBeans
>         Type: Improvement
>   Components: Samples
>     Versions: TBD
>     Reporter: Steve Traut
>     Priority: Minor
>      Fix For: TBD
>  Attachments: Any.zip
>
> Here's a sample illustrating how to use xs:any. Zip with files coming momentarily. Here's the description:
> This sample illustrates how you can use the XMLBeans API to work with 
> XML based on schema that features xs:any particles. Unlike other schema 
> types, xs:any in schema does not result in accessors when you use XMLBeans
> to compile schema. Instead, your code must use alternate means to access
> and create these parts of the XML. These alternate means include:
> - Using XmlCursor instances to "walk" the XML, retrieving and creating
> elements.
> - Using the selectPath method to retrieve XML via XPath. 
> - Using the selectChildren method to retrieve elements that are children
> by name.
> - Using the DOM API to "walk" the node tree, retrieving elements by
> name and creating new elements.
> When you run this sample, you'll see it print four blocks of information
> in the console:
> - Results of the Any.buildDocFromScratch method, which builds from scratch the 
> XML contents of any.xml included with this sample.
> - Results of the Any.editExistingDocWithSelectChildren method, which receives
> any.xml and replaces one of its elements.
> - Results of the Any.editExistingDocWithDOM method, which receives
> any.xml and adds an element.
> - Results of the Any.editExistingDocWithSelectPath method, which receives
> any.xml, promotes one of its elements, and adds a new element.
> To try out this sample:
> 1. Set XMLBEANS_HOME in your environment
> 2. Ant must be on your PATH
> 3. To compile the schemas and sample source, run "ant build"
> 4. To execute the sample, run "ant run"

-- 
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
-
For more information on JIRA, 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