You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2002/03/12 06:39:27 UTC

cvs commit: xml-xalan/c/src/XPath XalanQNameByValue.cpp XalanQNameByValue.hpp

dbertoni    02/03/11 21:39:27

  Modified:    c/src/XPath XalanQNameByValue.cpp XalanQNameByValue.hpp
  Log:
  Added option to use the default namespace.
  
  Revision  Changes    Path
  1.5       +19 -5     xml-xalan/c/src/XPath/XalanQNameByValue.cpp
  
  Index: XalanQNameByValue.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XalanQNameByValue.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanQNameByValue.cpp	19 Dec 2001 22:02:02 -0000	1.4
  +++ XalanQNameByValue.cpp	12 Mar 2002 05:39:27 -0000	1.5
  @@ -114,11 +114,12 @@
   XalanQNameByValue::XalanQNameByValue(
   			const XalanDOMString&		qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator) :
  +			const Locator*				locator,
  +			bool						fUseDefault) :
   	m_namespace(),
   	m_localpart()
   {
  -	initialize(c_wstr(qname), namespaces, locator);
  +	initialize(c_wstr(qname), namespaces, locator, fUseDefault);
   }
   
   
  @@ -126,13 +127,14 @@
   XalanQNameByValue::XalanQNameByValue(
   			const XalanDOMChar*			qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator) :
  +			const Locator*				locator,
  +			bool						fUseDefault) :
   	m_namespace(),
   	m_localpart()
   {
   	assert(qname != 0);
   
  -	initialize(qname, namespaces, locator);
  +	initialize(qname, namespaces, locator, fUseDefault);
   }
   
   
  @@ -209,7 +211,8 @@
   XalanQNameByValue::initialize(
   			const XalanDOMChar*			qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator)
  +			const Locator*				locator,
  +			bool						fUseDefault)
   {
   	const XalanDOMString::size_type		indexOfNSSep = indexOf(qname, XalanUnicode::charColon);
   
  @@ -240,6 +243,17 @@
   	}
   	else
   	{
  +		if (fUseDefault == true)
  +		{
  +			const XalanDOMString* const		theNamespace = 
  +					getNamespaceForPrefix(namespaces, s_emptyString);
  +
  +			if(theNamespace != 0 && 0 != length(*theNamespace))
  +			{
  +				m_namespace = *theNamespace;
  +			}
  +		}
  +
   		m_localpart = qname;
   	}
   }
  
  
  
  1.5       +20 -11    xml-xalan/c/src/XPath/XalanQNameByValue.hpp
  
  Index: XalanQNameByValue.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XalanQNameByValue.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanQNameByValue.hpp	19 Dec 2001 22:02:02 -0000	1.4
  +++ XalanQNameByValue.hpp	12 Mar 2002 05:39:27 -0000	1.5
  @@ -113,34 +113,41 @@
   	 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
   	 * namespace vector stack. The default namespace is not resolved.
   	 *
  -	 * @param qname      XalanQName string
  -	 * @param namespaces namespace vector stack to use
  +	 * @param qname       QName string
  +	 * @param namespaces  namespace vector stack to use
  +	 * @param locator     The Locator instance for error reporting, if any
  +	 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
   	 */
   	XalanQNameByValue(
   			const XalanDOMString&		qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator = 0);
  +			const Locator*				locator = 0,
  +			bool						fUseDefault = false);
   
   	/**
   	 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
   	 * namespace vector stack. The default namespace is not resolved.
   	 *
  -	 * @param qname      XalanQName string
  -	 * @param namespaces namespace vector stack to use
  +	 * @param qname       QName string
  +	 * @param namespaces  namespace vector stack to use
  +	 * @param locator     The Locator instance for error reporting, if any
  +	 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
   	 */
   	XalanQNameByValue(
   			const XalanDOMChar*			qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator = 0);
  +			const Locator*				locator = 0,
  +			bool						fUseDefault = false);
   
   	/**
   	 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
   	 * namespace context. The default namespace is not resolved.
   	 *
  -	 * @param qname XalanQName string
  +	 * @param qname            QName string
   	 * @param namespaceContext context object for namespace resolution
  -	 * @param envSupport XPathEnvSupport class instance
  -	 * @param domSupport DOMSupport class instance
  +	 * @param envSupport       XPathEnvSupport class instance
  +	 * @param domSupport       DOMSupport class instance
  +	 * @param locator          The Locator instance for error reporting, if any
   	 */
   	XalanQNameByValue(
   			const XalanDOMString&	qname,
  @@ -153,8 +160,9 @@
   	 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
   	 * prefix resolver. The default namespace is not resolved.
   	 *
  -	 * @param qname XalanQName string
  +	 * @param qname       QName string
   	 * @param theResolver prefix resolver to use
  +	 * @param locator     The Locator instance for error reporting, if any
   	 */
   	XalanQNameByValue(
   			const XalanDOMString&	qname,
  @@ -218,7 +226,8 @@
   	initialize(
   			const XalanDOMChar*			qname,
   			const NamespacesStackType&	namespaces,
  -			const Locator*				locator);
  +			const Locator*				locator,
  +			bool						fUseDefault);
   
   	void
   	resolvePrefix(
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org