Exemplo n.º 1
0
        public override string ReadInnerXml()
        {
            if (ReadState == ReadState.Interactive)
            {
                if (NodeType == XmlNodeType.Element && !IsEmptyElement)
                {
                    StringOutput output = new StringOutput(this.processor);
                    output.OmitXmlDecl();
                    int depth = Depth;

                    Read();                 // skeep  begin Element
                    while (depth < Depth)   // process content
                    {
                        Debug.Assert(this.builder != null);
                        output.RecordDone(this.builder);
                        Read();
                    }
                    Debug.Assert(NodeType == XmlNodeType.EndElement);
                    Read();                 // skeep end element

                    output.TheEnd();
                    return(output.Result);
                }
                else if (NodeType == XmlNodeType.Attribute)
                {
                    return(encoder.AtributeInnerXml(Value));
                }
                else
                {
                    Read();
                }
            }
            return(String.Empty);
        }
Exemplo n.º 2
0
        public override string ReadOuterXml()
        {
            if (ReadState == ReadState.Interactive)
            {
                if (NodeType == XmlNodeType.Element)
                {
                    StringOutput output = new StringOutput(this.processor);
                    output.OmitXmlDecl();
                    bool emptyElement = IsEmptyElement;
                    int  depth        = Depth;
                    // process current record
                    output.RecordDone(this.builder);
                    Read();
                    // process internal elements & text nodes
                    while (depth < Depth)
                    {
                        Debug.Assert(this.builder != null);
                        output.RecordDone(this.builder);
                        Read();
                    }
                    // process end element
                    if (!emptyElement)
                    {
                        output.RecordDone(this.builder);
                        Read();
                    }

                    output.TheEnd();
                    return(output.Result);
                }
                else if (NodeType == XmlNodeType.Attribute)
                {
                    return(encoder.AtributeOuterXml(Name, Value));
                }
                else
                {
                    Read();
                }
            }
            return(String.Empty);
        }
Exemplo n.º 3
0
        public override string ReadOuterXml() {
            if (ReadState == ReadState.Interactive) {
                if (NodeType == XmlNodeType.Element) {
                    StringOutput output = new StringOutput(this.processor);
                    output.OmitXmlDecl();
                    bool emptyElement = IsEmptyElement;
                    int  depth        = Depth;
                    // process current record
                    output.RecordDone(this.builder); 
                    Read();                          
                    // process internal elements & text nodes
                    while(depth < Depth) {                      
                        Debug.Assert(this.builder != null);
                        output.RecordDone(this.builder);
                        Read();
                    }
                    // process end element
                    if (! emptyElement) {
                        output.RecordDone(this.builder);            
                        Read();
                    }

                    output.TheEnd();
                    return output.Result; 
                }
                else if(NodeType == XmlNodeType.Attribute) {
                    return encoder.AtributeOuterXml(Name, Value);
                }
                else {
                    Read();
                }
            }
            return String.Empty;
        }
Exemplo n.º 4
0
        public override string ReadInnerXml() {
            if (ReadState == ReadState.Interactive) {
                if (NodeType == XmlNodeType.Element && ! IsEmptyElement) {
                    StringOutput output = new StringOutput(this.processor);
                    output.OmitXmlDecl();
                    int depth = Depth;

                    Read();                 // skeep  begin Element
                    while (depth < Depth) { // process content
                        Debug.Assert(this.builder != null);
                        output.RecordDone(this.builder);
                        Read();
                    }
                    Debug.Assert(NodeType == XmlNodeType.EndElement);
                    Read();                 // skeep end element

                    output.TheEnd();
                    return output.Result;
                }
                else if(NodeType == XmlNodeType.Attribute) {
                    return encoder.AtributeInnerXml(Value);
                }
                else {
                    Read();
                }
            }
            return String.Empty;
        }