Beispiel #1
0
    ///////////////////////////////////////////////////////////////////////
    //  Function: Transform
    //
    //    Author: $author$
    //      Date: 7/18/2011
    ///////////////////////////////////////////////////////////////////////
    virtual eError Transform
    (const nsXalan::XSLTInputSource &input, 
     const nsXalan::XSLTInputSource &stylesheetInput,
     nsXalan::XSLTResultTarget& result,
     cCharWriterInterface& errorMessage) 
    {
        eError error = e_ERROR_FAILED;

        try
        {
            int err;
            if ((err = transform(input, stylesheetInput, result)))
            {
                c_DB_ERROR("() err = " << err << " on transform()");
                const char* errorString;
                if ((errorString = getLastError()))
                    errorMessage.Write(errorString);
            }
            else
            error = e_ERROR_NONE;
        }
        catch (cXercesException& e)
        {
            c_DB_ERROR("() caught cXercesException");
            e.Write(errorMessage);
        }
        return error;
    }
Beispiel #2
0
    ///////////////////////////////////////////////////////////////////////
    //  Function: Write
    //
    //    Author: $author$
    //      Date: 7/18/2011
    ///////////////////////////////////////////////////////////////////////
    virtual ssize_t Write
    (cCharWriterInterface& writer) const
    {
        ssize_t length = 0;
        ssize_t count = 0;
        const XMLCh* xmlchs;
        XMLCh xmlch;
        char ch[2];

        if ((xmlchs = m_parseException.getMessage()))
        for (ch[1] = 0; (xmlch = xmlchs[length]); length += count)
        {
            nsXerces::XMLString::transcode(&xmlch, ch, 1);
            if (0 > (count = writer.Write(ch, 1)))
                return count;
        }
        return length;
    }