+ if (it == m_phase->within_list.end())
+ {
+ // no active within tag.. see if a attr rule without tag applies
+ it = m_phase->within_list.begin();
+ for (; it != m_phase->within_list.end(); it++)
+ {
+ if (it->attr.length() > 0 && it->tag.length() == 0)
+ break;
+ }
+ }
+ if (it != m_phase->within_list.end())
+ {
+ std::vector<std::string> attr;
+ boost::split(attr, it->attr, boost::is_any_of(","));
+ size_t i;
+ for (i = 0; i < attr.size(); i++)
+ {
+ if (attr[i].compare("#text") && attr[i].compare(tagName) == 0)
+ {
+ subst = true;
+ }
+ }
+ }
+
+ wrbuf_putc(m_w, ' ');
+ wrbuf_puts(m_w, name);
+ wrbuf_puts(m_w, "\"");
+ wrbuf_write(m_w, value, val_len);
+ if (subst)
+ wrbuf_puts(m_w, " SUBST");
+ wrbuf_puts(m_w, "\"");
+}