public void FixtureInit() { XmlTextReader reader = ResourceManager.GetXhtmlStrictSchema(); schemaCompletionData = new XmlSchemaCompletionData(reader); // Set up h1 element's path. h1Path = new XmlElementPath(); h1Path.Elements.Add(new QualifiedName("html", namespaceURI)); h1Path.Elements.Add(new QualifiedName("body", namespaceURI)); h1Path.Elements.Add(new QualifiedName("h1", namespaceURI)); // Get h1 element info. h1Attributes = schemaCompletionData.GetAttributeCompletionData(h1Path); }
async Task Init () { if (schemaCompletionData != null) return; XmlTextReader reader = ResourceManager.GetXhtmlStrictSchema(); schemaCompletionData = new XmlSchemaCompletionData(reader); // Set up h1 element's path. h1Path = new XmlElementPath(); h1Path.Elements.Add(new QualifiedName("html", namespaceURI)); h1Path.Elements.Add(new QualifiedName("body", namespaceURI)); h1Path.Elements.Add(new QualifiedName("h1", namespaceURI)); // Get h1 element info. h1Attributes = await schemaCompletionData.GetAttributeCompletionData(h1Path, CancellationToken.None); }
async Task Init () { if (schemaCompletionData != null) return; XmlTextReader reader = ResourceManager.GetXsdSchema(); schemaCompletionData = new XmlSchemaCompletionData(reader); // Set up choice element's path. choicePath = new XmlElementPath(); choicePath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); choicePath.Elements.Add(new QualifiedName("element", namespaceURI, prefix)); choicePath.Elements.Add(new QualifiedName("complexType", namespaceURI, prefix)); mixedAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(choicePath, "mixed", CancellationToken.None); choicePath.Elements.Add(new QualifiedName("choice", namespaceURI, prefix)); // Get choice element info. choiceAttributes = await schemaCompletionData.GetAttributeCompletionData(choicePath, CancellationToken.None); maxOccursAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(choicePath, "maxOccurs", CancellationToken.None); // Set up element path. elementPath = new XmlElementPath(); elementPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); elementFormDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData (elementPath, "elementFormDefault", CancellationToken.None); blockDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(elementPath, "blockDefault", CancellationToken.None); finalDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(elementPath, "finalDefault", CancellationToken.None); elementPath.Elements.Add(new QualifiedName("element", namespaceURI, prefix)); // Get element attribute info. elementAttributes = await schemaCompletionData.GetAttributeCompletionData(elementPath, CancellationToken.None); // Set up simple enum type path. simpleEnumPath = new XmlElementPath(); simpleEnumPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); simpleEnumPath.Elements.Add(new QualifiedName("simpleType", namespaceURI, prefix)); simpleEnumPath.Elements.Add(new QualifiedName("restriction", namespaceURI, prefix)); // Get child elements. simpleEnumElements = await schemaCompletionData.GetChildElementCompletionData(simpleEnumPath, CancellationToken.None); // Set up enum path. enumPath = new XmlElementPath(); enumPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); enumPath.Elements.Add(new QualifiedName("simpleType", namespaceURI, prefix)); enumPath.Elements.Add(new QualifiedName("restriction", namespaceURI, prefix)); enumPath.Elements.Add(new QualifiedName("enumeration", namespaceURI, prefix)); // Get attributes. enumAttributes = await schemaCompletionData.GetAttributeCompletionData(enumPath, CancellationToken.None); // Set up xs:all path. allElementPath = new XmlElementPath(); allElementPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); allElementPath.Elements.Add(new QualifiedName("element", namespaceURI, prefix)); allElementPath.Elements.Add(new QualifiedName("complexType", namespaceURI, prefix)); allElementPath.Elements.Add(new QualifiedName("all", namespaceURI, prefix)); // Get child elements of the xs:all element. allElementChildElements = await schemaCompletionData.GetChildElementCompletionData(allElementPath, CancellationToken.None); // Set up the path to the annotation element that is a child of xs:all. allElementAnnotationPath = new XmlElementPath(); allElementAnnotationPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix)); allElementAnnotationPath.Elements.Add(new QualifiedName("element", namespaceURI, prefix)); allElementAnnotationPath.Elements.Add(new QualifiedName("complexType", namespaceURI, prefix)); allElementAnnotationPath.Elements.Add(new QualifiedName("all", namespaceURI, prefix)); allElementAnnotationPath.Elements.Add(new QualifiedName("annotation", namespaceURI, prefix)); // Get the xs:all annotation child element. allElementAnnotationChildElements = await schemaCompletionData.GetChildElementCompletionData(allElementAnnotationPath, CancellationToken.None); }