當前位置: 首頁>>代碼示例>>C#>>正文


C# Xsl.XsltContext類代碼示例

本文整理匯總了C#中System.Xml.Xsl.XsltContext的典型用法代碼示例。如果您正苦於以下問題:C# XsltContext類的具體用法?C# XsltContext怎麽用?C# XsltContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XsltContext類屬於System.Xml.Xsl命名空間,在下文中一共展示了XsltContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetXsltContext

        internal override void SetXsltContext(XsltContext context){
            System.Diagnostics.Debug.Assert(context != null);
            m_URN = context.LookupNamespace(m_Prefix);
            if (m_qyInput != null)
                m_qyInput.SetXsltContext(context);

        }
開發者ID:ArildF,項目名稱:masters,代碼行數:7,代碼來源:baseaxisquery.cs

示例2: XPathParser

 internal XPathParser(string xpath, XmlNamespaceManager namespaces, IFunctionLibrary[] functionLibraries)
 {
     this.functionLibraries = functionLibraries;
     this.namespaces = namespaces;
     this.lexer = new XPathLexer(xpath);
     this.context = namespaces as XsltContext;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:XPathParser.cs

示例3: SetXsltContext

 public override void SetXsltContext(XsltContext context)
 {
     if (this.arg != null)
     {
         this.arg.SetXsltContext(context);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:BooleanFunctions.cs

示例4: XsltFunctionCallOpcode

        // REFACTOR, [....], make this a function on QueryValueModel
        internal XsltFunctionCallOpcode(XsltContext context, IXsltContextFunction function, int argCount)
            : base(OpcodeID.XsltFunction)
        {
            Fx.Assert(null != context && null != function, "");
            this.xsltContext = context;
            this.function = function;
            this.argCount = argCount;

            for (int i = 0; i < function.Maxargs; ++i)
            {
                if (function.ArgTypes[i] == XPathResultType.NodeSet)
                {
                    this.iterList = new List<NodeSequenceIterator>();
                    break;
                }
            }

            // Make sure the return type is valid
            switch (this.function.ReturnType)
            {
                case XPathResultType.String:
                case XPathResultType.Number:
                case XPathResultType.Boolean:
                case XPathResultType.NodeSet:
                    break;

                default:
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryCompileException(QueryCompileError.InvalidType, SR.GetString(SR.QueryFunctionTypeNotSupported, this.function.ReturnType.ToString())));
            }

        }
開發者ID:krytht,項目名稱:DotNetReferenceSource,代碼行數:32,代碼來源:QueryFunctions.cs

示例5: SetXsltContext

 public override void SetXsltContext(XsltContext context)
 {
     if (context == null)
     {
         throw XPathException.Create(SR.Xp_NoContext);
     }
     if (this.xsltContext != context)
     {
         xsltContext = context;
         foreach (Query argument in _args)
         {
             argument.SetXsltContext(context);
         }
         XPathResultType[] argTypes = new XPathResultType[_args.Count];
         for (int i = 0; i < _args.Count; i++)
         {
             argTypes[i] = _args[i].StaticType;
         }
         _function = xsltContext.ResolveFunction(prefix, name, argTypes);
         // KB article allows to return null, see http://support.microsoft.com/?kbid=324462#6
         if (_function == null)
         {
             throw XPathException.Create(SR.Xp_UndefFunc, QName);
         }
     }
 }
開發者ID:noahfalk,項目名稱:corefx,代碼行數:26,代碼來源:FunctionQuery.cs

示例6: XsltDebuggerContext

		public XsltDebuggerContext (XsltDebuggerSession session, XPathNodeIterator currentNodeset, XPathNavigator stylesheetElement, XsltContext xsltContext)
		{
			this.session = session;
			this.nodes = currentNodeset;
			this.style = stylesheetElement;
			this.xsltctx = xsltContext;
		}
開發者ID:alesliehughes,項目名稱:olive,代碼行數:7,代碼來源:XsltDebuggerContext.cs

示例7: SetContext

		public void SetContext(XsltContext context)
		{
			path.SetContext(context);

			if (firstStep != null)
				firstStep.SetContext(context);
		}
開發者ID:elevine,項目名稱:Core,代碼行數:7,代碼來源:CompiledXPath.cs

示例8: Invoke

        public object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext) {
            bool result = false;
            try {
                Navigator nav = null;
                string toTypeName = null;

                if (args.Length == 2) {
                    XPathNodeIterator it = (XPathNodeIterator)args[0];
                    if (it.MoveNext()) {
                        toTypeName = (string)args[1];
                        nav = (Navigator)it.Current;
                    }
                } else {
                    toTypeName = (string)args[0];
                    nav = (Navigator)docContext;
                }

                if (nav.Current is Mono.Cecil.TypeReference) {
                    Mono.Cecil.TypeReference reference = (Mono.Cecil.TypeReference)nav.Current;
                    Type fromType = Type.GetType(reference.FullName);
                    Type toType = Type.GetType(toTypeName);

                    if (fromType != null && toType != null)
                        result = toType.IsAssignableFrom(fromType);
                }

            } catch (Exception e) {
                Console.WriteLine("CanCastTo function failed : \n" + e);
            }
            return result;
        }
開發者ID:pusp,項目名稱:o2platform,代碼行數:31,代碼來源:Context.cs

示例9: Invoke

 /// <summary>
 /// Provides the method to invoke the function with the given arguments in the given context.
 /// </summary>
 /// <returns>
 /// An <see cref="T:System.Object"/> representing the return value of the function. 
 /// </returns>
 /// <param name="xsltContext">
 /// The XSLT context for the function call. 
 /// </param>
 /// <param name="args">
 /// The arguments of the function call. Each argument is an element in the array. 
 /// </param>
 /// <param name="docContext">
 /// The context node for the function call. 
 /// </param>
 public object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
 {
     string sep = Template.ResultToString(args[1]);
     XPathNodeIterator nodeIter = (XPathNodeIterator)args[0];
     string ret = string.Join(sep, nodeIter.Cast<XPathNavigator>().Select(n => n.ToString()));
     return ret;
 }
開發者ID:LBiNetherlands,項目名稱:LBi.LostDoc,代碼行數:22,代碼來源:XsltContextJoinFunction.cs

示例10: Invoke

        public object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
        {
            switch (function)
            {
                case "document":
                    string url = args.Any() ? (string) args[0] : string.Empty;

                    if (string.IsNullOrWhiteSpace(url)) // When document('') targeting local xsl
                    {
                        throw new ArgumentException("url");

                        //var secondNavigator = docContext.Clone();
                        //secondNavigator.MoveToRoot();
                        //return secondNavigator.Select(".");
                    }
                    // When Url is supplied in document(url)

                    XDocument xDoc =
                        XDocument.Load(Directory.GetCurrentDirectory() + "/SchematronFiles/" + (string) args[0]);
                    XElement rootElement = xDoc.XPathSelectElement("/*");
                    return rootElement.CreateNavigator().Select(".");
            }

            return null;
        }
開發者ID:dshalimov,項目名稱:CCDASchematronEngine,代碼行數:25,代碼來源:XsltContextFunction.cs

示例11: Invoke

 public virtual object Invoke(XsltContext xsltContext, object[] args, System.Xml.XPath.XPathNavigator docContext)
 {
     if (Function != null)
         return Function(xsltContext, args, docContext);
     else
         throw new NotImplementedException("Custom function not implemented. Supply a lamba, or override Invoke()");
 }
開發者ID:tiloc,項目名稱:fhir-net-api,代碼行數:7,代碼來源:CustomXsltFunction.cs

示例12: SetXsltContext

 public override void SetXsltContext(XsltContext context)
 {
     for (int i = 0; i < _argList.Count; i++)
     {
         _argList[i].SetXsltContext(context);
     }
 }
開發者ID:svcgany1,項目名稱:corefx,代碼行數:7,代碼來源:StringFunctions.cs

示例13: Evaluate

 public object Evaluate(XsltContext xsltContext){
     object val = null;
     if (tr != null)
         val = tr.GetParameter(name);
     else
         val = ext.GetType().GetProperty(name).GetValue(ext, null);
     return val == null ? "" : val;
 }
開發者ID:Qorpent,項目名稱:comdiv.oldcore,代碼行數:8,代碼來源:XsltSimpleContextVariable.cs

示例14: Invoke

 public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
 {
     string str = XPathMessageFunction.ToString(args[0]);
     string xpath = string.Format(CultureInfo.InvariantCulture, "/s11:Envelope/s11:Header/*[@s11:actor='{0}'] | /s12:Envelope/s12:Header/*[@s12:role='{1}']", new object[] { str, str });
     XPathExpression expr = docContext.Compile(xpath);
     expr.SetContext((XmlNamespaceManager) xsltContext);
     return docContext.Evaluate(expr);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:XPathMessageFunctionHeadersWithActor.cs

示例15: SetXsltContext

 public override void SetXsltContext(XsltContext context)
 {
     _xsltContext = context.Whitespace ? context : null;
     if (_arg != null)
     {
         _arg.SetXsltContext(context);
     }
 }
開發者ID:noahfalk,項目名稱:corefx,代碼行數:8,代碼來源:NodeFunctions.cs


注:本文中的System.Xml.Xsl.XsltContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。