示例#1
0
 public XslNode(XslNodeType nodeType, QilName name, object arg, XslVersion xslVer)
 {
     this.NodeType   = nodeType;
     this.Name       = name;
     this.Arg        = arg;
     this.XslVersion = xslVer;
 }
 public XslNodeEx(XslNodeType t, QilName name, object arg, ContextInfo ctxInfo, XslVersion xslVer)
     : base(t, name, arg, xslVer)
 {
     ElemNameLi = ctxInfo.elemNameLi;
     EndTagLi   = ctxInfo.endTagLi;
     Debug.Assert(ElemNameLi != null && EndTagLi != null);
 }
示例#3
0
 public XslNode(XslNodeType nodeType)
 {
     this.NodeType   = nodeType;
     this.XslVersion = XslVersion.Current;
 }
示例#4
0
 public static VarPar VarPar(XslNodeType nt, QilName name, string select, XslVersion xslVer)
 {
     return(new VarPar(nt, name, select, xslVer));
 }
示例#5
0
 public static XslNode XslNode(XslNodeType nodeType, QilName name, string arg, XslVersion xslVer)
 {
     return(new XslNode(nodeType, name, arg, xslVer));
 }
示例#6
0
 public XslNodeEx(XslNodeType t, QilName name, object arg, XslVersion xslVer) : base(t, name, arg, xslVer)
 {
 }
示例#7
0
 public XslNodeEx(XslNodeType t, QilName name, object arg, ContextInfo ctxInfo, XslVersion xslVer)
     : base(t, name, arg, xslVer)
 {
     ElemNameLi = ctxInfo.elemNameLi;
     EndTagLi   = ctxInfo.endTagLi;
 }
示例#8
0
 public NodeCtor(XslNodeType nt, string nameAvt, string nsAvt, XslVersion xslVer)
     : base(nt, null, null, xslVer)
 {
     this.NameAvt = nameAvt;
     this.NsAvt   = nsAvt;
 }
示例#9
0
        public QilNode Value;          // Contains value for WithParams and global VarPars

        public VarPar(XslNodeType nt, QilName name, string select, XslVersion xslVer) : base(nt, name, select, xslVer)
        {
        }
示例#10
0
        public QilFunction Function;                   // Compiled body

        public ProtoTemplate(XslNodeType nt, QilName name, XslVersion xslVer) : base(nt, name, null, xslVer)
        {
        }
示例#11
0
 private void LoadGlobalVariableOrParameter(NsDecl stylesheetNsList, XslNodeType nodeType)
 {
     Debug.Assert(_curTemplate == null);
     Debug.Assert(_input.CanHaveApplyImports == false);
     VarPar var = XslVarPar();
     // Preserving namespaces to parse content later
     var.Namespaces = MergeNamespaces(var.Namespaces, stylesheetNsList);
     CheckError(!_curStylesheet.AddVarPar(var), /*[XT0630]*/SR.Xslt_DupGlobalVariable, var.Name.QualifiedName);
 }
 private void LoadGlobalVariableOrParameter(NsDecl stylesheetNsList, XslNodeType nodeType) {
     VarPar var = XslVarPar(nodeType);
     // Preserving namespaces to parse content later
     var.Namespaces = MergeNamespaces(var.Namespaces, stylesheetNsList);
     if (!curStylesheet.AddVarPar(var)) {
         ReportError(/*[XT0630]*/Res.Xslt_DupGlobalVariable, var.Name.QualifiedName);
     }
 }
        // xsl:variable     http://www.w3.org/TR/xslt#local-variables
        // xsl:param        http://www.w3.org/TR/xslt#element-param
        // xsl:with-param   http://www.w3.org/TR/xslt#element-with-param
        private VarPar XslVarPar(XslNodeType nodeType) {
            Debug.Assert(
                nodeType == XslNodeType.Variable  && input.LocalName == input.Atoms.Variable  ||
                nodeType == XslNodeType.Param     && input.LocalName == input.Atoms.Param     ||
                nodeType == XslNodeType.WithParam && input.LocalName == input.Atoms.WithParam
            );
            string attName  ;
            string attSelect;
            ContextInfo ctxInfo = input.GetAttributes(/*required:*/1,
                input.Atoms.Name  , out attName,
                input.Atoms.Select, out attSelect
            );

            List<XslNode> content = LoadInstructions();
            // Load the end tag only if the content is not empty
            if (content.Count != 0) {
                content = LoadEndTag(content);
            }

            if (attSelect != null && content.Count != 0) {
                ReportError(/*[XT0620]*/Res.Xslt_VariableCntSel2, attName);
            }

            VarPar result = f.VarPar(nodeType, CreateXPathQName(attName), attSelect, input.XslVersion);
            SetInfo(result, content, ctxInfo);
            return result;
        }