本文整理汇总了C#中org.NextMeta方法的典型用法代码示例。如果您正苦于以下问题:C# org.NextMeta方法的具体用法?C# org.NextMeta怎么用?C# org.NextMeta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org
的用法示例。
在下文中一共展示了org.NextMeta方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
/// <summary>Scan the content following the named tag, attaching it to the context.</summary>
/// <param name="x">The XMLTokener containing the source string.</param>
/// <param name="context">The JSONObject that will include the new material.</param>
/// <param name="name">The tag name.</param>
/// <returns>true if the close tag is processed.</returns>
/// <exception cref="JSONException"/>
/// <exception cref="org.json.JSONException"/>
private static bool Parse(org.json.XMLTokener x, org.json.JSONObject context, string name)
{
char c;
int i;
org.json.JSONObject jsonobject = null;
string @string;
string tagName;
object token;
// Test for and skip past these forms:
// <!-- ... -->
// <! ... >
// <![ ... ]]>
// <? ... ?>
// Report errors for these forms:
// <>
// <=
// <<
token = x.NextToken();
// <!
if (token == BANG)
{
c = x.Next();
if (c == '-')
{
if (x.Next() == '-')
{
x.SkipPast("-->");
return false;
}
x.Back();
}
else
{
if (c == '[')
{
token = x.NextToken();
if ("CDATA".Equals(token))
{
if (x.Next() == '[')
{
@string = x.NextCDATA();
if (@string.Length > 0)
{
context.Accumulate("content", @string);
}
return false;
}
}
throw x.SyntaxError("Expected 'CDATA['");
}
}
i = 1;
do
{
token = x.NextMeta();
if (token == null)
{
throw x.SyntaxError("Missing '>' after '<!'.");
}
else
{
if (token == LT)
{
i += 1;
}
else
{
if (token == GT)
{
i -= 1;
}
}
}
}
while (i > 0);
return false;
}
else
{
if (token == QUEST)
{
// <?
x.SkipPast("?>");
return false;
}
else
{
if (token == SLASH)
{
// Close tag </
token = x.NextToken();
if (name == null)
{
//.........这里部分代码省略.........
示例2: Copyright
//.........这里部分代码省略.........
if (c == '-')
{
if (x.Next() == '-')
{
x.SkipPast("-->");
}
else
{
x.Back();
}
}
else
{
if (c == '[')
{
token = x.NextToken();
if (token.Equals("CDATA") && x.Next() == '[')
{
if (ja != null)
{
ja.Put(x.NextCDATA());
}
}
else
{
throw x.SyntaxError("Expected 'CDATA['");
}
}
else
{
i = 1;
do
{
token = x.NextMeta();
if (token == null)
{
throw x.SyntaxError("Missing '>' after '<!'.");
}
else
{
if (token == org.json.XML.LT)
{
i += 1;
}
else
{
if (token == org.json.XML.GT)
{
i -= 1;
}
}
}
}
while (i > 0);
}
}
}
else
{
if (token == org.json.XML.QUEST)
{
// <?
x.SkipPast("?>");
}
else
{