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 Mark A Russell <ma...@csgsystems.com> on 2001/05/04 22:53:31 UTC

Xerces alias names for the various encodings?

Anyone know what the alias' are that xerces uses for the following?

		UTF16
		UTF8 (This one actually works)
		UCS4
		UCS

Any other utf/ucs I'm not aware of?  At the moment I can't get a transcoder
for any of the above types except the UTF8.

The transcoder that I'm getting I'm pretty sure is a IconvTranscoder as ICU
isn't installed.

Thanks

Mark A Russell
NextGen Software Engineer
CSG Systems, Inc.
E-Mail: mark_russell@csgsystems.com



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


sample program core dump (building xml with the parser)

Posted by Dave Yuill <th...@hotmail.com>.
I am hoping to build outgoing xml using the xerces parser, so it will stick
to the dtd and avoid errors, etc.  Thats the theroy anyway... the example I
have found of how to do this is the CreateDOMDocument sample program, that
comes with the parser.

I just compiled CreateDOMDocument.cpp on an AIX unix machine, however, it
gives me an illegal core dump on the line:

rootElem.appendChild(prodElem);

rootElem and prodElem being of DOM_Element type. its the first call to
appendChild. I have tried variations and cannot get it to go past that
point.

any idea whats going on? i diddnt change any of the sample programs code,
just used a different makefile, for our enviroment, and i have had no
problems with the other samples...

suggestions on how to build my xml in a differnt manner, other than simply
hardcoding it, and inserting the variable values would be just as useful as
help getting this sample to run.

thanks a lot
-dave






---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by Dean Roddey <dr...@charmedquark.com>.
It will try to see if the system id is relative or fully qualified. If its
relative, then its relative to its parent entity. If its parent entity is a
file, then it assumes the new one is a file also (relative to the parent
entity's file.) If the parent is a URL, then its assumes the new one is a
URL relative to the parent entity's URL. So the problem here is that its
thinking that the URL is not fully qualified, so it makes it relative to the
parent file and tries to open it as a file. That's why its not ever calling
any network access stuff. So the problem has got to be in the 'is this URL
relative' checking code. The code for that would be in the URL class in the
utils subdirectory.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"

----- Original Message -----
From: "dave yuill" <th...@hotmail.com>
To: <xe...@xml.apache.org>
Sent: Saturday, May 05, 2001 7:09 AM
Subject: Re: how to use XMLNetAccessor?


> > >  is it safe to say that its not even trying to use my class?
> > >
> > > thanks again, i must be missing somthing setting it up... maybe.. ?
> > >
> >
> > It wouldn't be calling it, because its treating that URL as a relative
> file
> > path. Somehow, the URL code must not be reporting it as a fully
qualified
> > URL. So it tries to make it relative to the parent entity, which is a
> file.
> > So it creates this new, incorrect, file path and tries to open it as a
> file,
> > never calling the netaccessor.
> >
>
> interesting... i wonder, how to get it to call netaccessor?
>
> ...
> #include "FENSNetAccessor.h"
> //    init the xml platform, etc..
> XMLPlatformUtils::fgNetAccessor = new FENSNetAccessor();
> //     attempt to parse XML, but get the fatal error
> ..
>
> http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd, why would it think
> thats not a url...?
>
> it was my understanding it may attempt to open it as a file first, but
then
> it would build the url and use the net accessor
>
> -dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by dave yuill <th...@hotmail.com>.
> >  is it safe to say that its not even trying to use my class?
> >
> > thanks again, i must be missing somthing setting it up... maybe.. ?
> >
>
> It wouldn't be calling it, because its treating that URL as a relative
file
> path. Somehow, the URL code must not be reporting it as a fully qualified
> URL. So it tries to make it relative to the parent entity, which is a
file.
> So it creates this new, incorrect, file path and tries to open it as a
file,
> never calling the netaccessor.
>

interesting... i wonder, how to get it to call netaccessor?

...
#include "FENSNetAccessor.h"
//    init the xml platform, etc..
XMLPlatformUtils::fgNetAccessor = new FENSNetAccessor();
//     attempt to parse XML, but get the fatal error
..

http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd, why would it think
thats not a url...?

it was my understanding it may attempt to open it as a file first, but then
it would build the url and use the net accessor

-dave

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by Dean Roddey <dr...@charmedquark.com>.
> oh yeah, i intended to do that... but its not even running that code, i
had
> compiled a cout line in it to see, and it never showed... so humm?
>
> plus the addition of the ./ had me extremly suspicious... is it safe to
say
> that its not even trying to use my class?
>
> thanks again, i must be missing somthing setting it up... maybe.. ?
>

It wouldn't be calling it, because its treating that URL as a relative file
path. Somehow, the URL code must not be reporting it as a fully qualified
URL. So it tries to make it relative to the parent entity, which is a file.
So it creates this new, incorrect, file path and tries to open it as a file,
never calling the netaccessor.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by dave yuill <th...@hotmail.com>.
----- Original Message -----
From: "Dean Roddey" <dr...@charmedquark.com>
>
> Well, I see two obvious issues...
>
> > Fatal Error at file "XMLtest", line 2, column 89
> >    Message: An exception occured! Type:RuntimeException, Message:Could
not
> > open DTD file './http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd'
> >
>
> It shouldn't have added the ./ to the front of the URL. I'm not sure why
it
> did that. If you give a fully qualified system id, which you did, then it
> should have not tried to make it relative to the parent entity.
>
> > BinInputStream * FENSNetAccessor::makeNew(
> >    const   XMLCh* const urlSource,
> >    XML4CExcepts::Codes&    failReason )
> > {
> >  BinInputStream* temp;
> >  return temp;
> > }
> >
>
> That's obviously not correct. You are just returning some random value
since
> you never temp to point at anything. You have allocate an input stream and
> return it.

oh yeah, i intended to do that... but its not even running that code, i had
compiled a cout line in it to see, and it never showed... so humm?

plus the addition of the ./ had me extremly suspicious... is it safe to say
that its not even trying to use my class?

thanks again, i must be missing somthing setting it up... maybe.. ?

-dave

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by Dean Roddey <dr...@charmedquark.com>.
Well, I see two obvious issues...

> Fatal Error at file "XMLtest", line 2, column 89
>    Message: An exception occured! Type:RuntimeException, Message:Could not
> open DTD file './http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd'
>

It shouldn't have added the ./ to the front of the URL. I'm not sure why it
did that. If you give a fully qualified system id, which you did, then it
should have not tried to make it relative to the parent entity.

> BinInputStream * FENSNetAccessor::makeNew(
>    const   XMLCh* const urlSource,
>    XML4CExcepts::Codes&    failReason )
> {
>  BinInputStream* temp;
>  return temp;
> }
>

That's obviously not correct. You are just returning some random value since
you never temp to point at anything. You have allocate an input stream and
return it.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by dave yuill <th...@hotmail.com>.
thanks, oh if only it did work.. :)

i'm not familliar with system id, but i assume its
http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd, i'll append the xml
i'm trying to parse to see for yourselves...

the error message i get:

Fatal Error at file "XMLtest", line 2, column 89
   Message: An exception occured! Type:RuntimeException, Message:Could not
open DTD file './http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd'

and the xml:

<?xml version="1.0"?>
<!DOCTYPE wctp-Operation SYSTEM
"http://www.pcia.com/wireres/protocol/dtd/wctpV1-0.dtd">
<wctp-Operation
wctpVersion="WCTP-DTD-1.0"
>
            <wctp-SubmitRequest>
                <wctp-SubmitHeader
                    submitTimestamp="2001-03-27T10:20:49"
                >
                    <wctp-Originator
                        senderID="1193693"
                    />
                    <wctp-MessageControl
                        messageID="455178516-1738425345"
                        transactionID="0"
                    />
                    <wctp-Recipient
                        recipientID="142.166.52.66:8080/servlet/WCTPtest"
                    />
                </wctp-SubmitHeader>
                <wctp-Payload>
                    <wctp-Alphanumeric>
F=TT&amp;S=.TTPG.N&amp;T=D&amp;VR=1.0
                    </wctp-Alphanumeric>
                </wctp-Payload>
            </wctp-SubmitRequest>
</wctp-Operation>

and if you really want to see, my derived net accessor, 'MYNetAccessor'
i'm not sure i set it up correctly

#include <util/XMLException.hpp>
#include <util/XMLNetAccessor.hpp>

class FENSNetAccessor : public XMLNetAccessor
{
public:
 // implement it for our enviroment
    BinInputStream* makeNew
    (
        const   XMLCh* const            urlSource
        ,       XML4CExcepts::Codes&    failReason
    );
};

BinInputStream * FENSNetAccessor::makeNew(
   const   XMLCh* const urlSource,
   XML4CExcepts::Codes&    failReason )
{
 BinInputStream* temp;
 return temp;
}

again, thanks a lot
-dave

From: "Dean Roddey" <dr...@charmedquark.com>
>
> That should work. What kind of system id are you giving on the primary XML
> entity and the DTD one?
>
> --------------------------
> Dean Roddey
> The CIDLib C++ Frameworks
> Charmed Quark Software
> droddey@charmedquark.com
> http://www.charmedquark.com
>
> "Why put off until tomorrow what you can
> put off until the day after tomorrow?"
>
> ----- Original Message -----
> From: "dave yuill" <th...@hotmail.com>
> To: <xe...@xml.apache.org>
> Sent: Friday, May 04, 2001 4:55 PM
> Subject: how to use XMLNetAccessor?
>
>
> > greetings.
> >
> > this may be a common question, but i apologize, the archives seem to be
> > down...
> >
> > i was wondering if there were any examples of using the XMLNetAccessor
> > interface to make http connections, for receiving dtd files. i have
> created
> > a class derived from the net accessor class, linked and included it, and
> > after initializing the xml platform, called;
> >
> > XMLPlatformUtils::fgNetAccessor = new MYNetAccessor();
> >
> > however i am still getting a fatal error, unable to locate the dtd in
the
> > local directory, of course.
> >
> > my deep gratitudes to anyone who might be able to point me in any sort
of
> > direction.
> >
> > cheers,
> > -dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by Curt Arnold <ca...@houston.rr.com>.
Double check that your DTD system id isn't using backslashes instead of
forward slashes.  Backslashes are not legal in URL's, but some software will
produce (and others accept it) as legal.


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: how to use XMLNetAccessor?

Posted by Dean Roddey <dr...@charmedquark.com>.
That should work. What kind of system id are you giving on the primary XML
entity and the DTD one?

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"

----- Original Message -----
From: "dave yuill" <th...@hotmail.com>
To: <xe...@xml.apache.org>
Sent: Friday, May 04, 2001 4:55 PM
Subject: how to use XMLNetAccessor?


> greetings.
>
> this may be a common question, but i apologize, the archives seem to be
> down...
>
> i was wondering if there were any examples of using the XMLNetAccessor
> interface to make http connections, for receiving dtd files. i have
created
> a class derived from the net accessor class, linked and included it, and
> after initializing the xml platform, called;
>
> XMLPlatformUtils::fgNetAccessor = new MYNetAccessor();
>
> however i am still getting a fatal error, unable to locate the dtd in the
> local directory, of course.
>
> my deep gratitudes to anyone who might be able to point me in any sort of
> direction.
>
> cheers,
> -dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


how to use XMLNetAccessor?

Posted by dave yuill <th...@hotmail.com>.
greetings.

this may be a common question, but i apologize, the archives seem to be
down...

i was wondering if there were any examples of using the XMLNetAccessor
interface to make http connections, for receiving dtd files. i have created
a class derived from the net accessor class, linked and included it, and
after initializing the xml platform, called;

XMLPlatformUtils::fgNetAccessor = new MYNetAccessor();

however i am still getting a fatal error, unable to locate the dtd in the
local directory, of course.

my deep gratitudes to anyone who might be able to point me in any sort of
direction.

cheers,
-dave

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Xerces alias names for the various encodings?

Posted by Andy Heninger <an...@jtcsv.com>.
see http://xml.apache.org/xerces-c/faq-parse.html#faq-17

UCS4 should have worked.  UTF-16 wants a dash.


Andy Heninger
IBM, Cupertino, CA
heninger@us.ibm.com

----- Original Message -----
From: "Mark A Russell" <ma...@csgsystems.com>
To: "Xerces C++ Mailing List" <xe...@xml.apache.org>
Sent: Friday, May 04, 2001 1:53 PM
Subject: Xerces alias names for the various encodings?


> Anyone know what the alias' are that xerces uses for the following?
>
> UTF16
> UTF8 (This one actually works)
> UCS4
> UCS
>
> Any other utf/ucs I'm not aware of?  At the moment I can't get a
transcoder
> for any of the above types except the UTF8.
>
> The transcoder that I'm getting I'm pretty sure is a IconvTranscoder as
ICU
> isn't installed.
>
> Thanks
>
> Mark A Russell
> NextGen Software Engineer
> CSG Systems, Inc.
> E-Mail: mark_russell@csgsystems.com
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Xerces alias names for the various encodings?

Posted by Dean Roddey <dr...@charmedquark.com>.
All of those are intrinsic encodings and don't depend on the transcoding
service. There are a number of aliases recognized. UTF-8, UTF_8 UTF8,
UTF-16, UTF-16LE, UTF-16BE, UCS-4, UCS4-LE, UCS4-BE, among others.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"

----- Original Message -----
From: "Mark A Russell" <ma...@csgsystems.com>
To: "Xerces C++ Mailing List" <xe...@xml.apache.org>
Sent: Friday, May 04, 2001 1:53 PM
Subject: Xerces alias names for the various encodings?


> Anyone know what the alias' are that xerces uses for the following?
>
> UTF16
> UTF8 (This one actually works)
> UCS4
> UCS
>
> Any other utf/ucs I'm not aware of?  At the moment I can't get a
transcoder
> for any of the above types except the UTF8.
>
> The transcoder that I'm getting I'm pretty sure is a IconvTranscoder as
ICU
> isn't installed.
>
> Thanks
>
> Mark A Russell
> NextGen Software Engineer
> CSG Systems, Inc.
> E-Mail: mark_russell@csgsystems.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org