On Tue, 25 Jan 2005 11:50:20 -0500, Jeff Sonstein <[EMAIL PROTECTED]> wrote:

> pardon the "newbie" question
> 
> I have a moderately-complex Schema defined at
> 
>   http://www.xvrml.net/schemas/xVRML.xsd
> 
> I have used Castor to generate a package of Java classes
> [see menu at http://www.xvrml.net/ for details and docs]
> 
> I want to use SAX in an application to walk through
> an arbitrary instance document conforming to this Schema
> but I am getting a bit confused about how to walk through an instance
> getting and examining all the children [and the children's children and so on]
> 
> I do not seem to find a tutorial anywhere
> which clearly shows how to do this with SAX
> 
> pointers anyone?
> or other suggestions?

Jeff, 

There's no need to use SAX directly when using Castor. Castor uses SAX
underneath the covers for you. All you need to worry about is
unmarshalling XML into Java and marshalling Java into XML. Upon
marshalling an XML instance into a Java instance, you simply utilize
the getters and setters to access the data in the Java instance.
That's the whole beauty of Castor - no more SAX code!

Based on the classes you generated from the xVRML schema, your should
unmarshall an XML instance into Java instances (i.e. the generated
classes) and then utilize the generated classes to access all the
data. One thing you may need to do is define a mapping descriptor to
tell Castor how an XML instance should be unmarshalled into a Java
instance. Details on this can be found here:

http://www.castor.org/xml-mapping.html#3.-The-Mapping-File

HTH. Please let us know if have additional questions as you go along. 

Bruce 
-- 
perl -e 'print unpack("u30","<0G)[EMAIL 
PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://geronimo.apache.org/



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to