Exemplo n.º 1
0
        public NvdlResultInterp(NvdlDispatcher dispatcher,
                                SimpleMode createdMode,
                                SimpleResultAction resultAction,
                                NvdlInterpretation parent)
            : base(dispatcher, createdMode, resultAction, parent)
        {
            NvdlDebug.Writer.WriteLine("++++++ new resultAction " + resultAction.Location);
            type = resultAction.ResultType;

            if (type == NvdlResultType.AttachPlaceholder && parent != null)
            {
                parent.AttachPlaceholder();
            }
        }
Exemplo n.º 2
0
        // Public overrides

        public override bool Read()
        {
            // This class itself never proceeds, just checks if
            // the reader is placed on EOF.
            if (reader.EOF)
            {
                return(false);
            }

            MoveToElement();
            attributeCount = 0;

            if (nextPlaceHolder != XmlNodeType.None)
            {
                placeHolder     = nextPlaceHolder;
                nextPlaceHolder = XmlNodeType.None;
                return(true);
            }

            if (placeHolder != XmlNodeType.None)
            {
                // Inside placeHolder, ignore all contents.
                // The source XmlReader should proceed
                // regardless of this filtered reader.
                return(true);
            }

            if (!reader.MoveToFirstAttribute())
            {
                return(true);
            }

            // Attribute rule application
            attributeValidators.Clear();
            do
            {
                if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
                {
                    continue;
                }
                // FIXME: could be more efficient
                SimpleRule rule = FindAttributeRule(
                    reader.NamespaceURI,
                    validate.CreatedMode);
                foreach (SimpleAction a in rule.Actions)
                {
                    SimpleResultAction ra =
                        a as SimpleResultAction;
                    if (ra != null &&
                        ra.ResultType == NvdlResultType.Attach)
                    {
                        AddAttribute();
                    }
                    if (ra != null)
                    {
                        continue;
                    }
                    attributeValidators [reader.NamespaceURI] = a;
                }
            }while (reader.MoveToNextAttribute());
            reader.MoveToElement();

            if (attributeValidators.Count > 0)
            {
                foreach (string ns in attributeValidators.Keys)
                {
                    ((SimpleValidate)attributeValidators [
                         ns]).ValidateAttributes(reader, ns);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
		public NvdlResultInterp (NvdlDispatcher dispatcher,
			SimpleMode createdMode,
			SimpleResultAction resultAction,
			NvdlInterpretation parent)
			: base (dispatcher, createdMode, resultAction, parent)
		{
NvdlDebug.Writer.WriteLine ("++++++ new resultAction " + resultAction.Location);
			type = resultAction.ResultType;

			if (type == NvdlResultType.AttachPlaceholder && parent != null)
				parent.AttachPlaceholder ();
		}