本文整理汇总了C++中XMLToken::GetAttributeRange方法的典型用法代码示例。如果您正苦于以下问题:C++ XMLToken::GetAttributeRange方法的具体用法?C++ XMLToken::GetAttributeRange怎么用?C++ XMLToken::GetAttributeRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLToken
的用法示例。
在下文中一共展示了XMLToken::GetAttributeRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
status = parser->StartEntity(xmlparser->GetCurrentEntityUrl(), xmlparser->GetDocumentInformation(), xmlparser->GetCurrentEntityDepth() > 1);
entity_signalled = TRUE;
}
current_entity_url = xmlparser->GetCurrentEntityUrl();
current_entity_depth = xmlparser->GetCurrentEntityDepth();
if (token.GetType() != XMLToken::TYPE_ETag)
{
if (OpStatus::IsSuccess(status))
{
BOOL fragment_start = FALSE;
if (!fragment_found)
{
if (!fragment_id)
fragment_start = TRUE;
else
{
XMLToken::Attribute *attributes = token.GetAttributes();
unsigned attributes_count = token.GetAttributesCount();
unsigned fragment_id_length = uni_strlen(fragment_id);
for (unsigned index = 0; index < attributes_count; ++index)
if (attributes[index].GetId())
if (attributes[index].GetValueLength() == fragment_id_length && uni_strncmp(attributes[index].GetValue(), fragment_id, fragment_id_length) == 0)
{
fragment_start = TRUE;
break;
}
}
if (fragment_start)
fragment_found = TRUE;
}
#ifdef XML_ERRORS
token.GetTokenRange(location);
parser->SetLocation(location);
#endif // XML_ERRORS
BOOL ignore_element = FALSE;
status = parser->StartElement(token.GetName(), fragment_start, ignore_element);
if (ignore_element)
{
if (token.GetType() == XMLToken::TYPE_STag)
ignore_element_depth = 1;
}
else
{
XMLToken::Attribute *attributes = token.GetAttributes();
unsigned attributes_count = token.GetAttributesCount();
for (unsigned index = 0; OpStatus::IsSuccess(status) && index < attributes_count; ++index)
{
#ifdef XML_ERRORS
token.GetAttributeRange(location, index);
parser->SetLocation(location);
#endif // XML_ERRORS
XMLToken::Attribute &attribute = attributes[index];
status = parser->AddAttribute(attribute.GetName(), attribute.GetValue(), attribute.GetValueLength(), attribute.GetSpecified(), attribute.GetId());
}
if (OpStatus::IsSuccess(status))
status = parser->StartContent();
}
}
}
if (OpStatus::IsSuccess(status) && token.GetType() != XMLToken::TYPE_STag)
{
#ifdef XML_ERRORS
token.GetTokenRange(location);
parser->SetLocation(location);
#endif // XML_ERRORS
status = parser->EndElement(block, finished);
if (OpStatus::IsSuccess(status) && block)
parser->SetSourceCallback(&sourcecallbackimpl);
}
break;
case XMLToken::TYPE_Finished:
status = parser->EndEntity();
}
}
if (OpStatus::IsSuccess(status))
if (block)
return RESULT_BLOCK;
else
return RESULT_OK;
else if (OpStatus::IsMemoryError(status))
return RESULT_OOM;
else
return RESULT_ERROR;
}