Exemplo n.º 1
0
 protected override void Visit(ExtensionNode extensionNode)
 {
     var extensionChunk = new ExtensionChunk { Extension = extensionNode.Extension, Position = Locate(extensionNode) };
     Chunks.Add(extensionChunk);
     using (new Frame(this, extensionChunk.Body))
         extensionNode.Extension.VisitNode(this, extensionNode.Body, Chunks);
 }
Exemplo n.º 2
0
 protected abstract void Visit(ExtensionNode node);
Exemplo n.º 3
0
        protected override void Visit(ElementNode node)
        {
            ISparkExtension extension;
            if (IsContainingElement(node.Name, node.Namespace))
            {
                PushSpecial(node);
                if (node.IsEmptyElement)
                    PopSpecial(node.Name);
            }
            else if (IsNonContainingElement(node.Name, node.Namespace))
            {
                PushSpecial(node);
                PopSpecial(node.Name);
            }
            else if (TryCreateExtension(node, out extension))
            {
                ExtensionNode extensionNode = new ExtensionNode(node, extension);
                Nodes.Add(extensionNode);

                if (!node.IsEmptyElement)
                {
                    _extensionNodes.Push(extensionNode);
                    _stack.Push(Nodes);
                    _nodes = extensionNode.Body;
                }
            }
            else if (IsPartialFileElement(node.Name, node.Namespace))
            {
                var attributes = new List<AttributeNode>(node.Attributes);
                attributes.Add(new AttributeNode("file", "_" + NameUtility.GetName(node.Name)));
                var useFile = new ElementNode("use", attributes, node.IsEmptyElement)
                                  {
                                      OriginalNode = node
                                  };
                PushSpecial(useFile);
                if (node.IsEmptyElement)
                    PopSpecial("use");
            }
            else
            {
                Add(node);
            }
        }
Exemplo n.º 4
0
        protected override void Visit(ExtensionNode node)
        {
            var reconstructed = new ExtensionNode(node.Element, node.Extension);

            PushFrame();

            _frame.Nodes = reconstructed.Body;
            Accept(node.Body);

            PopFrame();

            Nodes.Add(reconstructed);
        }
Exemplo n.º 5
0
 protected override void Visit(ExtensionNode node)
 {
     throw new System.NotImplementedException();
 }