home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _F13A18ADDC5C4A9DA2771D9B42DD5E53 < prev    next >
Encoding:
Text File  |  2003-05-08  |  1.9 KB  |  67 lines

  1. /**
  2.  * [=$module]Test.java
  3.  *
  4.  * This file was generated by XMLSPY 5 Enterprise Edition.
  5.  *
  6.  * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
  7.  * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
  8.  *
  9.  * Refer to the XMLSPY Documentation for further details.
  10.  * http://www.altova.com/xmlspy
  11.  */
  12.  
  13.  
  14. package [=$JavaPackageName];
  15.  
  16. import com.altova.xml.types.*;
  17.  
  18. public class [=$module]Test {
  19.     protected static void example() throws Exception {
  20. [    foreach $class in $classes
  21.         if $class.IsInternal
  22.             foreach $member in $class.Members
  23.                 if $member.HasTypeObject and $member.TypeObject.NamespacePrefix <> ""
  24.                     $RootType = $JavaPackageName & "." & $member.TypeObject.NamespacePrefix & "." & $member.Type
  25.                 else
  26.                     $RootType = $member.Type
  27.                 endif
  28.                 $RootSchemaName = $member.XmlName
  29.                 $RootNamespaceURI = $member.NamespaceURI
  30.             next
  31.         endif
  32.     next
  33. ]        ////////////////////////////////////////////////////////////////////
  34.         //
  35.         // TODO:
  36.         //   Insert your code here...
  37.         //
  38.         // Example code to create and save a structure:
  39.         //   [=$module]Doc doc = new [=$module]Doc();
  40.         //   [=$RootType] root = new [=$RootType]();
  41.         //   ...
  42.         //   doc.setRootElementName("[=$RootNamespaceURI]", "[=$RootSchemaName]");
  43.         //   doc.setSchemaLocation("[=$module].xsd"); // optional
  44.         //   doc.save("[=$module]1.xml", root);
  45.         //
  46.         // Example code to load and save a structure:
  47.         //   [=$module]Doc doc = new [=$module]Doc();
  48.         //   [=$RootType] root = new [=$RootType](doc.load("[=$module]1.xml"));
  49.         //   ...
  50.         //   doc.save("[=$module]1.xml", root);
  51.         //
  52.         ////////////////////////////////////////////////////////////////////
  53.     }
  54.  
  55.     public static void main(String args\[\]) {
  56.         try {
  57.             System.out.println("[=$module] Test Application");
  58.             example();
  59.             System.out.println("OK");
  60.             System.exit(0);
  61.         } catch (Exception e) {
  62.             e.printStackTrace();
  63.             System.exit(1);
  64.         }
  65.     }
  66. }
  67.