示例#1
0
        private static void ProcessDirectiveTag(XmlDocument xml, XmlElement phe, string value)
        {
            Debug.Assert(xml != null);
            Debug.Assert(phe != null);
            Debug.Assert(!string.IsNullOrEmpty(value));

            var se = new DirectiveElement(xml, value);
            if (phe.ParentNode.ChildNodes.Count == 1)
            {
                phe.ParentNode.ParentNode.ReplaceChild(se, phe.ParentNode);
            }
            else
            {
                phe.ParentNode.ReplaceChild(se, phe);
            }
        }
示例#2
0
        private static void ProcessDirectiveTag(
            XmlDocument xml, XmlElement placeholderNode, string value)
        {
            Debug.Assert(xml != null);
            Debug.Assert(placeholderNode != null);
            Debug.Assert(!string.IsNullOrEmpty(value));

            var directive = new DirectiveElement(xml, value);
            directive.ReduceTagByDirective(placeholderNode);
        }
示例#3
0
        private static void PreprocessElements(XmlDocument xml, XmlNamespaceManager nsmanager)
        {
            var placeholders = FindAllRtlElements(xml);

            foreach (XmlNode placeholder in placeholders)
            {
                string value = ExtractTemplateExpression(placeholder);

                if (value[0] == '$')
                {
                    ProcessIdentifierTag(xml, placeholder, value);

                }
                else if (value[0] == '#')
                {
                    var directiveNode = new DirectiveElement(xml, value);
                    directiveNode.ReduceTagByCount(placeholder);
                    //ReduceTag(directiveNode, placeholder);
                }
                else
                {
                    throw new SyntaxErrorException();
                }
            }
        }