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 wi...@us.abb.com on 2001/04/17 23:55:39 UTC
Changes for C++Builder 4
Tinny, Dean, etc.,
I didn't get any feedback to my questions below, so I will proceed with
proposing the following changes (I'm just pasting in the DIFF outputs)...
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/util/Compilers/BorlandCDefs.hpp,v
retrieving revision 1.8
diff -r1.8 BorlandCDefs.hpp
88,89c88,91
< // typedef wchar_t XMLCh;
< typedef unsigned short XMLCh;
---
> typedef wchar_t XMLCh;
> // typedef unsigned short XMLCh;
> // since C++Builder supports the wchar_t standard definition as unsigned short
> // but won't automatically convert between the two
===================================================================
RCS file:
/home/cvspublic/xml-xerces/c/src/util/Platforms/Win32/Win32PlatformUtils.cpp,v
retrieving revision 1.26
diff -r1.26 Win32PlatformUtils.cpp
74c74,78
< #include <crtdbg.h>
---
> #ifdef _MSC_VER
> #include <crtdbg.h>
> #else
> #include <assert.h>
> #endif
626,628c630,634
< // Windows supports InterlockedCompareExchange only on Windows 98,
< // NT 4.0, and newer. Not on Win 95. So we are back to using assembler.
< // (But only if building with MSVC.)
---
> // InterlockedCompareExchange is only supported on Windows 98,
> // Windows NT 4.0, and newer -- not on Windows 95...
> // If you are willing to give up Win95 support change this to #if 0
> // otherwise we are back to using assembler.
> // (But only if building with compilers that support inline assembler.)
630c636
< #if defined(_MSC_VER)
---
> #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
746c752
< #if 0 && _DEBUG
---
> #if 0 && defined(_DEBUG)
I have also re-created the BCB4 project files. Because the changes were so
numerous -- mostly because all the paths were wrong -- I am simply attaching a
.ZIP with the new versions of all those files. (See attached file:
Projects-Win32-BCB4.zip)
P.S. I probably should add the disclaimer that these contributions are my own
and imply no responsibilities nor liabilities for my employer.
william.l.hopper@us.abb.com
03/28/2001 02:21 AM
Please respond to xerces-c-dev@xml.apache.org
To: xerces-c-dev@xml.apache.org
Subject: Supporting C++Builder 4 and 5 issues
I am trying to pull together updates for the BCB4 files in CVS and create a
similar BCB5 tree for C++Builder 5 and I would like the community's input on a
few issues...
1. Am I correct that Visual C++ 6 does not declare the C++ standard type
"wchar_t" as intrinsic like C++Builder does, which allows VC6 to think an
"XMLCh" is the same, while C++Builder thinks they are different?
2. Given the typedef problem above, is anyone building Xerces under C++Builder
^without^ changing the "XMLCh" typedef in util\Compilers\BorlandCDefs.hpp back
to being "wchar_t"?
3. MSDN, etc. indicates that the InterlockedCompareExchange API is not
supported on Windows 95, only on later versions. Secondly, in the
"compareAndSwap" method in util\Platforms\Win32\Win32PlatformUtils.cpp, the
inline assembler section ifdef'ed for VC++ uses instructions that, I think, are
only valid for 80486 and later processors. Is supporting Windows 95 the reason
we are not using the InterlockedCompareExchange API method? Additionally, does
Xerces have a stated list of supported processors?
Re: Changes for C++Builder 4
Posted by Dean Roddey <dr...@charmedquark.com>.
Sorry I didn't see this post before. The answers are:
> 1. Am I correct that Visual C++ 6 does not declare the C++ standard type
> "wchar_t" as intrinsic like C++Builder does, which allows VC6 to think an
> "XMLCh" is the same, while C++Builder thinks they are different?
>
You'll need to make XMLCh unsigned short, not the intrinsic wchar_t. This is
what is now assumed by the parser, i.e. its always UTF-16.
> 2. Given the typedef problem above, is anyone building Xerces under
C++Builder
> ^without^ changing the "XMLCh" typedef in util\Compilers\BorlandCDefs.hpp
back
> to being "wchar_t"?
>
Unless wchar_t is UTF-16 on your compiler, you shouldn't use wchar_t.
> 3. MSDN, etc. indicates that the InterlockedCompareExchange API is not
> supported on Windows 95, only on later versions. Secondly, in the
> "compareAndSwap" method in util\Platforms\Win32\Win32PlatformUtils.cpp,
the
> inline assembler section ifdef'ed for VC++ uses instructions that, I
think, are
> only valid for 80486 and later processors. Is supporting Windows 95 the
reason
> we are not using the InterlockedCompareExchange API method? Additionally,
does
> Xerces have a stated list of supported processors?
>
I think that we've dropped Win95 now, right? If the InterlockedXXX() methods
are available on Win98 and we aren't supported Win95 anymore, then we should
toss the assembly I think.
--------------------------
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
Reuse of SAX parser object!
Posted by Ravindra Shet <ra...@sasken.com>.
Hi,
Can anyone tell me/direct me to literature, on reusing the SAX parser object.
Would also be interested in optimization and performance tips.
Regards
Ravindra Shet
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Verifying DTD compliance in memory
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Hi all,
When modifying or creating a DOM_Document in memory, there seems to be only
one way to check that the results are valid in terms of the DTD. Also,
a lot of information is generated during the parse of a stream that cannot
be updated through the DOM (e.g. DOM_Document::getElementById() only works
if the element was parsed, there is no way to get it to work for newly
created or imported nodes).
It would be *very* useful to have some kind of 'parser' that, rather than a
stream, takes a DOM_Document and checks that against the DTD, updating the
document's ID map and what have you.
Has anyone tried creating such a beast or does anyone have any ideas how
that could be done? And, is anyone else interested in such a thing or am I
the only one?
TIA, Evert
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Updating ID Attributes
Posted by Rob Snell <ro...@ist.co.uk>.
On Thu, 26 Apr 2001, Evert Haasdijk wrote:
> There doesn't seem to be any way to add an attribute to a DOM_Element and
> specify that it's an ID. Similarly, changing the content of an ID atttribute
Yes I couldn't see a way of doing this either. Perhaps the parser
will implicitly detect attributes of type ID if they're defined as such
in the DTD. I haven't checked this.
Rob.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Updating ID Attributes
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Hi all,
There doesn't seem to be any way to add an attribute to a DOM_Element and
specify that it's an ID. Similarly, changing the content of an ID atttribute
isn't - as far as I can tell - reflected in the document.
Is there any way around this? I know that you can tell an AttrImpl that it's
an ID and that I can update a DocumentImpl's map of node ID's, but
obviously, I can't just get at these implementation classes.
Has anyone tried to solve this problem? Or does anyone have a suggestion?
TIA, Evert
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: Losing ID's on importNode()
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Hi all,
I've modified DocumentImpl::importNode() to update the importing document's
map fNodeIDMap when importing nodes with ID attributes.
The only problem occurs if the importing document's DTD doesn't define the
imported attribute as an ID. Is there any way to check against that?
Here's the code:
NodeImpl *DocumentImpl::importNode(NodeImpl *source, bool deep)
{
// SNIPPETYSNIP
case DOM_Node::ATTRIBUTE_NODE :
{
if (source->getLocalName() == null)
newnode = createAttribute(source->getNodeName());
else
newnode = createAttributeNS(source->getNamespaceURI(),
source->getNodeName());
// if source is an AttrImpl from this very same implementation
// avoid creating the child nodes if possible
// if (source instanceof AttrImpl) {
AttrImpl *attr = (AttrImpl *) source;
if (attr->hasStringValue()) {
AttrImpl *newattr = (AttrImpl *) newnode;
newattr->setValue(attr->getValue());
deep = false;
}
else {
deep = true;
}
//
// start importing ID
// The imported attribute is an ID. Add it to the hashtable of
IDs
// that is constructed for use by GetElementByID().
//
AttrImpl *newattr = (AttrImpl *) newnode;
if (attr->isIdAttr())
{
newattr->isIdAttr(true);
if (fNodeIDMap == 0)
fNodeIDMap = new NodeIDMap(500);
fNodeIDMap->add(newattr);
}
//
// end importing ID
//
// }
// else {
// // Kids carry value
// deep = true;
// }
}
break;
// SNIPPETYSNIP
> -----Original Message-----
> From: Evert Haasdijk [mailto:E.Haasdijk@cable.a2000.nl]
> Sent: Tuesday, April 24, 2001 13:26 PM
> To: xerces-c-dev@xml.apache.org
> Subject: Losing ID's on importNode()
>
>
> Hi all,
>
> My application 'copies' part of an XML document into another (using
> DOM_Document::importNode()). Now, some of the imported DOM nodes
> have an ID,
> but I can't retrieve them after importing them (calling
> DOM_Document::getElementById()) because the document's fNodeIDMap isn't
> updated on importNode().
> Is there any way to update the ID map short of writing the new
> document and
> re-parsing it?
>
> TIA, Evert
>
>
> ---------------------------------------------------------------------
> 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
Losing ID's on importNode()
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Hi all,
My application 'copies' part of an XML document into another (using
DOM_Document::importNode()). Now, some of the imported DOM nodes have an ID,
but I can't retrieve them after importing them (calling
DOM_Document::getElementById()) because the document's fNodeIDMap isn't
updated on importNode().
Is there any way to update the ID map short of writing the new document and
re-parsing it?
TIA, Evert
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: Changes for C++Builder 4
Posted by Khaled Noaman <kn...@ca.ibm.com>.
The changes are now in CVS. I have not changed the XMLCh
to the intrinsic wchar_t. I have kept it as unsigned int,
as the parser always assumes that it is UTF-16.
Regards,
Khaled Noaman
william.l.hopper@us.abb.com wrote:
> Tinny, Dean, etc.,
>
> I didn't get any feedback to my questions below, so I will proceed with
> proposing the following changes (I'm just pasting in the DIFF outputs)...
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/c/src/util/Compilers/BorlandCDefs.hpp,v
> retrieving revision 1.8
> diff -r1.8 BorlandCDefs.hpp
> 88,89c88,91
> < // typedef wchar_t XMLCh;
> < typedef unsigned short XMLCh;
> ---
> > typedef wchar_t XMLCh;
> > // typedef unsigned short XMLCh;
> > // since C++Builder supports the wchar_t standard definition as unsigned short
> > // but won't automatically convert between the two
>
> ===================================================================
> RCS file:
> /home/cvspublic/xml-xerces/c/src/util/Platforms/Win32/Win32PlatformUtils.cpp,v
> retrieving revision 1.26
> diff -r1.26 Win32PlatformUtils.cpp
> 74c74,78
> < #include <crtdbg.h>
> ---
> > #ifdef _MSC_VER
> > #include <crtdbg.h>
> > #else
> > #include <assert.h>
> > #endif
> 626,628c630,634
> < // Windows supports InterlockedCompareExchange only on Windows 98,
> < // NT 4.0, and newer. Not on Win 95. So we are back to using assembler.
> < // (But only if building with MSVC.)
> ---
> > // InterlockedCompareExchange is only supported on Windows 98,
> > // Windows NT 4.0, and newer -- not on Windows 95...
> > // If you are willing to give up Win95 support change this to #if 0
> > // otherwise we are back to using assembler.
> > // (But only if building with compilers that support inline assembler.)
> 630c636
> < #if defined(_MSC_VER)
> ---
> > #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
> 746c752
> < #if 0 && _DEBUG
> ---
> > #if 0 && defined(_DEBUG)
>
> I have also re-created the BCB4 project files. Because the changes were so
> numerous -- mostly because all the paths were wrong -- I am simply attaching a
> .ZIP with the new versions of all those files. (See attached file:
> Projects-Win32-BCB4.zip)
>
> P.S. I probably should add the disclaimer that these contributions are my own
> and imply no responsibilities nor liabilities for my employer.
>
>
> william.l.hopper@us.abb.com
> 03/28/2001 02:21 AM
>
>
> Please respond to xerces-c-dev@xml.apache.org
>
> To: xerces-c-dev@xml.apache.org
> Subject: Supporting C++Builder 4 and 5 issues
>
> I am trying to pull together updates for the BCB4 files in CVS and create a
> similar BCB5 tree for C++Builder 5 and I would like the community's input on a
> few issues...
>
> 1. Am I correct that Visual C++ 6 does not declare the C++ standard type
> "wchar_t" as intrinsic like C++Builder does, which allows VC6 to think an
> "XMLCh" is the same, while C++Builder thinks they are different?
>
> 2. Given the typedef problem above, is anyone building Xerces under C++Builder
> ^without^ changing the "XMLCh" typedef in util\Compilers\BorlandCDefs.hpp back
> to being "wchar_t"?
>
> 3. MSDN, etc. indicates that the InterlockedCompareExchange API is not
> supported on Windows 95, only on later versions. Secondly, in the
> "compareAndSwap" method in util\Platforms\Win32\Win32PlatformUtils.cpp, the
> inline assembler section ifdef'ed for VC++ uses instructions that, I think, are
> only valid for 80486 and later processors. Is supporting Windows 95 the reason
> we are not using the InterlockedCompareExchange API method? Additionally, does
> Xerces have a stated list of supported processors?
>
> ------------------------------------------------------------------------
> Name: Projects-Win32-BCB4.zip
> Projects-Win32-BCB4.zip Type: Zip Compressed Data (application/x-zip-compressed)
> Encoding: base64
> Description: .ZIP File
>
> ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: Changes for C++Builder 4
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Oops...I missed some of the casts I needed...see attached files
> -----Original Message-----
> From: Evert Haasdijk [mailto:E.Haasdijk@cable.a2000.nl]
> Sent: Wednesday, April 18, 2001 9:57 AM
> To: xerces-c-dev@xml.apache.org
> Subject: RE: Changes for C++Builder 4
>
>
> Hi William,
>
> I didn't see your earlier posting, but anyway, here's my $0.02.
>
> >1. Am I correct that Visual C++ 6 does not declare the C++ standard type
> >"wchar_t" as intrinsic like C++Builder does, which allows VC6 to think an
> >"XMLCh" is the same, while C++Builder thinks they are different?
>
> It certainly seems so.
>
> >2. Given the typedef problem above, is anyone building Xerces under
> C++Builder
> >^without^ changing the "XMLCh" typedef in util\Compilers\BorlandCDefs.hpp
> back
> >to being "wchar_t"?
>
> I've tried both with and without redefining the typedef. If you don't, you
> end
> up with loads of explicit casts in Win32PlatformUtils.cpp. I've attached a
> version
> with these casts. They're all documented like this: //<BCB cast to wchar_t
> \>
>
>
> >3. MSDN, etc. indicates that the InterlockedCompareExchange API is not
> >supported on Windows 95, only on later versions. Secondly, in the
> >"compareAndSwap" method in
> util\Platforms\Win32\Win32PlatformUtils.cpp, the
> >inline assembler section ifdef'ed for VC++ uses instructions
> that, I think,
> are
> >only valid for 80486 and later processors. Is supporting Windows 95 the
> reason
> >we are not using the InterlockedCompareExchange API method?
> Additionally,
> does
> >Xerces have a stated list of supported processors?
>
> Don't know; I only have W2K here, but I can have a look at home
> (I've got a
> W98
> machine there), if you want me to.
>
> Hope this helps,
>
> Evert
>
>
>
RE: Changes for C++Builder 4
Posted by Evert Haasdijk <E....@cable.a2000.nl>.
Hi William,
I didn't see your earlier posting, but anyway, here's my $0.02.
>1. Am I correct that Visual C++ 6 does not declare the C++ standard type
>"wchar_t" as intrinsic like C++Builder does, which allows VC6 to think an
>"XMLCh" is the same, while C++Builder thinks they are different?
It certainly seems so.
>2. Given the typedef problem above, is anyone building Xerces under
C++Builder
>^without^ changing the "XMLCh" typedef in util\Compilers\BorlandCDefs.hpp
back
>to being "wchar_t"?
I've tried both with and without redefining the typedef. If you don't, you
end
up with loads of explicit casts in Win32PlatformUtils.cpp. I've attached a
version
with these casts. They're all documented like this: //<BCB cast to wchar_t
\>
>3. MSDN, etc. indicates that the InterlockedCompareExchange API is not
>supported on Windows 95, only on later versions. Secondly, in the
>"compareAndSwap" method in util\Platforms\Win32\Win32PlatformUtils.cpp, the
>inline assembler section ifdef'ed for VC++ uses instructions that, I think,
are
>only valid for 80486 and later processors. Is supporting Windows 95 the
reason
>we are not using the InterlockedCompareExchange API method? Additionally,
does
>Xerces have a stated list of supported processors?
Don't know; I only have W2K here, but I can have a look at home (I've got a
W98
machine there), if you want me to.
Hope this helps,
Evert