本文整理汇总了C#中Tidy.Core.Node.CheckUniqueAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# Node.CheckUniqueAttributes方法的具体用法?C# Node.CheckUniqueAttributes怎么用?C# Node.CheckUniqueAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tidy.Core.Node
的用法示例。
在下文中一共展示了Node.CheckUniqueAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Check
public virtual void Check(Lexer lexer, Node node)
{
node.CheckUniqueAttributes(lexer);
AttVal lang = node.GetAttrByName("language");
AttVal type = node.GetAttrByName("type");
if (type == null)
{
Report.AttrError(lexer, node, "type", Report.MISSING_ATTRIBUTE);
/* check for javascript */
if (lang != null)
{
string str = lang.Val;
if (str.Length > 10)
{
str = str.Substring(0, 10);
}
if ((String.CompareOrdinal(str, "javascript") == 0) || (String.CompareOrdinal(str, "jscript") == 0))
{
node.AddAttribute("type", "text/javascript");
}
}
else
{
node.AddAttribute("type", "text/javascript");
}
}
}
示例2: Check
public virtual void Check(Lexer lexer, Node node)
{
AttVal attval;
string val = null;
node.CheckUniqueAttributes(lexer);
for (attval = node.Attributes; attval != null; attval = attval.Next)
{
if (String.CompareOrdinal(attval.Attribute, "align") == 0)
{
val = attval.Val;
break;
}
}
if (val != null)
{
if (String.CompareOrdinal(val, "left") == 0 || String.CompareOrdinal(val, "right") == 0)
{
lexer.Versions &= HtmlVersion.Html40Loose | HtmlVersion.Frames;
}
else if (String.CompareOrdinal(val, "top") == 0 || String.CompareOrdinal(val, "bottom") == 0)
{
lexer.Versions &= HtmlVersion.From32;
}
else
{
Report.AttrError(lexer, node, val, Report.BAD_ATTRIBUTE_VALUE);
}
}
}
示例3: GetToken
//.........这里部分代码省略.........
else if (c != '\n' && c != '\f')
{
Input.UngetChar(c);
}
Waswhite = true; /* to swallow leading whitespace */
}
else
{
Waswhite = false;
}
State = LEX_CONTENT;
if (Token.Tag == null)
{
Report.Error(this, null, Token, Report.UNKNOWN_ELEMENT);
}
else if (!Options.XmlTags)
{
Versions &= Token.Tag.Versions;
if ((Token.Tag.Versions & HtmlVersion.Proprietary) != 0)
{
if (!Options.MakeClean &&
(Token.Tag == Options.TagTable.TagNobr || Token.Tag == Options.TagTable.TagWbr))
{
Report.Warning(this, null, Token, Report.PROPRIETARY_ELEMENT);
}
}
if (Token.Tag.CheckAttribs != null)
{
Token.CheckUniqueAttributes(this);
Token.Tag.CheckAttribs.Check(this, Token);
}
else
{
Token.CheckAttributes(this);
}
}
return Token; /* return start tag */
case LEX_COMMENT:
if (c != '-')
{
continue;
}
c = Input.ReadChar();
AddCharToLexer(c);
if (c != '-')
{
continue;
}
while (true)
{
c = Input.ReadChar();
if (c == '>')
{
if (badcomment != 0)
{
Report.Warning(this, null, null, Report.MALFORMED_COMMENT);
}