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 Robert Buck <rb...@mathworks.com> on 2002/05/14 18:07:58 UTC
Xerces C++ Exceptions not Exported
Hi there,
I am wondering if the following classes can be exported by default by the
Xerces API:
SAXNotSupportedException
SAXNotRecognizedException
If so, when could it be done by, and when do you anticipate the next
release of Xerces?
Mind you, I could just change the implementation of Xerces, but I'd rather
not have to go through the related maintenance issues if we have our own
version of Xerces at the MathWorks.
The reason I want these is so that I can create my own custom SAX 2 parsers
and scanners that expose more schema information. The primary problem I am
currently trying to work around, by creating my own parser and scanners is
that namespaces for types associated to an XML Schema import is hidden. I
need to be able to "switch" to the grammar for the imported schema file to
get at all the namespace information. In the end I will basically copy the
existing classes and add public accessor methods for the scanner and
grammar resolvers.
Regards,
Bob
---------------------------------------------------------------------
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 C++ Bug ?? : Getting blank namespace URIs and
prefixes
Posted by Robert Buck <rb...@mathworks.com>.
Some more information on the bug that I am seeing...
For an imported complex type:
(a) the element uri-id is incorrect; the uri-id reported is that of the
top-level schema file namespace not that of the namespace of the imported
schema. No prefixes are listed too.
(b) the complex type info indicates the correct uri-string and type-name in
the format: 'uri-string,type-name'
For an imported simple type:
(a) same as [a] above. The uri-id is incorrect. No prefixes are listed too.
If you want any test cases, or a Visual Studio project that dumps the full
schema information for these, let me know.
Bob
At 01:06 PM 5/15/2002 -0400, Tinny Ng wrote:
>This may be related to bugzilla bug 9104. I can FYI you when a fix is
>available.
>
>Tinny
---------------------------------------------------------------------
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 C++ Bug ?? : Getting blank namespace URIs and prefixes
Posted by Tinny Ng <tn...@ca.ibm.com>.
This may be related to bugzilla bug 9104. I can FYI you when a fix is
available.
Tinny
----- Original Message -----
From: "Robert Buck" <rb...@mathworks.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, May 15, 2002 9:21 AM
Subject: Xerces C++ Bug ?? : Getting blank namespace URIs and prefixes
> Hello,
>
> I am using Xerces 1.7, C++. I have found many cases where namespace
> prefixes are missing, and other cases where namespace uri strings are
> empty. In particular I find that if I take the purchaseOrder example out
of
> the Schema spec, use an import for the IPO schema, all the namespace uris
> for the imported types are empty. I am attaching sample use cases from the
> Schema spec examples.
>
> What I am doing:
>
> I am using the SAX2 parser. Parser is configured to do _full_ schema
> validation, and core namespace prefixes are set to be on.
> Core validation set to true, dynamic set to false (this is
> SAX2XMLReader::Val_Always according to some examples).
>
> Consider for example an attribute whose type is specified in the imported
> schema. I do something like:
>
> unsigned int uriId = attr->getURIId();
> printf("attrURIId: %d\n", uriId);
> const XMLCh* uriStr = sax2Parser->getScanner()->getURIText(uriId);
> StrX attrURIStr(uriStr);
> printf("attrURI: %s\n", attrURIStr.localForm() );
>
> The uri-id is unity (1). I find that in any case where the prefix or
> namespace is incorrectly reported, the uri-id is always unity.
>
> When I dump the first 10 URI strings I get:
>
> URI 0:
> URI 1:
> URI 2: http://apache.org/xml/UknownNS
> URI 3: http://www.w3.org/XML/1998/namespace
> URI 4: http://www.w3.org/2000/xmlns/
> URI 5: http://www.w3.org/2001/XMLSchema-instance
> URI 6: http://www.example.com/Report
> URI 7: http://www.w3.org/2001/XMLSchema
> URI 8: http://www.example.com/IPO
> URI 9:
>
> But many of the elements and attributes are incorrectly mapped to URI 1
> when they ought to have been mapped to URI 8. See "output.txt" in the
> attached zip file. Has anyone else run into similar problems?
>
> As an aside: The above example shows me using a slightly modified sax2
> parser implementation; I modified the Xerces source to expose the scanner
> so I could get the uri-text (as I see no other way to get the textual
> representation apart from doing this). A friend had suggested that I
modify
> both the parser (to expose the scanner) and the scanner (to expose the
> grammar resolver) so that I could get at the necessary information about
> the schema, so that I can dynamically create an object system in C++ to
> represent the data. That is why I am having to modify the parsers,
> scanners, and grammar resolvers. But something curious is happening with
> namespace uris.
>
> Bob
----------------------------------------------------------------------------
----
> ---------------------------------------------------------------------
> 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
Xerces C++ Bug ?? : Getting blank namespace URIs and prefixes
Posted by Robert Buck <rb...@mathworks.com>.
Hello,
I am using Xerces 1.7, C++. I have found many cases where namespace
prefixes are missing, and other cases where namespace uri strings are
empty. In particular I find that if I take the purchaseOrder example out of
the Schema spec, use an import for the IPO schema, all the namespace uris
for the imported types are empty. I am attaching sample use cases from the
Schema spec examples.
What I am doing:
I am using the SAX2 parser. Parser is configured to do _full_ schema
validation, and core namespace prefixes are set to be on.
Core validation set to true, dynamic set to false (this is
SAX2XMLReader::Val_Always according to some examples).
Consider for example an attribute whose type is specified in the imported
schema. I do something like:
unsigned int uriId = attr->getURIId();
printf("attrURIId: %d\n", uriId);
const XMLCh* uriStr = sax2Parser->getScanner()->getURIText(uriId);
StrX attrURIStr(uriStr);
printf("attrURI: %s\n", attrURIStr.localForm() );
The uri-id is unity (1). I find that in any case where the prefix or
namespace is incorrectly reported, the uri-id is always unity.
When I dump the first 10 URI strings I get:
URI 0:
URI 1:
URI 2: http://apache.org/xml/UknownNS
URI 3: http://www.w3.org/XML/1998/namespace
URI 4: http://www.w3.org/2000/xmlns/
URI 5: http://www.w3.org/2001/XMLSchema-instance
URI 6: http://www.example.com/Report
URI 7: http://www.w3.org/2001/XMLSchema
URI 8: http://www.example.com/IPO
URI 9:
But many of the elements and attributes are incorrectly mapped to URI 1
when they ought to have been mapped to URI 8. See "output.txt" in the
attached zip file. Has anyone else run into similar problems?
As an aside: The above example shows me using a slightly modified sax2
parser implementation; I modified the Xerces source to expose the scanner
so I could get the uri-text (as I see no other way to get the textual
representation apart from doing this). A friend had suggested that I modify
both the parser (to expose the scanner) and the scanner (to expose the
grammar resolver) so that I could get at the necessary information about
the schema, so that I can dynamically create an object system in C++ to
represent the data. That is why I am having to modify the parsers,
scanners, and grammar resolvers. But something curious is happening with
namespace uris.
Bob
Re: Xerces C++ Exceptions not Exported
Posted by Dean Roddey <dr...@charmedquark.com>.
I have no opinion on the other stuff. I'm 'retired' these days, so I was
just answering a technical question. I leave matters of policy and extension
and all of that to the new owners.
--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"If it don't have a control port, don't buy it!"
----- Original Message -----
From: "Robert Buck" <rb...@mathworks.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, May 14, 2002 2:20 PM
Subject: Re: Xerces C++ Exceptions not Exported
> At 02:13 PM 5/14/2002 -0700, you wrote:
> >The point I was making is that if the SAX2 parser needs them, then they
> >should have been exported to begin with, and they only reason it was
gotten
> >away with is that the parser is only delivered as one monolithic DLL
these
> >days. But, in order to support separately buildable components, they
would
> >have to be exported to begin with and their not being is just an
oversight
> >that should be corrected.
>
> Gotcha. I guess I should submit a bug now for the item (a).
>
> What are your thoughts about the second two items?
>
> There is one thing that could make pluggable user defined parsers easier
to
> use: change the factory class so that one may register user defined
parsers
> with the factory, then look them up by name later. Good idea? I have a
> working demo I could forward to you if you are interested.
>
> Bob
>
>
> ---------------------------------------------------------------------
> 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: Xerces C++ Exceptions not Exported
Posted by Robert Buck <rb...@mathworks.com>.
At 02:13 PM 5/14/2002 -0700, you wrote:
>The point I was making is that if the SAX2 parser needs them, then they
>should have been exported to begin with, and they only reason it was gotten
>away with is that the parser is only delivered as one monolithic DLL these
>days. But, in order to support separately buildable components, they would
>have to be exported to begin with and their not being is just an oversight
>that should be corrected.
Gotcha. I guess I should submit a bug now for the item (a).
What are your thoughts about the second two items?
There is one thing that could make pluggable user defined parsers easier to
use: change the factory class so that one may register user defined parsers
with the factory, then look them up by name later. Good idea? I have a
working demo I could forward to you if you are interested.
Bob
---------------------------------------------------------------------
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 C++ Exceptions not Exported
Posted by Dean Roddey <dr...@charmedquark.com>.
The point I was making is that if the SAX2 parser needs them, then they
should have been exported to begin with, and they only reason it was gotten
away with is that the parser is only delivered as one monolithic DLL these
days. But, in order to support separately buildable components, they would
have to be exported to begin with and their not being is just an oversight
that should be corrected.
--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"If it don't have a control port, don't buy it!"
----- Original Message -----
From: "Robert Buck" <rb...@mathworks.com>
To: <xe...@xml.apache.org>; <xe...@xml.apache.org>
Sent: Tuesday, May 14, 2002 2:11 PM
Subject: Re: Xerces C++ Exceptions not Exported
> I think it [SAX2XMLReader] does need them. If you are suggesting that the
> SAX 1.0 parser also have the features I am speaking of, great.
>
> Dean, I am not new to Xerces, but I am new to the process of solicitating
> change to the API's. How would you suggest we proceed? From what you have
> said, it sounds like you are in favor of these changes too.
>
> Bob
>
> At 01:59 PM 5/14/2002 -0700, Dean Roddey wrote:
> >It was clearly always a goal (though maybe not a first order one) that
> >people would be able to write their own fully functional parsers. Why
> >doesn't SAXParser itself need these things?
>
> > > This is my ideal resolution:
> > >
> > > (a) export those two exception classes.
> > > (b) add an accessor method on the sax2 parser impl to get at the
scanner
> > > (c) add an accessor method on the scanner to get to the grammar
resolver.
> > >
> > > If (a) were done, I could create my own parser and scanner classes, so
> >that
> > > I can get at all the needed schema information.
> > > If (b) and (c) were done too, I would not need to create my own parser
and
> > > scanner classes.
> > >
> > > What are peoples thoughts on incorporating these three changes to
Xerces
> > > versus just the first? Are there any objections to any of these
changes?
>
>
>
> ---------------------------------------------------------------------
> 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: Xerces C++ Exceptions not Exported
Posted by Robert Buck <rb...@mathworks.com>.
I think it [SAX2XMLReader] does need them. If you are suggesting that the
SAX 1.0 parser also have the features I am speaking of, great.
Dean, I am not new to Xerces, but I am new to the process of solicitating
change to the API's. How would you suggest we proceed? From what you have
said, it sounds like you are in favor of these changes too.
Bob
At 01:59 PM 5/14/2002 -0700, Dean Roddey wrote:
>It was clearly always a goal (though maybe not a first order one) that
>people would be able to write their own fully functional parsers. Why
>doesn't SAXParser itself need these things?
> > This is my ideal resolution:
> >
> > (a) export those two exception classes.
> > (b) add an accessor method on the sax2 parser impl to get at the scanner
> > (c) add an accessor method on the scanner to get to the grammar resolver.
> >
> > If (a) were done, I could create my own parser and scanner classes, so
>that
> > I can get at all the needed schema information.
> > If (b) and (c) were done too, I would not need to create my own parser and
> > scanner classes.
> >
> > What are peoples thoughts on incorporating these three changes to Xerces
> > versus just the first? Are there any objections to any of these changes?
---------------------------------------------------------------------
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 C++ Exceptions not Exported
Posted by Dean Roddey <dr...@charmedquark.com>.
It was clearly always a goal (though maybe not a first order one) that
people would be able to write their own fully functional parsers. Why
doesn't SAXParser itself need these things?
--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"If it don't have a control port, don't buy it!"
----- Original Message -----
From: "Robert Buck" <rb...@mathworks.com>
To: <xe...@xml.apache.org>; <xe...@xml.apache.org>
Sent: Tuesday, May 14, 2002 1:42 PM
Subject: Re: Xerces C++ Exceptions not Exported
> Yup, Dean is correct. I guess what I am looking for is a solution to my
> problem that would enable me to *not* maintain a modified version of
Xerces
> in the MATLAB source tree.
>
> This is my ideal resolution:
>
> (a) export those two exception classes.
> (b) add an accessor method on the sax2 parser impl to get at the scanner
> (c) add an accessor method on the scanner to get to the grammar resolver.
>
> If (a) were done, I could create my own parser and scanner classes, so
that
> I can get at all the needed schema information.
> If (b) and (c) were done too, I would not need to create my own parser and
> scanner classes.
>
> What are peoples thoughts on incorporating these three changes to Xerces
> versus just the first? Are there any objections to any of these changes?
>
> I am about to test my presumption, but I think if (a) were done I could
> just create copies of the scanner and parser classes and modify them for
> our own use, and avoid having to put Xerces under internal source control.
> Of course if (b) and (c) were done too, that would mean much less work for
> me as well.
>
> Bob Buck
>
> At 01:27 PM 5/14/2002 -0700, Dean Roddey wrote:
> >Unix exports everything, which is something I think is a bad thing. But,
it
> >means you never fail to have something in a library, even if you weren't
> >intended to have that access. In Windows it must be explicitly exported,
> >else its considered an internal detail.
>
>
> >From: "Jason E. Stewart" <ja...@openinformatics.com>
> >To: <xe...@xml.apache.org>
> >Sent: Tuesday, May 14, 2002 12:53 PM
> >Subject: Re: Xerces C++ Exceptions not Exported
> >
> >
> > > "Robert Buck" <rb...@mathworks.com> writes:
> > >
> > > > Using Visual Studio I link my application against Xerces and ICU. If
> > > > I use either of those specific classes in my code I get unresolved
> > > > link errors. The other exception types are exported in the API's and
> > > > I have no problem with those. In fact, when I check the xerces dlls
> > > > with a depends tool, neither of these two classes are exported. The
> > > > header file confirms this.
> > >
> > > This is a windows-specific issue then. It works perfectly under
> > > Unix.
> > >
> > > I'll let Tinny or someone else with windows knowledge help.
> > > jas.
>
>
>
> ---------------------------------------------------------------------
> 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: Xerces C++ Exceptions not Exported
Posted by Robert Buck <rb...@mathworks.com>.
Yup, Dean is correct. I guess what I am looking for is a solution to my
problem that would enable me to *not* maintain a modified version of Xerces
in the MATLAB source tree.
This is my ideal resolution:
(a) export those two exception classes.
(b) add an accessor method on the sax2 parser impl to get at the scanner
(c) add an accessor method on the scanner to get to the grammar resolver.
If (a) were done, I could create my own parser and scanner classes, so that
I can get at all the needed schema information.
If (b) and (c) were done too, I would not need to create my own parser and
scanner classes.
What are peoples thoughts on incorporating these three changes to Xerces
versus just the first? Are there any objections to any of these changes?
I am about to test my presumption, but I think if (a) were done I could
just create copies of the scanner and parser classes and modify them for
our own use, and avoid having to put Xerces under internal source control.
Of course if (b) and (c) were done too, that would mean much less work for
me as well.
Bob Buck
At 01:27 PM 5/14/2002 -0700, Dean Roddey wrote:
>Unix exports everything, which is something I think is a bad thing. But, it
>means you never fail to have something in a library, even if you weren't
>intended to have that access. In Windows it must be explicitly exported,
>else its considered an internal detail.
>From: "Jason E. Stewart" <ja...@openinformatics.com>
>To: <xe...@xml.apache.org>
>Sent: Tuesday, May 14, 2002 12:53 PM
>Subject: Re: Xerces C++ Exceptions not Exported
>
>
> > "Robert Buck" <rb...@mathworks.com> writes:
> >
> > > Using Visual Studio I link my application against Xerces and ICU. If
> > > I use either of those specific classes in my code I get unresolved
> > > link errors. The other exception types are exported in the API's and
> > > I have no problem with those. In fact, when I check the xerces dlls
> > > with a depends tool, neither of these two classes are exported. The
> > > header file confirms this.
> >
> > This is a windows-specific issue then. It works perfectly under
> > Unix.
> >
> > I'll let Tinny or someone else with windows knowledge help.
> > jas.
---------------------------------------------------------------------
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 C++ Exceptions not Exported
Posted by Dean Roddey <dr...@charmedquark.com>.
Unix exports everything, which is something I think is a bad thing. But, it
means you never fail to have something in a library, even if you weren't
intended to have that access. In Windows it must be explicitly exported,
else its considered an internal detail.
--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"If it don't have a control port, don't buy it!"
----- Original Message -----
From: "Jason E. Stewart" <ja...@openinformatics.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, May 14, 2002 12:53 PM
Subject: Re: Xerces C++ Exceptions not Exported
> "Robert Buck" <rb...@mathworks.com> writes:
>
> > Using Visual Studio I link my application against Xerces and ICU. If
> > I use either of those specific classes in my code I get unresolved
> > link errors. The other exception types are exported in the API's and
> > I have no problem with those. In fact, when I check the xerces dlls
> > with a depends tool, neither of these two classes are exported. The
> > header file confirms this.
>
> This is a windows-specific issue then. It works perfectly under
> Unix.
>
> I'll let Tinny or someone else with windows knowledge help.
> jas.
>
> ---------------------------------------------------------------------
> 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: Xerces C++ Exceptions not Exported
Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Robert Buck" <rb...@mathworks.com> writes:
> Using Visual Studio I link my application against Xerces and ICU. If
> I use either of those specific classes in my code I get unresolved
> link errors. The other exception types are exported in the API's and
> I have no problem with those. In fact, when I check the xerces dlls
> with a depends tool, neither of these two classes are exported. The
> header file confirms this.
This is a windows-specific issue then. It works perfectly under
Unix.
I'll let Tinny or someone else with windows knowledge help.
jas.
---------------------------------------------------------------------
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 C++ Exceptions not Exported
Posted by Robert Buck <rb...@mathworks.com>.
Using Visual Studio I link my application against Xerces and ICU. If I use
either of those specific classes in my code I get unresolved link errors.
The other exception types are exported in the API's and I have no problem
with those. In fact, when I check the xerces dlls with a depends tool,
neither of these two classes are exported. The header file confirms this.
Ultimately I need to create my own versions of the scanners and parsers
because the current implementation of xerces does not provide enough hooks
to uri-ids to namespace names, then resolve the namespace name to a
grammar. All these APIs are private in SAX2. So I need to either implement
my own classes (which results in the above link errors), or modify Xerces
to suit.
Bob
At 01:25 PM 5/14/2002 -0600, you wrote:
>"Robert Buck" <rb...@mathworks.com> writes:
>
> > I am wondering if the following classes can be exported by default by
> > the Xerces API:
> >
> >
> > SAXNotSupportedException
> > SAXNotRecognizedException
>
>Hi Robert,
>
>What is the problem, exactly? I use these in my code without
>dificulty. Please explain.
>
>jas.
>
>---------------------------------------------------------------------
>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: Xerces C++ Exceptions not Exported
Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Robert Buck" <rb...@mathworks.com> writes:
> I am wondering if the following classes can be exported by default by
> the Xerces API:
>
>
> SAXNotSupportedException
> SAXNotRecognizedException
Hi Robert,
What is the problem, exactly? I use these in my code without
dificulty. Please explain.
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org