You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by kr...@workgroup.com on 2002/11/11 17:03:27 UTC

Problem with running Xalan on Solaris 5.8 in C++.

> Recently I took over a project that uses the xerces and xalan libraries.
> 
> The code that is causing the problem works beautifully on windows, but on
> sun we are receiving the 
> following error.
> 
> XSLT warning: Fatal Error at (file , line 0, column 0): An exception
> occurred! Type:MalformedURLException, Message:The URL used an unsupported
> protocol (, line -1, column -1)
> 
> I'm thinking this is a build problem, since this works on windows.  Since
> I'm new to xerces and xalan, it is a guess.
> 
> The following is the code to create the HTML page.
> 
> #ifdef XALAN_OLD_STREAMS
>     MSG_CODE GenerateHTML(ostream &strHTML)
> #else
>     MSG_CODE GenerateHTML(std::ostream &strHTML)
> #endif
>     {
>         MSG_CODE status = SUCCESS;
>         int transformResult = 0;
>         ResourceInfo *rsrc_info = sessionGetResourceInfo( m_pSession );
> 
>         // Call the static initializer for Xerces.
>         XMLPlatformUtils::Initialize();
> 
>         // Initialize Xalan.
>         XalanTransformer::initialize();
> 
>         // Create a XalanTransformer.
>         XalanTransformer theXalanTransformer;
> 
>         DOM_Document xmlDoc = DOM_Document::createDocument();
> 
>         status = GenerateXML(xmlDoc);
>         if (status != SUCCESS)
>             return status;
> 
>         XercesDOMSupport   theDOMSupport;
>         XercesParserLiaison theParserLiaison(theDOMSupport);
> 
>         if (m_strXSLServer == "") {
>             char *temp_path = resourceLookupName(rsrc_info,(char
> *)"site.admin.xslpath");
>             if (temp_path == NULL)
>                 m_strXSLServer = "http://localhost/PCXML/";
>             else
>                 m_strXSLServer = temp_path;
>         }
> 
>         string xsl_fullPath = m_strXSLServer +
> PCTReportGetXSLName(m_pReport);
> 
>         if (m_strHTMLServer == "") {
>             char *temp_path = resourceLookupName(rsrc_info,(char
> *)"site.admin.htmlpath");
>             if (temp_path == NULL)
>                 m_strHTMLServer = "'http://localhost/'";
>             else {
>                 char tempString[4000];
>                 strcpy(tempString, "'");
>                 strcat(tempString, temp_path);
>                 strcat(tempString, "'");
>                 m_strHTMLServer = tempString;
>             }
>         }
>         // make sure the HTML server path is quoted
>         else if (strstr(m_strHTMLServer.c_str(),"'") == NULL) {
>             m_strHTMLServer = "'" + m_strHTMLServer + "'";
>         }
> 
>  
> theXalanTransformer.setStylesheetParam("PCTR_html_path",m_strHTMLServer.c_
> str());
> 
> 
>         XSLTInputSource xslDoc(xsl_fullPath.c_str());
> 
>         const XercesDOMWrapperParsedSource parsedSource(
>                                        xmlDoc,
>                                        theParserLiaison,
>                                        theDOMSupport,
>                                        XalanDOMString("test.xml"));
> 
>         transformResult =
> theXalanTransformer.transform(parsedSource,xslDoc,strHTML);
> 
>         // Terminate Xalan.
>         XalanTransformer::terminate();
> 
>         // Call the static terminator for Xerces.
>         XMLPlatformUtils::Terminate();
> 
>         if (transformResult != 0)
>         {
>             char sErr[2048];    //debuging
>             strcpy( sErr, "GenerateActionXMLFile Error: \n");
>             strcat( sErr, theXalanTransformer.getLastError());
> 
>             printf("%s\n", sErr );
> 
>             return (PCTR_REPORT_GENERALERR);
>         }
> 
>         return status;
>     }
> 
> The following is who I am building the app.
> 
> The object file compilation statement.
> 
> /opt/SUNWspro/bin/CC -mt -Dsun4 -I/pctr1/apl/include  -c -I../../itk
> -I../../PCXMLBlackBox -I../../../include -I. -I../../../../src/api
> -I../../../../../../../3pty/xerces-1.6.0/include
> -I../../../../../../../3pty/Xalan/include -DOS_UNIX -Dsun4 -g -o
> .obj/sun4_5/wtcReport.o wtcReport.cxx
> 
> Added to a library with
> 
> /opt/SUNWspro/bin/CC -mt -xar -o /pctr1/apl/lib/sun4_5/wtcapi.a
> .obj/sun4_5/wtcReport.o
> 
> And finally linked into the executible
> 
> /opt/SUNWspro/bin/CC -mt -lm -lc /usr/ucblib/libucb.a  -o .obj/sun4_5/test
> ..obj/sun4_5/testMain.o .obj/sun4_5/testReport.o
> /pctr1/apl/lib/sun4_5/wtcapi.a
> /3pty/xerces-1.6.0/lib/sun4/libxerces-c1_6_0.a
> /3pty/Xalan/sun4/libxalan-c1_3.a
> /3pty/xerces-1.6.0/lib/sun4/libxerces-c1_6_0.a
> /opt/SUNWspro/WS6U1/lib/libCrun.a /opt/SUNWspro/WS6U1/lib/libCstd.a
> -Bdynamic /usr/ccs/lib/libgen.a /usr/ccs/lib/liby.a /usr/ucblib/libucb.a
> -lsocket -lnsl -lintl -ldl -lm
> 
> Any help would be appreciated.
> 
> Kevin
> 
>