You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Qian XIA <xq...@ysb.nsd.co.jp> on 2001/01/07 14:12:34 UTC
Re: XMLString::transcode
Hi, happy new year to all. This mailing list has helped me a lot in the passing year.
For XMLString::transcode,I want to ask a similar question here:
When using XMLTranscoder::transcodeTo():
virtual unsigned int transcodeTo
(
const XMLCh* const srcData
, const unsigned int srcCount
, XMLByte* const toFill
, const unsigned int maxBytes
, unsigned int& charsEaten
, const UnRepOpts options
) = 0;
If I want to add a NULL to the end of the transfered buffer(I think it should be "toFill"), how can I get the number of the transfered bytes? Is it srcCount - charsEaten ?
Thanks a lot,
Qian XIA
----- Original Message -----
From: "Dean Roddey" <dr...@charmedquark.com>
To: <xe...@xml.apache.org>
Sent: Saturday, December 30, 2000 4:54 AM
Subject: Re: XMLString::transcode
> > Thanks for the answer. Was my assumption correct? That Xerces 1.1 outputs
> > UTF8 if you do the ucnv_setDefaultName("utf8"); call?
> >
>
> I dunno. That's an ICU thing. We never intended for this to be done. The
> reason being that the transcode() calls are intended to deal with basic
> "quoted strings" in the source code. I.e. they are to get strings into and
> out of the parser in a way that you can use in your local code. Doing the
> above would make that not always work.
>
> > Now I'm using the transcodeTo of the XMLTranscoder class, which I got via
> > XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF8", resCode,
> > transcoderBlockSize);
> >
>
> The first one of course is the name of the encoidng. The second one returns
> an error code if the creation of the new transcoder fails. The last one
> tells it the maximum number of bytes you'll ever ask it to transcode to
> Unicode at once. This lets it do optimized buffer creation. Generally you'd
> want to set it to something reasonable like 4K or 8K and pass in your text
> in chunks of that size, though you can make it larger if you have the memory
> to spare.
>
> --------------------------
> Dean Roddey
> The CIDLib C++ Frameworks
> Charmed Quark Software
> droddey@charmedquark.com
> http://www.charmedquark.com
>
> "It takes two buttocks to make friction"
> - African Proverb
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
Re: XMLString::transcode
Posted by Dean Roddey <dr...@charmedquark.com>.
charsEaten is the number of input characters eaten by this transcode
operation, which may be less than the max asked for. The number of output
bytes written is the return value of the method. So the return is the count
of bytes output, which means its the also the offset at which you would
terminate it.
--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"It takes two buttocks to make friction"
- African Proverb
----- Original Message -----
From: "Qian XIA" <xq...@ysb.nsd.co.jp>
To: <xe...@xml.apache.org>
Sent: Sunday, January 07, 2001 5:12 AM
Subject: Re: XMLString::transcode
> Hi, happy new year to all. This mailing list has helped me a lot in the
passing year.
>
> For XMLString::transcode,I want to ask a similar question here:
> When using XMLTranscoder::transcodeTo():
> virtual unsigned int transcodeTo
> (
> const XMLCh* const srcData
> , const unsigned int srcCount
> , XMLByte* const toFill
> , const unsigned int maxBytes
> , unsigned int& charsEaten
> , const UnRepOpts options
> ) = 0;
> If I want to add a NULL to the end of the transfered buffer(I think it
should be "toFill"), how can I get the number of the transfered bytes? Is it
srcCount - charsEaten ?
>
> Thanks a lot,
>
> Qian XIA
> ----- Original Message -----
> From: "Dean Roddey" <dr...@charmedquark.com>
> To: <xe...@xml.apache.org>
> Sent: Saturday, December 30, 2000 4:54 AM
> Subject: Re: XMLString::transcode
>
>
> > > Thanks for the answer. Was my assumption correct? That Xerces 1.1
outputs
> > > UTF8 if you do the ucnv_setDefaultName("utf8"); call?
> > >
> >
> > I dunno. That's an ICU thing. We never intended for this to be done. The
> > reason being that the transcode() calls are intended to deal with basic
> > "quoted strings" in the source code. I.e. they are to get strings into
and
> > out of the parser in a way that you can use in your local code. Doing
the
> > above would make that not always work.
> >
> > > Now I'm using the transcodeTo of the XMLTranscoder class, which I got
via
> > > XMLPlatformUtils::fgTransService->makeNewTranscoderFor("UTF8",
resCode,
> > > transcoderBlockSize);
> > >
> >
> > The first one of course is the name of the encoidng. The second one
returns
> > an error code if the creation of the new transcoder fails. The last one
> > tells it the maximum number of bytes you'll ever ask it to transcode to
> > Unicode at once. This lets it do optimized buffer creation. Generally
you'd
> > want to set it to something reasonable like 4K or 8K and pass in your
text
> > in chunks of that size, though you can make it larger if you have the
memory
> > to spare.
> >
> > --------------------------
> > Dean Roddey
> > The CIDLib C++ Frameworks
> > Charmed Quark Software
> > droddey@charmedquark.com
> > http://www.charmedquark.com
> >
> > "It takes two buttocks to make friction"
> > - African Proverb
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> >
>
RE: Solaris and g++
Posted by Henrik Wendt <hw...@premitech.com>.
Hi - I also got it working now, using solaris 8 and gcc 2.95.2.
-----Original Message-----
From: Paul Duffy [mailto:paduffy@cisco.com]
Sent: 12. januar 2001 17:06
To: xerces-c-dev@xml.apache.org
Subject: Re: Solaris and g++
I had to use GCC 2.95.2 to successfully build Xerces 1.3 on Solaris 2.6.
This also required Binutils 2.10.
Cheers,
At 09:06 AM 1/12/01 +0800, you wrote:
>Hello,
>
>I have been subscribing from the XercesC mailing list since last year.
>But not until yesterday, I started using XercesC in solaris. I've been
>looking at the mailing list for pipol who have tried it in Solaris.
>
>I would like to ask help from you. Hope you'll have some time.
>
>I seem to have problems in compiling. It must be the libraries that I used.
>
>I believe you have tried this already.
>
>this is how my Makefile looks like:
>
>##################################
>## S T A R T M A K E F I L E ##
>
>##################################
>
>TARGET = sample
>SRCDIR = .
>CCX = g++ -g -O -fpic
>
>XERCES_DIR = /opt/xerces-c_1_2_0-SolCC
>ROGUEWAVE_DIR = /opt/rw/workspaces/SOLARIS26/SUNPRO42/12s
>
>INCLUDE
>= -I$(SRCDIR) -I$(XERCES_DIR)/include -I$(ROGUEWAVE_DIR)/rw -L/usr/local/li
b
> -L$(XERCES_DIR)/lib -L$(ROGUEWAVE_DIR)/lib
>LIBS = -lxerces-c1_2 ---------> problem occurs in this library
>OBJS = \
> main.o
>
>$(TARGET): $(OBJS)
> $(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
>
>all: $(OBJS)
> $(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
>
>clean:
> rm -f $(OBJS) core sample
>
>%.o: %.cpp
> $(CCX) $(INCLUDE) -c $(<)
>
>sample : main.o
>main.o: main.cpp
>
>##############################
>## E N D M A K E F I L E ##
>
>##############################
>
>I have already set the needed environment variables...
>
>My sample program that I used is just simple:
>#include <iostream.h>
>#include <string.h>
>#include <stdlib.h>
>#include <dom/DOM.hpp>
>
>int main()
>{
>
>// DOM_Node aNode;
>// DOM_Text someText;
>
> cout << "\nHello World... Xerces is now running. \n\n";
>}
>
>
>
>
> > Hi - I had no problem building with gcc 2.95.2 under SPARC Solaris 7 or
8.
> > If I recall correctly, I didn't have to do anything special; just
followed
> > the directions. I used a custom build of GCC with threads enabled and
use
> > of GNU linker/assembler disabled.
> >
> > Jim
> >
> > Henrik Wendt's bits of Sun, 7 Jan 2001 translated to:
> >
> > >Hi
> > >
> > >Has anyone had any succes compiling xerces on solaris using g++?
> > >
> > >BR
> > >
> > >Henrik Wendt
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
*********************************************************
Paul B Duffy paduffy@cisco.com
Cisco Systems, Inc.
********************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Solaris and g++
Posted by Paul Duffy <pa...@cisco.com>.
I had to use GCC 2.95.2 to successfully build Xerces 1.3 on Solaris 2.6.
This also required Binutils 2.10.
Cheers,
At 09:06 AM 1/12/01 +0800, you wrote:
>Hello,
>
>I have been subscribing from the XercesC mailing list since last year.
>But not until yesterday, I started using XercesC in solaris. I've been
>looking at the mailing list for pipol who have tried it in Solaris.
>
>I would like to ask help from you. Hope you'll have some time.
>
>I seem to have problems in compiling. It must be the libraries that I used.
>
>I believe you have tried this already.
>
>this is how my Makefile looks like:
>
>##################################
>## S T A R T M A K E F I L E ##
>
>##################################
>
>TARGET = sample
>SRCDIR = .
>CCX = g++ -g -O -fpic
>
>XERCES_DIR = /opt/xerces-c_1_2_0-SolCC
>ROGUEWAVE_DIR = /opt/rw/workspaces/SOLARIS26/SUNPRO42/12s
>
>INCLUDE
>= -I$(SRCDIR) -I$(XERCES_DIR)/include -I$(ROGUEWAVE_DIR)/rw -L/usr/local/lib
> -L$(XERCES_DIR)/lib -L$(ROGUEWAVE_DIR)/lib
>LIBS = -lxerces-c1_2 ---------> problem occurs in this library
>OBJS = \
> main.o
>
>$(TARGET): $(OBJS)
> $(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
>
>all: $(OBJS)
> $(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
>
>clean:
> rm -f $(OBJS) core sample
>
>%.o: %.cpp
> $(CCX) $(INCLUDE) -c $(<)
>
>sample : main.o
>main.o: main.cpp
>
>##############################
>## E N D M A K E F I L E ##
>
>##############################
>
>I have already set the needed environment variables...
>
>My sample program that I used is just simple:
>#include <iostream.h>
>#include <string.h>
>#include <stdlib.h>
>#include <dom/DOM.hpp>
>
>int main()
>{
>
>// DOM_Node aNode;
>// DOM_Text someText;
>
> cout << "\nHello World... Xerces is now running. \n\n";
>}
>
>
>
>
> > Hi - I had no problem building with gcc 2.95.2 under SPARC Solaris 7 or 8.
> > If I recall correctly, I didn't have to do anything special; just followed
> > the directions. I used a custom build of GCC with threads enabled and use
> > of GNU linker/assembler disabled.
> >
> > Jim
> >
> > Henrik Wendt's bits of Sun, 7 Jan 2001 translated to:
> >
> > >Hi
> > >
> > >Has anyone had any succes compiling xerces on solaris using g++?
> > >
> > >BR
> > >
> > >Henrik Wendt
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
*********************************************************
Paul B Duffy paduffy@cisco.com
Cisco Systems, Inc.
********************************************************
Re: Solaris and g++
Posted by "Ryan B. Roleda" <ry...@ntsp.nec.co.jp>.
Hello,
I have been subscribing from the XercesC mailing list since last year.
But not until yesterday, I started using XercesC in solaris. I've been
looking at the mailing list for pipol who have tried it in Solaris.
I would like to ask help from you. Hope you'll have some time.
I seem to have problems in compiling. It must be the libraries that I used.
I believe you have tried this already.
this is how my Makefile looks like:
##################################
## S T A R T M A K E F I L E ##
##################################
TARGET = sample
SRCDIR = .
CCX = g++ -g -O -fpic
XERCES_DIR = /opt/xerces-c_1_2_0-SolCC
ROGUEWAVE_DIR = /opt/rw/workspaces/SOLARIS26/SUNPRO42/12s
INCLUDE
= -I$(SRCDIR) -I$(XERCES_DIR)/include -I$(ROGUEWAVE_DIR)/rw -L/usr/local/lib
-L$(XERCES_DIR)/lib -L$(ROGUEWAVE_DIR)/lib
LIBS = -lxerces-c1_2 ---------> problem occurs in this library
OBJS = \
main.o
$(TARGET): $(OBJS)
$(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
all: $(OBJS)
$(CCX) $(INCLUDE) $(OBJS) -o $(TARGET) $(LIBS)
clean:
rm -f $(OBJS) core sample
%.o: %.cpp
$(CCX) $(INCLUDE) -c $(<)
sample : main.o
main.o: main.cpp
##############################
## E N D M A K E F I L E ##
##############################
I have already set the needed environment variables...
My sample program that I used is just simple:
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <dom/DOM.hpp>
int main()
{
// DOM_Node aNode;
// DOM_Text someText;
cout << "\nHello World... Xerces is now running. \n\n";
}
> Hi - I had no problem building with gcc 2.95.2 under SPARC Solaris 7 or 8.
> If I recall correctly, I didn't have to do anything special; just followed
> the directions. I used a custom build of GCC with threads enabled and use
> of GNU linker/assembler disabled.
>
> Jim
>
> Henrik Wendt's bits of Sun, 7 Jan 2001 translated to:
>
> >Hi
> >
> >Has anyone had any succes compiling xerces on solaris using g++?
> >
> >BR
> >
> >Henrik Wendt
Re: Solaris and g++
Posted by Jim Cole <jc...@tecomac.com>.
Hi - I had no problem building with gcc 2.95.2 under SPARC Solaris 7 or 8.
If I recall correctly, I didn't have to do anything special; just followed
the directions. I used a custom build of GCC with threads enabled and use
of GNU linker/assembler disabled.
Jim
Henrik Wendt's bits of Sun, 7 Jan 2001 translated to:
>Hi
>
>Has anyone had any succes compiling xerces on solaris using g++?
>
>BR
>
>Henrik Wendt
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
Solaris and g++
Posted by Henrik Wendt <hw...@premitech.com>.
Hi
Has anyone had any succes compiling xerces on solaris using g++?
BR
Henrik Wendt