protected override void Visit(XMLDeclNode node)
        {
            //[23]      XMLDecl	   ::=      '<?xml' VersionInfo  EncodingDecl? SDDecl? S? '?>'
            //[24]      VersionInfo	   ::=       S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
            //[80]      EncodingDecl	   ::=       S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
            //[32]      SDDecl	   ::=       S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))

            var encoding = "";

            if (!string.IsNullOrEmpty(node.Encoding))
            {
                if (node.Encoding.Contains("\""))
                {
                    encoding = string.Concat(" encoding='", node.Encoding, "'");
                }
                else
                {
                    encoding = string.Concat(" encoding=\"", node.Encoding, "\"");
                }
            }

            var standalone = "";

            if (!string.IsNullOrEmpty(node.Standalone))
            {
                standalone = string.Concat(" standalone=\"", node.Standalone, "\"");
            }

            AddLiteral(string.Concat("<?xml version=\"1.0\"", encoding, standalone, " ?>"));
        }
Beispiel #2
0
        protected override void Visit(XMLDeclNode node)
        {
            string str = "";

            if (!string.IsNullOrEmpty(node.Encoding))
            {
                if (node.Encoding.Contains("\""))
                {
                    str = " encoding='" + node.Encoding + "'";
                }
                else
                {
                    str = " encoding=\"" + node.Encoding + "\"";
                }
            }
            string str2 = "";

            if (!string.IsNullOrEmpty(node.Standalone))
            {
                str2 = " standalone=\"" + node.Standalone + "\"";
            }
            this.AddLiteral("<?xml version=\"1.0\"" + str + str2 + " ?>");
        }
Beispiel #3
0
 protected abstract void Visit(XMLDeclNode node);
 protected override void Visit(XMLDeclNode node)
 {
     this.Nodes.Add(node);
 }