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

  1. using System;
  2. using Altova.Types;
  3.  
  4. namespace [=$module]
  5. {
  6.     /// <summary>
  7.     /// Summary description for [=$module]Test.
  8.     /// </summary>
  9.     class [=$module]Test
  10.     {
  11.         protected static void Example()
  12.         {
  13. [    foreach $class in $classes
  14.         if $class.IsInternal
  15.             foreach $member in $class.Members
  16.                 if $member.HasTypeObject and $member.TypeObject.NamespacePrefix <> ""
  17.                     $RootType = $member.TypeObject.NamespacePrefix & "." & $member.Type
  18.                 else
  19.                     $RootType = $member.Type
  20.                 endif
  21.                 $RootSchemaName = $member.XmlName
  22.                 $RootNamespaceURI = $member.NamespaceURI
  23.             next
  24.         endif
  25.     next
  26. ]            //
  27.             // TODO:
  28.             //   Insert your code here...
  29.             //
  30.             // Example code to create and save a structure:
  31.             //   [=$module]Doc doc = new [=$module]Doc();
  32.             //   [=$RootType] root = new [=$RootType]();
  33.             //   ...
  34.             //   doc.SetRootElementName("[=$RootNamespaceURI]", "[=$RootSchemaName]");
  35.             //   doc.SetSchemaLocation("[=$module].xsd"); // optional
  36.             //   doc.Save("[=$module]1.xml", root);
  37.             //
  38.             // Example code to load and save a structure:
  39.             //   [=$module]Doc doc = new [=$module]Doc();
  40.             //   [=$RootType] root = new [=$RootType](doc.Load("[=$module]1.xml"));
  41.             //   ...
  42.             //   doc.Save("[=$module]1.xml", root);
  43.             //
  44.         }
  45.  
  46.         /// <summary>
  47.         /// The main entry point for the application.
  48.         /// </summary>
  49.         \[STAThread\]
  50.         public static int Main(string\[\] args)
  51.         {
  52.             try
  53.             {
  54.                 Console.WriteLine("[=$module] Test Application");
  55.                 Example();
  56.                 Console.WriteLine("OK");
  57.                 return 0;
  58.             }
  59.             catch (Exception e)
  60.             {
  61.                 Console.WriteLine(e);
  62.                 return 1;
  63.             }
  64.         }
  65.     }
  66. }
  67.