Example #1
0
        /// <summary>
        /// Gets the root element metadata for the reader's current XML node</summary>
        /// <param name="reader">XML reader</param>
        /// <param name="rootUri">URI of XML data</param>
        /// <returns>Root element metadata for the reader's current XML node</returns>
        protected override ChildInfo CreateRootElement(XmlReader reader, Uri rootUri)
        {
            string fileNameForm = reader.GetAttribute("filenameform");

            if (fileNameForm != null)
            {
                m_relativeFilePaths = (fileNameForm == "atgrootrelative");
            }

            // ignore the ATGI version in the document, and use the loaded ATGI schema instead
            AtgiSchemaTypeLoader atgiSchemaTypeLoader = TypeLoader as AtgiSchemaTypeLoader;

            if (atgiSchemaTypeLoader != null)
            {
                XmlQualifiedName rootElementName =
                    new XmlQualifiedName(reader.LocalName, atgiSchemaTypeLoader.Namespace);
                ChildInfo rootElement = TypeLoader.GetRootElement(rootElementName.ToString());
                // ID passed to TypeLoader.GetRootElement must be same format as in XmlSchemaTypeLoader.Load(XmlSchemaSet)
                // In XmlSchemaTypeLoader.cs look for "string name = element.QualifiedName.ToString();"
                return(rootElement);
            }
            else
            {
                return(base.CreateRootElement(reader, rootUri));
            }
        }
Example #2
0
        /// <summary>
        /// Gets the root element metadata for the reader's current XML node</summary>
        /// <param name="reader">XML reader</param>
        /// <param name="rootUri">URI of XML data</param>
        /// <returns>Root element metadata for the reader's current XML node</returns>
        protected override ChildInfo CreateRootElement(XmlReader reader, Uri rootUri)
        {
            ColladaSchemaTypeLoader colladaSchemaTypeLoader = TypeLoader as ColladaSchemaTypeLoader;

            if (colladaSchemaTypeLoader == null)
            {
                return(base.CreateRootElement(reader, rootUri));
            }

            XmlQualifiedName rootElementName =
                new XmlQualifiedName(reader.LocalName, colladaSchemaTypeLoader.Namespace);

            return(TypeLoader.GetRootElement(rootElementName.ToString()));
        }