System.Xml.Xsl.XsltOld.Compiler.ResolveUri C# (CSharp) Method

ResolveUri() private method

private ResolveUri ( string relativeUri ) : Uri
relativeUri string
return Uri
        internal Uri ResolveUri(string relativeUri)
        {
            Debug.Assert(_xmlResolver != null);
            string baseUri = this.Input.BaseURI;
            Uri uri = _xmlResolver.ResolveUri((baseUri.Length != 0) ? _xmlResolver.ResolveUri(null, baseUri) : null, relativeUri);
            if (uri == null)
            {
                throw XsltException.Create(SR.Xslt_CantResolve, relativeUri);
            }
            return uri;
        }

Usage Example

Ejemplo n.º 1
0
        // SxS: This method does not take any resource name and does not expose any resources to the caller.
        // It's OK to suppress the SxS warning.
        private void CompileInclude(Compiler compiler)
        {
            Uri    uri      = compiler.ResolveUri(compiler.GetSingleAttribute(compiler.Input.Atoms.Href));
            string resolved = uri.ToString();

            if (compiler.IsCircularReference(resolved))
            {
                throw XsltException.Create(SR.Xslt_CircularInclude, resolved);
            }

            NavigatorInput input = compiler.ResolveDocument(uri);

            compiler.PushInputDocument(input);

            try
            {
                CompileDocument(compiler, /*inInclude*/ true);
            }
            catch (XsltCompileException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new XsltCompileException(e, input.BaseURI, input.LineNumber, input.LinePosition);
            }
            finally
            {
                compiler.PopInputDocument();
            }
            CheckEmpty(compiler);
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Compiler::ResolveUri