Thanks for the Reply Dave,
I got the problem. I was trying to pass istream with default namespace.
Now, I changed it and it works fine.
using namespace std;
//Result Target.
XalnDOMString asTransformedOutput;
DOMStringPrintWriter aDOMStrPrintWriter(asTransformedOutput);
XSLTResultTarget theResultTarget(&aDOMStrPrintWriter);
//InputParsed Source.
std::istringstream is(a_sXMLStr);
XSLTInputSource theInputSource (&is);
// Do the transform.
int theResult = theXalanTransformer.transform(theInputSource,
m_pCompiledStylesheet, theResultTarget);
std::cout << "theResult :" << theResult << endl;
This code works. I have a question here.
Will Xalan Code flushes the instream after using it or do I need to do that.
The reason for asking this is if I use istringstream 100 threads are
failing.
(but fine with 75 threads).
But going through fine with XSLTInputSource("birds.xml").
Another question I have is I have to convert output XalnDOMString to
char*
The code which previously worked for me is not working now.
aOutputStream << a_srXalanDOMString;
Please let me know.
Thanks,
Raj..
> -----Original Message-----
> From: David N Bertoni/CAM/Lotus [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: RE: XSLTInputSource with Xalan1.3
>
>
> If the compiler says it cannot construct an XSLTInputSource with an
> istrstream, then you should never get it to stop complaining by casting it
> to something else. If you do that, it's not surprising that the
> executable
> is dumping core.
>
> Get rid of the STLport include. VisualAge C++ 5.0 include its own
> implementation of the standard library, so you no longer need the STLport.
> This is documented. The compiler's library puts everything into the std
> namespace, while the STLport version is not in the same namespace, so
> that's probably why the compiler won't accept the STLport's iststream.
> And
> even if it did, the program could never run correctly.
>
> Dave
>
>
>
>
>
> "Avula, Raj"
>
> <RAvula@firstam. To:
> "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>
> com> cc:
>
> Subject: RE:
> XSLTInputSource with Xalan1.3
> 02/12/2002 08:19
>
> PM
>
> Please respond
>
> to xalan-dev
>
>
>
>
>
>
>
>
>
>
> This is the xlC command, I am using to compile the code.
>
> xlC_r -qnotempinc -qthreaded -I/stlport -I$XML_PATH/xml-xerces/c/include
> -I$XML_PATH/xml-xalan/c/src -DAIXV3 -DAIX_BITS32 -
> DPTHREADS -DAIXV4 -DMITRACE_OFF -DIT_HAS_DISTINCT_LONG_DOUBLE
> -DIT_COMPILER_HAS_LONG_LONG -D_PROTOTYPES -D_REENTRANT -D_H_LO
> CALEDEF -DUSEMEMCPY -DTHREAD -D_THREAD_SAFE -DOS_SYSV=2 -DOS_AIX
> -DOS_AIX_4_2 -fsigned-char -mminimal-toc -g -c CTransformImpl.cc -o
> CTransformImpl.o
>
> and to build the exe :
> xlC_r -bnoipath -brtl -L$XML_PATH/xml-xerces/c/lib -lxerces-c1_6_0
> -L$XML_PATH/xml-xalan/c/lib -lxalan-c1_3 -o Transform C
> TestTransform.o CTransformImpl.o
>
>
> > -----Original Message-----
> > From: Avula, Raj
> > Sent: Tuesday, February 12, 2002 8:16 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: XSLTInputSource with Xalan1.3
> >
> > Hi,
> >
> > I have downloaded Xalan1.3C++ for AIX 4.3/xlC5.
> > (I have not build the library).
> > I am getting compilation error while creating XSLTInputSource (for
> > XML).
> > using the following code(becuase XALAN_NO_NAMESPACES was not set):-
> > istrstream is( a_sXMLStr, strlen(a_sXMLStr));
> > XSLTInputSource theInputSource (&is); //ERROR
> > error:An object of type "XSLTInputSource" cannot be constructed from
> > an rvalue of type "istrstream *".
> >
> > But If I use the following code compilation goes through, but
> > transform method is dumping core.
> > istrstream is( a_sXMLStr, strlen(a_sXMLStr));
> > XSLTInputSource theInputSource ((std::istream*)&is);
> >
> > core:
> > arning: could not locate trace table from starting address 0x0
> > ipfx__Q2_3std13basic_istreamXTcTQ2_3std11char_traitsXTc__Fb() at
> > 0xda2d23ec
> > get__Q2_3std13basic_istreamXTcTQ2_3std11char_traitsXTc__Fv() at
> > 0xda2d21f0
> > readBytes__17StdBinInputStreamFCPUcCUi() at 0xda2d2164
> > refreshRawBuffer__9XMLReaderFv() at 0xd9f545bc
> >
> >
> __ct__9XMLReaderFCPCUsCPCUsCP14BinInputStreamCQ2_9XMLReader7RefFromCQ2_9XM
> > LR
> > eader5TypesCQ2_9XMLReader7SourcesCb() at 0xd9f54438
> >
> >
> createReader__9ReaderMgrFRC11InputSourceCbCQ2_9XMLReader7RefFromCQ2_9XMLRe
> > ad
> > er5TypesCQ2_9XMLReader7Sources() at 0xd9f321c0
> > scanReset__10XMLScannerFRC11InputSource() at 0xd9ffda9c
> > scanDocument__10XMLScannerFRC11InputSourceCb() at 0xd9f8f198
> > parse__17SAX2XMLReaderImplFRC11InputSource() at 0xda03d844
> >
> >
> parseXMLStream__28XalanSourceTreeParserLiaisonFRC11InputSourceRC14XalanDOM
> > St
> > ring() at 0xda476c04
> >
> >
> __ct__24XalanDefaultParsedSourceFRC15XSLTInputSourcebP12ErrorHandlerP14Ent
> > it
> > yResolver() at 0xda525f44
> >
> >
> parseSource__16XalanTransformerFRC15XSLTInputSourceRPC17XalanParsedSourceb
> > ()
> > at 0xda51a6e0
> >
> >
> transform__16XalanTransformerFRC15XSLTInputSourcePC23XalanCompiledStyleshe
> > et
> > RC16XSLTResultTarget() at 0xda51a4ac
> > unnamed block $b6, line 71 in "CTransformImpl.cc"
> > unnamed block $b5, line 71 in "CTransformImpl.cc"
> > CTransformImpl::transformImpl(const char*)(this = warning: Unable to
> > access address 0x218 from core
> > 0xffffffff, a_sXMLStr = warning: Unable to access address 0x21c from
> > core
> > warning: Unable to access address 0xffffffff from core
> > (invalid char ptr (0xffffffff))), line 71 in "CTransformImpl.cc"
> > theThread(void*)(iThCount = (nil)), line 19 in "CTestTransform.cc"
> > pthread._pthread_body(??) at 0xd00080c8
> >
> >
> > But If I use
> > XSLTInputSource theInputSource ("birds.xml");
> >
> > transformation goes through fine.
> >
> > Please let me know where I am doing wrong.
> >
> > Thanks,
> > Raj..
> >
> >
> >
> >
> >
> > "MMS <firstam.com>" made the following
> > annotations on 02/12/02 20:17:04
> >
> --------------------------------------------------------------------------
> > ----
> > "THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED
> > SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN
> > CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE
> > ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS
> > MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE
> > THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE THIS
> > MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
> > THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."
> >
> >
> ==========================================================================
> > ====
> >
>
> "MMS <firstam.com>" made the following
> annotations on 02/12/02 20:20:51
> --------------------------------------------------------------------------
> ----
>
> "THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED
> SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN
> CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE
> ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS
> MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE
> THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE THIS
> MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
> THIS
> MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."
>
> ==========================================================================
> ====
>
>
>
>
>
"MMS <firstam.com>" made the following
annotations on 02/13/02 11:41:43
------------------------------------------------------------------------------
"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR THE
USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR
PRIVILEGED INFORMATION. IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS MESSAGE (OR
RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE,
DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE
THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS
MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."
==============================================================================