• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Xsl.XsltContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Xml.Xsl.XsltContext的典型用法代码示例。如果您正苦于以下问题:C# XsltContext类的具体用法?C# XsltContext怎么用?C# XsltContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XsltContext类属于System.Xml.Xsl命名空间,在下文中一共展示了XsltContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SetXsltContext

 internal override void SetXsltContext(XsltContext context){
     checkWhitespace = context.Whitespace;
     if (checkWhitespace) {
         this.context = context;
     }
     if (_Opnd != null)
         _Opnd.SetXsltContext(context);
 }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:methodoperand.cs


示例17: Evaluate

 public object Evaluate(XsltContext xsltContext)
 {
     if (this.Value is DateTime)
     {
         return string.Format("{0:u}", this.Value);
     }
     return this.Value;
 }
开发者ID:RavneetK,项目名称:second-test,代码行数:8,代码来源:ParseContextVariable.cs


示例18: Matches

		public override bool Matches (XPathNavigator node, XsltContext ctx)
		{
			XPathNavigator tmp = ((XsltCompiledContext) ctx).GetNavCache (this, node);
			for (int i = 0; i < ids.Length; i++)
				if (tmp.MoveToId (ids [i]) && tmp.IsSamePosition (node))
					return true;
			return false;
		}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:IdPattern.cs


示例19: Invoke

 public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
 {
     XPathNodeIterator iterator = (XPathNodeIterator) args[0];
     if (!iterator.MoveNext())
     {
         return string.Empty;
     }
     return ExtractFromNavigator(iterator.Current.Clone());
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:XPathMessageFunctionActor.cs


示例20: Invoke

        public object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
        {
            AssetIdentifier aid = AssetIdentifier.Parse(Template.ResultToString(args[0]));

            if (this._ignoredVersionComponent.HasValue)
                return aid.Version.ToString((int)this._ignoredVersionComponent.Value);

            return aid.Version.ToString();
        }
开发者ID:LBiNetherlands,项目名称:LBi.LostDoc,代码行数:9,代码来源:XsltContextAssetVersionGetter.cs



注:本文中的System.Xml.Xsl.XsltContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Xsl.XsltSettings类代码示例发布时间:2022-05-26
下一篇:
C# Xsl.XsltArgumentList类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap