コード例 #1
0
        /// <summary>
        /// Create a new Processor
        /// </summary>

        public Processor()
        {
            config = new JConfiguration();
            config.setURIResolver(new DotNetURIResolver(new XmlUrlResolver()));
            config.setCollectionURIResolver(new DotNetCollectionURIResolver());
            config.registerExternalObjectModel(new DotNetObjectModelDefinition());
        }
コード例 #2
0
        /// <summary>
        /// Create a Processor, indicating whether it is to be schema-aware.
        /// </summary>
        /// <param name="schemaAware">Set to true if the Processor is to be schema-aware.
        /// This requires the Saxon-SA product to be installed, with a valid license key.</param>
        /// <param name="loadLocally">Set to true if Saxon-SA is to be loaded from the application
        /// directory rather than from the Global Assembly Cache. This option should normally
        /// be set only when troubleshooting, for example when using a locally-patched version
        /// of the software.</param>

        public Processor(bool schemaAware, bool loadLocally)
        {
            if (schemaAware)
            {
                if (loadLocally)
                {
                    Assembly asm = Assembly.Load("saxon8sa");
                }
                else
                {
                    try {
                        int[]        v   = JVersion.getStructuredVersionNumber();
                        AssemblyName asn = new AssemblyName();
                        asn.Name    = "saxon8sa";
                        asn.Version = new Version(v[0], v[1], v[2], v[3]);
                        //asn.Version = new Version(JVersion.getMajorVersion(), JVersion.getMinorVersion());
                        asn.SetPublicKeyToken(new byte[] { 0xe1, 0xfd, 0xd0, 0x02, 0xd5, 0x08, 0x3f, 0xe6 });
                        asn.CultureInfo = new CultureInfo("");
                        Assembly asm = Assembly.Load(asn);
                        // try to load the saxon8sa.dll assembly
                        //Assembly asm = Assembly.Load("saxon8sa, Ver=" + JVersion.getProductVersion() + ".0.1, " +
                        //    @"SN=e1fdd002d5083fe6, Loc=neutral");
                    } catch (Exception e) {
                        Console.WriteLine("Cannot load Saxon-SA software (assembly saxon8sa.dll version " +
                                          JVersion.getProductVersion() + ".0.1)");
                        throw e;
                    }
                }
                config        = JConfiguration.makeSchemaAwareConfiguration(null);
                schemaManager = new SchemaManager(config);
            }
            else
            {
                config = new JConfiguration();
            }
            config.setURIResolver(new DotNetURIResolver(new XmlUrlResolver()));
            config.setCollectionURIResolver(new DotNetCollectionURIResolver());
        }
        /// <summary>
        /// Create a new Processor
        /// </summary>

        public Processor() {
            config = new JConfiguration();
            config.setURIResolver(new DotNetURIResolver(new XmlUrlResolver()));
            config.setCollectionURIResolver(new DotNetCollectionURIResolver());
        }
コード例 #4
0
ファイル: Configuration.cs プロジェクト: orbeon/saxon-he
        /// <summary>
        /// Create a new Processor
        /// </summary>

        public Processor()
        {
            config = new JConfiguration();
            config.setURIResolver(new DotNetURIResolver(new XmlUrlResolver()));
            config.setCollectionURIResolver(new DotNetCollectionURIResolver());
        }