Re: Casting DOM_Node to DOM_Element

2001-03-22 Thread Andy Heninger
"Jason E. Stewart" <[EMAIL PROTECTED]> asks > Would dynamic_cast<> be appropriate here? > >DOM_Element childElem = dynamic_cast node; No. The "objects" are actually just smart pointers, and don't have any virtual functions or access to type information, at least from the C++ runtime's poin

Re: Casting DOM_Node to DOM_Element

2001-03-22 Thread Jason E. Stewart
"Sean Forde" <[EMAIL PROTECTED]> writes: > > > > > I haven't found a good way to do the equivalent of: > > > > DOM_Element childElem = (DOM_Element) node; > > > > with Xerces-C. I think you could do somehting like: > > > > DOM_Element childElem = *((DOM_Element*) &node); >

RE: encoding problems

2001-03-22 Thread Dean Roddey
The best way might be to get an XMLTranscoder for ISO-8859-1 and transcode it via that. It will handle those high bit characters and pass the ASCII subset through unchanged I think. So look at the TransService object which is a static member of XMLPlatformUtils. Ask it to create you an XMLTranscod

Re: How do I prevent SAX parser from sending me events

2001-03-22 Thread Joseph_Kesselman
>How do I stop the SAX Parser from sending me events. Throw an exception from your SAX event handler. Seriously, that is a legitimate technique. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: DOMPrint and manipulating data

2001-03-22 Thread peiyongz
Hi, Emma, You may paste the follow code into DOMPrint.cpp /***testing code start ***/ DOM_Document docu = parser->getDocument(); DOM_NodeList nodeList = docu.getElementsByTagName("Event"); DOM_Node tempNode = nodeList.item(0); DOM_Element newElem = do

Re: How do I prevent SAX parser from sending me events

2001-03-22 Thread Dean Roddey
Title: How do I prevent SAX parser from sending me events Either throw an exception not derived from any type of exception that the parser defines, or use the progressive parse option (see the PParse example.)   --Dean RoddeyThe CIDLib C++ FrameworksCharmed Quark Softw

encoding problems

2001-03-22 Thread Jeremy Sheeley
I'm working with version 1.4 of xerces and parsing WML files. Looking around the web, I found a page that causes xerces to behave unexpectedly. The problem is that it's a straight ASCII file, but with one non-ASCII character (the character's hex value is A2). When I do a XMLString::transcode() o

Re: DOMPrint and manipulating data

2001-03-22 Thread Joseph_Kesselman
I haven't worked with the C++ version much, but in general the concept ought to be much the same from one version of the DOM to another. In Java, it would be roughly as follows. For more detail, see the DOM specification and/or the XML-DEV mailing list. parse your document into the DOM, ob

How do I prevent SAX parser from sending me events

2001-03-22 Thread GSheshadri
Title: How do I prevent SAX parser from sending me events Hi, How do I stop the SAX Parser from sending me events. Assuming that while parsing, I have some data that is not correct and hence I want to abandon the parsing. How do I do this? Thanks, Ganesh

DOMPrint and manipulating data

2001-03-22 Thread Emma Towey
    Hi all, I’m having a bit of a problem that hopefully someone will be able to help me with. I have an xml file similar to the one below:                       0         feeder not found            

Re: Can I typedef XMLCh for wchar_t on Solaris?

2001-03-22 Thread Andy Heninger
It's safe to change the definition of XMLCh to wchar_t on Solaris, with one caution: if you ever encounter xml data with a code point (Unicode character code value) > 64k, there will be a problem. These characters are stored as a "surrogate pair" of two 16 bit values in utf-16 encoding, and that

RE: Casting DOM_Node to DOM_Element

2001-03-22 Thread Sean Forde
> > I haven't found a good way to do the equivalent of: > > DOM_Element childElem = (DOM_Element) node; > > with Xerces-C. I think you could do somehting like: > > DOM_Element childElem = *((DOM_Element*) &node); > Try this: DOM_Element childElem = (DOM_Element&)

RE: Parsed Output Encoding

2001-03-22 Thread Dean Roddey
You just need to transcode it. If transcoding it to the local code page is sufficient, just use the transcoding methods in XMLString. If you need to insure that it gets transcoded to a particular encoding, ask the transcoding service (a pointer to it is in the XMLPlatformUtils class) to create you

Casting DOM_Node to DOM_Element

2001-03-22 Thread Arnold, Curt
A very common pattern (at least in my code) when using Xerces-J's DOM is to do something like: for(DOM_Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) { if(node.getNodeType() == DOM_Node.ELEMENT_NODE) { DOM_Element childElem = (DOM_Element) n

RE: Can I typedef XMLCh for wchar_t on Solaris?

2001-03-22 Thread Dean Roddey
It will work. However, if your system's wchar_t expects UTF-32/UCS-4 type Unicode, i.e. 32 bit size chars, you will get into trouble if any of the text you parse creates surrogates. A 32 bit Unicode system never expects to see surrogate pairs, because it doesn't need them. The parser itself will w

Parsed Output Encoding

2001-03-22 Thread Jose Cornado
Guys: I haven't seen this question posted, so I'm sending it to you. Sorry if this was already answered. Background: I'm writing an ODBC api test tool and I'm using Xerces so I just have to provide the ODBC/SQL behavior, the parsing is provided by Xerces. My approach is to deleg

Can I typedef XMLCh for wchar_t on Solaris?

2001-03-22 Thread Majeed, Zartaj
I would like to build libxerces-c1_4.so with XMLCh typedef'd for wchar_t instead of unsigned short. I'd like to know if that is a safe change to make in util/Compilers/SunCCDefs.hpp? I need to do this to avoid conversions between wide strings and DOM_Strings in my Solaris CC application. I expect

Re: Link problems with Xerces 1.4

2001-03-22 Thread Carl_Erhorn
Hi, All. >Although the build process appears to work correctly and a shared library >is produced, it doesn't contain all the object files generated under >obj/SOLARIS. The library I get is only ~3200 bytes in size. I recall seeing a problem in the makefiles, where make calls a shell script that

[Bug 1069] Changed - The Makefiles fail to locate .cpp -> .o dependency and rebuild .o all the time

2001-03-22 Thread bugzilla
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1069 *** shadow/1069 Wed Mar 21 10:58:49 2001 --- shadow/1069.tmp.25646 Thu Mar 22 07:32:49 2001 *** *** 7,13 | Severity: MinorOS/Version: Linux | | Priority: Low

Re: Link problems with Xerces 1.4

2001-03-22 Thread Andy_Storey
Hi William, It could be a similar problem to one I have seen building Xerces 1.4 on Solaris 2.7 with Workshop 5.0. Although the build process appears to work correctly and a shared library is produced, it doesn't contain all the object files generated under obj/SOLARIS. The library I get is only

Plans for level 2 events support?

2001-03-22 Thread Arnold, Curt
I had sent a roughly equivalent message from another one of my email accounts, but it didn't seem to hit the list. Sorry if this is a repeat. Are they any short-term plans for implementing Level 2 events in the Xerces-C DOM? If not, I might need to undertake an exploratory implementation. W

SAX2 parsing from a stream

2001-03-22 Thread Iain Gillies
I am unable to parse a string of xml using xerces c++ 1.4.0 Can anyone please show a code snippet to show me how this is done. I am trying to convert the following code snippet from Java to c++. 1 String xml = "1234556someValue"; 2 SAXParser parser = new SAXParser(); 3 parser