Remove all instance of <, > and & and replace them with <, > and & respectively Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | XmlCleanHtags | (hzChain&,hzChain&,) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
Function body:
void XmlCleanHtags (hzChain& output)hzChain& input,
{
// Category: Text Processing
//
// Remove all instance of <, > and & and replace them with <, > and & respectively
//
// Arguments: 1) output The cleaned output
// 2) input The unclean input
//
// Returns: None
chIter zi ; // Chain iterator
uint32_t ent ; // Entity value (needed by call to AtEntity)
uint32_t entLen ; // Entity value (needed by call to AtEntity)
for (zi = input ; !zi.eof() ; zi++)
{
if (*zi == CHAR_LESS)
output << "<" ;
else if (*zi == CHAR_MORE)
output << ">" ;
else if (*zi == CHAR_AMPSAND)
{
if (AtEntity(ent, entLen, zi))
output.AddByte(*zi) ;
else
output << "&" ;
}
else
output.AddByte(*zi) ;
}
}