コード例 #1
0
ファイル: HtmlReader_v3.cs プロジェクト: labeuze/source
 private HtmlNodeProperty CreateHtmlNodeProperty(HtmlReaderProperty property)
 {
     return new HtmlNodeProperty
     {
         Index = _htmlNodeIndex++,
         Line = _disableLineColumn ? 0 : property.Line,
         Column = _disableLineColumn ? 0 : property.Column,
         Name = property.Name,
         Value = property.Value.Value,
         Quote = property.Value.Quote
     };
 }
コード例 #2
0
ファイル: HtmlReader_v3.cs プロジェクト: labeuze/source
        //private bool ReadProperty()
        private HtmlReaderProperty ReadProperty()
        {
            ReadSpaceChar();
            // detect a new tag inside the current tag
            if (PeekChar() == '<' && (char.IsLetter((char)PeekChar(1)) || (PeekChar(1) == '/' && char.IsLetter((char)PeekChar(2)))))
                //return false;
                return null;

            HtmlReaderProperty property = new HtmlReaderProperty();
            property.Line = _line;
            property.Column = _column;

            //string propertyName = ReadPropertyName();
            property.Name = ReadPropertyName();
            string separator = ReadSeparator();
            //HtmlStringValue value = null;
            if (PeekChar() == '=')
            {
                GetChar();
                ReadSpaceChar();
                property.Value = ReadStringValue();
                separator = ReadSeparator();
            }
            else
                property.Value = new HtmlReaderStringValue();
            if (_char == '/')
            {
                //_isMarkBeginEnd = true;
                property.EndTag = true;
                GetChar();
            }
            if (_char == '>')
                property.CloseTag = true;
            //_isProperty = true;
            //return true;
            return property;
        }