コード例 #1
0
        private Specification BuildNode(XmlElement node)
        {
            if (!_operatorMap.ContainsKey(node.Name))
            {
                throw new XmlSpecificationCompilerException("Unknown Xml specification node: " + node.Name);
            }

            IXmlSpecificationCompilerOperator op = _operatorMap[node.Name];
            Specification spec = op.Compile(node, _compilerContext);

            string test = GetAttributeOrNull(node, "test");

            if (test != null)
            {
                spec.TestExpression = CreateExpression(test, GetAttributeOrNull(node, "expressionLanguage"));
            }

            spec.FailureMessage = GetAttributeOrNull(node, "failMessage");
            return(spec);
        }
コード例 #2
0
 private void AddOperator(IXmlSpecificationCompilerOperator op)
 {
     _operatorMap.Add(op.OperatorTag, op);
 }