Пример #1
0
void
ASTBase::checkPrefix(XMLInputStream &stream, const std::string& reqd_prefix, 
                     const XMLToken& element)
{
  if (!reqd_prefix.empty())
  {
    std::string prefix = element.getPrefix();
    if (prefix != reqd_prefix)
    {
      const string message = "Element <" + element.getName() 
        + "> should have prefix \"" + reqd_prefix + "\".";

      logError(stream, element, InvalidMathElement, message);
      
    }
  }
}
Пример #2
0
/*
 * Copy constructor; creates a copy of this XMLToken.
 */
XMLToken::XMLToken(const XMLToken& orig)
 : mTriple()
 , mAttributes()
 , mNamespaces()
 , mChars (orig.mChars)
 , mIsStart (orig.mIsStart)
 , mIsEnd (orig.mIsEnd)
 , mIsText (orig.mIsText)
 , mLine (orig.mLine)
 , mColumn (orig.mColumn)
{
  if (!orig.mTriple.isEmpty())
    mTriple = XMLTriple(orig.getName(), orig.getURI(), orig.getPrefix());
  
  if (!orig.mAttributes.isEmpty())
    mAttributes = XMLAttributes(orig.getAttributes());
  
  if (!orig.mNamespaces.isEmpty())
    mNamespaces = XMLNamespaces(orig.getNamespaces());

}