Example #1
0
        public void AddRootType(SchemaXMLEventType type)
        {
            if (rootTypes == null) {
                rootTypes = new Dictionary<string, SchemaXMLEventType>();
            }

            if (rootTypes.ContainsKey(type.Name)) {
                throw new IllegalStateException("Type '" + type.Name + "' already exists");
            }

            rootTypes.Put(type.Name, type);
        }
Example #2
0
        public void SetUp()
        {
            var schemaUrl  = container.ResourceManager().ResolveResourceURL("regression/simpleSchema.xsd");
            var configNoNS = new ConfigurationCommonEventTypeXMLDOM();

            configNoNS.IsXPathPropertyExpr = true;
            configNoNS.SchemaResource      = schemaUrl.ToString();
            configNoNS.RootElementName     = "simpleEvent";
            configNoNS.AddXPathProperty("customProp", "count(/ss:simpleEvent/ss:nested3/ss:nested4)", XPathResultType.Number);
            configNoNS.AddNamespacePrefix("ss", "samples:schemas:simpleSchema");

            var model = XSDSchemaMapper.LoadAndMap(
                schemaUrl.ToString(),
                null,
                container.ResourceManager());
            var eventTypeNoNS = new SchemaXMLEventType(
                null, configNoNS, model, null, null, null, null, null);

            using (var stream = container.ResourceManager().GetResourceAsStream("regression/simpleWithSchema.xml")) {
                var noNSDoc = new XmlDocument();
                noNSDoc.Load(stream);
                eventSchemaOne = new XMLEventBean(noNSDoc.DocumentElement, eventTypeNoNS);
            }
        }