Пример #1
0
int FarXMLScanner::ParseEntity()
{
  FarString entityName;
  while (1)
  {
    char c = NextChar();
    if (c == ';')
      break;
    entityName += c;
  }
  if (entityName.IsEmpty())
  {
    ReportError ("entity name");
    return -1;
  }
  if (entityName [0] == '#')
    return DecodeEntity (entityName);
  if (entityName == "quot")
    return '\"';
  if (entityName == "apos")
    return '\'';
  if (entityName == "gt")
    return '<';
  if (entityName == "lt")
    return '>';
  if (entityName == "amp")
    return '&';
  ReportError ("known entity name");
  return -1;
}
Пример #2
0
//*****************************************************************************
//* Function Name: DecodeChildEntity
//*   Description: Decode a child entity object. Obtain the child entity's
//*                metadata and then make a recursive call to DecodeEntity().
//*****************************************************************************
void CEntityDecoder::DecodeChildEntity (
	const _bstr_t&		p_sbstrXML,
	IEntityMetadata*	p_pChildEntity)
{
	if (p_pChildEntity) {

		std::vector<CPropertyDescriptor>			l_vPropertyDescriptorTable;
		std::vector<CPropertyArrayDescriptor>		l_vPropertyArrayDescriptorTable;
		std::vector<CChildEntityDescriptor>			l_vChildEntityDescriptorTable;
		std::vector<CChildEntityArrayDescriptor>	l_vChildEntityArrayDescriptorTable;

		p_pChildEntity->GetPropertyDescriptorTable			(l_vPropertyDescriptorTable);
		p_pChildEntity->GetPropertyArrayDescriptorTable		(l_vPropertyArrayDescriptorTable);
		p_pChildEntity->GetChildEntityDescriptorTable		(l_vChildEntityDescriptorTable);
		p_pChildEntity->GetChildEntityArrayDescriptorTable	(l_vChildEntityArrayDescriptorTable);

		DecodeEntity (
			p_sbstrXML, 
			l_vPropertyDescriptorTable,
			l_vPropertyArrayDescriptorTable,
			l_vChildEntityDescriptorTable,
			l_vChildEntityArrayDescriptorTable);
	}
}