Example #1
0
void XMLFilterImpl::setProperty(const XMLString& propertyId, void* value)
{
	if (_pParent)
		_pParent->setProperty(propertyId, value);
	else
		throw SAXNotRecognizedException(fromXMLString(propertyId));
}
Example #2
0
void* XMLFilterImpl::getProperty(const XMLString& propertyId) const
{
	if (_pParent)
		return _pParent->getProperty(propertyId);
	else
		throw SAXNotRecognizedException(fromXMLString(propertyId));
}
Example #3
0
void XMLFilterImpl::setFeature(const XMLString& featureId, bool state)
{
	if (_pParent)
		_pParent->setFeature(featureId, state);
	else
		throw SAXNotRecognizedException(fromXMLString(featureId));
}
Example #4
0
bool XMLFilterImpl::getFeature(const XMLString& featureId) const
{
	if (_pParent)
		return _pParent->getFeature(featureId);
	else
		throw SAXNotRecognizedException(fromXMLString(featureId));
}
Example #5
0
void DOMSerializer::setProperty(const XMLString& propertyId, const XMLString& value)
{
	if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER || propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
		throw SAXNotSupportedException(std::string("property does not take a string value: ") + fromXMLString(propertyId));
	else
		throw SAXNotRecognizedException(fromXMLString(propertyId));
}
Example #6
0
void DOMSerializer::setProperty(const XMLString& propertyId, void* value)
{
	if (propertyId == XMLReader::PROPERTY_DECLARATION_HANDLER)
		_pDeclHandler = reinterpret_cast<DeclHandler*>(value);
	else if (propertyId == XMLReader::PROPERTY_LEXICAL_HANDLER)
		_pLexicalHandler = reinterpret_cast<LexicalHandler*>(value);
	else throw SAXNotRecognizedException(fromXMLString(propertyId));
}
Example #7
0
bool DOMSerializer::getFeature(const XMLString& featureId) const
{
	if (featureId == XMLReader::FEATURE_NAMESPACES)
		throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACES));
	else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
		throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_NAMESPACE_PREFIXES));
	else
		throw SAXNotRecognizedException(fromXMLString(featureId));
}
Example #8
0
  virtual std::auto_ptr<typename XMLReaderT::PropertyBase> doGetProperty(const string_type& name)
  {
   	if(parent_)
	    return parent_->doGetProperty(name);

    string_type ex = string_adaptor::construct_from_utf8("Property: ");
    string_adaptor::append(ex, name);
    throw SAXNotRecognizedException(string_adaptor::asStdString(ex));
  } // doGetProperty
Example #9
0
  /**
   * Look up the state of a feature.
   *
   * <p>This will always fail if the parent is null.</p>
   *
   * @param name The feature name.
   * @return The current state of the feature.
   * @exception SAXNotRecognizedException When the
   *            XMLReader does not recognize the feature name.
   * @exception SAXNotSupportedException When the
   *            XMLReader recognizes the feature name but 
   *            cannot determine its state at this time.
   * @see XMLReader#getFeature
   */
  virtual bool getFeature(const string_type& name) const
  {
  	if(!parent_)
    {
      string_type ex = string_adaptor::construct_from_utf8("Feature: ");
      string_adaptor::append(ex, name);
      throw SAXNotRecognizedException(string_adaptor::asStdString(ex));
    } // if ...

    return parent_->getFeature(name);
  } // setFeature
Example #10
0
  /**
   * Set the state of a feature.
   *
   * <p>This will always fail if the parent is null.</p>
   *
   * @param name The feature name.
   * @param value The requested feature value.
   * @exception SAXNotRecognizedException When the
   *            XMLReader does not recognize the feature name.
   * @exception SAXNotSupportedException When the
   *            XMLReader recognizes the feature name but 
   *            cannot set the requested value.
   * @see XMLReader#setFeature
   */
  virtual void setFeature(const string_type& name, bool value)
  {
  	if(!parent_)
    {
      string_type ex = string_adaptor::construct_from_utf8("Feature: ");
      string_adaptor::append(ex, name);
      throw SAXNotRecognizedException(string_adaptor::asStdString(ex));
    } // if ...

    parent_->setFeature(name, value);
  } // setFeature
Example #11
0
bool SAXParser::getFeature(const XMLString& featureId) const
{
	if (featureId == XMLReader::FEATURE_VALIDATION || featureId == XMLReader::FEATURE_STRING_INTERNING)
		throw SAXNotSupportedException(fromXMLString(XMLReader::FEATURE_VALIDATION));
	else if (featureId == XMLReader::FEATURE_EXTERNAL_GENERAL_ENTITIES)
		return _engine.getExternalGeneralEntities();
	else if (featureId == XMLReader::FEATURE_EXTERNAL_PARAMETER_ENTITIES)
		return _engine.getExternalParameterEntities();
	else if (featureId == XMLReader::FEATURE_NAMESPACES)
		return _namespaces;
	else if (featureId == XMLReader::FEATURE_NAMESPACE_PREFIXES)
		return _namespacePrefixes;
	else if (featureId == FEATURE_PARTIAL_READS)
		return _engine.getEnablePartialReads();
	else throw SAXNotRecognizedException(fromXMLString(featureId));
}