Home » xmlbeans-2.5.0-src » org.apache.xmlbeans.samples » xsdconfig » [javadoc | source]
org.apache.xmlbeans.samples.xsdconfig
public class: CatalogXsdConfig [javadoc | source]
java.lang.Object
   org.apache.xmlbeans.samples.xsdconfig.CatalogXsdConfig
This class uses the package names and class names mentioned in XsdConfig. Note the difference between the imports in two files (CatalogXsdConfig.java and CatalogXsd.java)
Method from org.apache.xmlbeans.samples.xsdconfig.CatalogXsdConfig Summary:
main,   parseXml,   printElements,   validateXml
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xmlbeans.samples.xsdconfig.CatalogXsdConfig Detail:
 public static  void main(String[] args) 
 public XmlCatalogDocumentBean parseXml(String xmlFilePath) 
    Creates a File from the XML path provided in main arguments, then parses the file's contents into a type (CatalogDocument) generated from schema.
 public  void printElements(XmlCatalogDocumentBean catdoc) 
 public static boolean validateXml(XmlObject xml) 

    Validates the XML, printing error messages when the XML is invalid. Note that this method will properly validate any instance of a compiled schema type because all of these types extend XmlObject.

    Note that in actual practice, you'll probably want to use an assertion when validating if you want to ensure that your code doesn't pass along invalid XML. This sample prints the generated XML whether or not it's valid so that you can see the result in both cases.