Example #1
0
        /// <summary>
        /// Gets the XML for an ESD controlled list or mapping, cacheing it if possible
        /// </summary>
        /// <param name="xmlFileUri">The URI of the XML file.</param>
        /// <param name="withDom">true to include DOM and XPath support; false for XPath only</param>
        /// <returns>Populated XML document, or null if not found</returns>
        /// <exception cref="FileNotFoundException">Thrown if the file doesn't exist</exception>
        /// <exception cref="XmlException">Thrown if the file isn't XML</exception>
        /// <exception cref="ArgumentException">Thrown if the file isn't recognised as ESD Taxonomy XML</exception>
        public static EsdXmlDocument GetEsdDocument(Uri xmlFileUri, bool withDom)
        {
            Type documentType = EsdXmlDocument.GetEsdDocumentType(xmlFileUri);

            if (documentType == typeof(EsdControlledList))
            {
                return(EsdControlledList.GetControlledList(xmlFileUri, withDom));
            }
            else if (documentType == typeof(EsdMapping))
            {
                return(EsdMapping.GetMapping(xmlFileUri, withDom));
            }

            // Need this to compile. Shouldn't ever return null, because if neither of those two match an exception should have been thrown
            return(null);
        }
Example #2
0
 /// <summary>
 /// Gets the XML for an ESD controlled list or mapping, cacheing it if possible
 /// </summary>
 /// <param name="xmlFileUri">The URI of the XML file.</param>
 /// <returns>
 /// Populated XML document, or null if not found
 /// </returns>
 public static EsdXmlDocument GetEsdDocument(Uri xmlFileUri)
 {
     return(EsdXmlDocument.GetEsdDocument(xmlFileUri, false));
 }
Example #3
0
 /// <summary>
 /// Gets the XML for an ESD controlled list or mapping, cacheing it if possible
 /// </summary>
 /// <param name="configKey">Key for XML file name &lt;Escc.Web.Metadata/ControlledListXml&gt; section of web.config</param>
 /// <returns>Populated XML document, or null if not found</returns>
 public static EsdXmlDocument GetEsdDocument(string configKey)
 {
     return(EsdXmlDocument.GetEsdDocument(configKey, false));
 }