Beispiel #1
0
    static const DOMStringType
    XalanDOMStringToXercesDOMString(const XalanDOMString&   theString)
    {
        assert(XercesStringLengthType(theString.length()) == theString.length());

        return DOMStringType(&theString[0], XercesStringLengthType(theString.length()));
    }
Beispiel #2
0
	virtual bool
	isActive(const XalanDOMString&	thePrefix) const
	{
		bool	fActive = false;

		for(unsigned int i = 0; i < m_avtsCount; ++i)
		{
			const AVT* const	avt = m_avts[i];

			const XalanDOMString&	theName = avt->getName();

			const XalanDOMString::size_type		theColonIndex = indexOf(theName, XalanUnicode::charColon);

			if (theColonIndex != length(theName))
			{
				if (thePrefix.length() == theColonIndex &&
					startsWith(theName, thePrefix) == true)
				{
					fActive = true;

					break;
				}
			}
		}

		return fActive;
	}
Beispiel #3
0
	/**
	 * Determine the fully qualified URI for a string.
	 *
	 * @param urlString string to qualify
	 * @return string to fully qualified URI
	 */
	static void
	getURLStringFromString(
			const XalanDOMString&	urlString,
			XalanDOMString&			theNormalizedURI)
	{
		getURLStringFromString(urlString.c_str(), urlString.length(), theNormalizedURI);
	}
Beispiel #4
0
XalanDOMString::XalanDOMString(
            const XalanDOMString&   theSource,
            MemoryManager&      theManager,
            size_type               theStartPosition,
            size_type               theCount) :
    m_data(theManager),
    m_size(0)
{
    if (theSource.length() != 0)
    {
        append(theSource, theStartPosition, theCount);
    }
}
Beispiel #5
0
TranscodeToLocalCodePage(
            const XalanDOMString&   theSourceString,
            CharVectorType&         theTargetVector,
            bool                    terminate,
            char                    theSubstitutionChar)
{
    doTranscodeToLocalCodePage(
        theSourceString.c_str(),
        theSourceString.length(),
        true,
        theTargetVector,
        terminate,
        theSubstitutionChar);
}
Beispiel #6
0
    /**
     * Calls the supplied FormatterListener member function with
     * the string.
     *
     * @param theString The XalanDOMString to convert.
     * @param formatterListener The FormatterListener instance.
     * @param function The FormatterListener member function to call.
     */
    static void
    string(
            const XalanDOMString&   theString,
            FormatterListener&      formatterListener,
            MemberFunctionPtr       function)
    {
        const XalanDOMString::size_type     theLength =
            theString.length();

        if (theLength != 0)
        {
            assert(theLength == static_cast<FormatterListener::size_type>(theLength));

            (formatterListener.*function)(
                theString.c_str(),
                static_cast<FormatterListener::size_type>(theLength));
        }
    }
XObjectPtr
FunctionSample::execute(
            XPathExecutionContext&  executionContext,
            XalanNode*              /* context */,          
            const XObjectPtr        arg1,
            const XObjectPtr        arg2,
            const Locator*          /* locator */) const
{
   assert(arg1.null() == false);
   assert(arg2.null() == false);

   XalanDOMString path;
   arg1->str(path);
   const bool bLinux = arg2->boolean();

   XalanDOMChar dchOld;
   XalanDOMChar dchNew;

   if (bLinux)
   {
      dchOld = '\\';
      dchNew = '/';
   }
   else
   {
      dchOld = '/';
      dchOld = '\\';
   }

    int len = path.length();
   for (int i=0; i<len; i++)
      if (path[i] == dchOld)
         path[i] = dchNew;

    return executionContext.getXObjectFactory().createString(path); 
}
Beispiel #8
0
 void
 write(const XalanDOMString&     theChars)
 {
     write(theChars.c_str(), theChars.length());
 }
Beispiel #9
0
 /**
  * Static conversion function.  Returns the boolean value
  * of the supplied XalanDOMString.
  *
  * @param theString The XalanDOMString to convert.
  * @return bool value
  */
 static bool
 boolean(const XalanDOMString&   theString)
 {
     return theString.length() == 0 ? false : true;
 }