home *** CD-ROM | disk | FTP | other *** search
- using System;
- using Altova.Types;
-
- namespace [=$module]
- {
- /// <summary>
- /// Summary description for [=$module]Test.
- /// </summary>
- class [=$module]Test
- {
- protected static void Example()
- {
- [ foreach $class in $classes
- if $class.IsInternal
- foreach $member in $class.Members
- if $member.HasTypeObject and $member.TypeObject.NamespacePrefix <> ""
- $RootType = $member.TypeObject.NamespacePrefix & "." & $member.Type
- else
- $RootType = $member.Type
- endif
- $RootSchemaName = $member.XmlName
- $RootNamespaceURI = $member.NamespaceURI
- next
- endif
- next
- ] //
- // TODO:
- // Insert your code here...
- //
- // Example code to create and save a structure:
- // [=$module]Doc doc = new [=$module]Doc();
- // [=$RootType] root = new [=$RootType]();
- // ...
- // doc.SetRootElementName("[=$RootNamespaceURI]", "[=$RootSchemaName]");
- // doc.SetSchemaLocation("[=$module].xsd"); // optional
- // doc.Save("[=$module]1.xml", root);
- //
- // Example code to load and save a structure:
- // [=$module]Doc doc = new [=$module]Doc();
- // [=$RootType] root = new [=$RootType](doc.Load("[=$module]1.xml"));
- // ...
- // doc.Save("[=$module]1.xml", root);
- //
- }
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- \[STAThread\]
- public static int Main(string\[\] args)
- {
- try
- {
- Console.WriteLine("[=$module] Test Application");
- Example();
- Console.WriteLine("OK");
- return 0;
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- return 1;
- }
- }
- }
- }
-