private static void ProcessPlaceholders(XmlDocument xml)
{
var placeholders = FindAllPlaceholders(xml);
foreach (XmlElement phe in placeholders)
{
var attr = phe.GetAttribute(DestAttribute);
var value = attr.Replace("rtl://", "").Trim('/', ' ');
if (phe.HasAttribute(BookMarkElement))
{
value = "#" + phe.GetAttribute(BookMarkElement);
}
value = UrlUtility.UrlDecode(value, Encoding.UTF8);
if (value.Length < 2)
{
throw new SyntaxErrorException();
}
if (value[0] == '#')
{
ProcessDirectiveTag(xml, phe, value);
}
else if (value[0] == '$')
{
ProcessReferenceTag(xml, phe, value);
}
else
{
throw new SyntaxErrorException(attr);
}
}
}