Re: parser does not thow fatal error

2004-07-13 Thread David Cargill
Hi, You need to set an ErrorHandler so that errors can be returned to you. If you modify the DOMPrint to do a parser->parse("") you will get a FatalError message (which is caught in DOMTreeErrorReporter). Note that the catch block's after the parser->parse don't catch this. However, if you

RE: Parser not failing on bad schema?

2004-04-06 Thread Bovy, Stephen J
throw 18; } The interesting thing in the sample code that I cut and pasted into my app is that the error-handler sets an error-flag which is then tested in : errorHa

Re: Parser not failing on bad schema?

2004-04-06 Thread Nick Bastin
On Apr 6, 2004, at 6:08 PM, Bovy, Stephen J wrote: You forgot to set the error handler, at least , its not in the code snippet you posted. Ok, well, I did set the error handler, I just didn't include the code for that. That was supposed to be inferred from my comment that the error handler repo

RE: Parser not failing on bad schema?

2004-04-06 Thread Bovy, Stephen J
You forgot to set the error handler, at least , its not in the code snippet you posted. parser->setErrorHandler ( errorHandler ); -Original Message- From: Nick Bastin [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 2:57 PM To: [EMAIL PROTECTED] Subject: Parser not failing on b

RE: Parser

2003-11-28 Thread Sean Kelly
On Fri, 28 Nov 2003, Gareth Reakes wrote: > > You have to register an error handler. All errors get passed > through it and if you want to throw an exception then you can. Note that > this is for flexibility - you may want it to throw an exception and stop, I think the default behavior of th

RE: Parser

2003-11-28 Thread Gareth Reakes
rom: Dean Roddey [mailto:[EMAIL PROTECTED] > Sent: Friday, November 28, 2003 8:10 AM > To: [EMAIL PROTECTED] > Subject: RE: Parser > > > If that indeed happened, then it is a bug, not a feature. The parser > would never do such a thing on purpose.

RE: Parser

2003-11-28 Thread Milan Tomic
riday, November 28, 2003 8:10 AMTo: [EMAIL PROTECTED]Subject: RE: Parser If that indeed happened, then it is a bug, not a feature. The parser would never do such a thing on purpose. Do you have an error handler installed to get error reports?   -

RE: Parser

2003-11-28 Thread Dean Roddey
Title: Message If that indeed happened, then it is a bug, not a feature. The parser would never do such a thing on purpose. Do you have an error handler installed to get error reports?   - Dean Roddey The Charmed Quark Controller [EMAIL PROTECTED] www.char

RE: Parser

2003-11-07 Thread Erik Rydgren
Xerces supports both DTD's and Schemas. Take a look at the examples how to use validation. It isn't hard. / Erik > -Original Message- > From: Milan Tomic [mailto:[EMAIL PROTECTED] > Sent: den 7 november 2003 11:49 > To: [EMAIL PROTECTED] > Subject: RE: Parser &g

RE: Parser

2003-11-07 Thread Milan Tomic
] Subject: RE: Parser Are you SURE you are in the right place in the tree? Assuming a tree that looks like this A |- B |- C |- D walker = doc.createTreeWalker(doc.getDocumentElement(), DOMNodeFilter::SHOW_ELEMENT, NULL, true); // here walker current pos is A if (walker->firstChild() != N

RE: Parser

2003-11-07 Thread Erik Rydgren
TECTED] Subject: RE: Parser You should not use the nextNode method. It iterates ALL nodes in the tree in order. Use firstChild and nextSibling instead.   / Erik   -Original Message- From: Milan Tomic [mailto:[EMAIL PROTECTED] Sent: den 6 november 2003 14:44 To: [EMAIL PROTECTED] Subject: RE:

RE: Parser

2003-11-06 Thread Milan Tomic
: [EMAIL PROTECTED]Subject: RE: Parser You should not use the nextNode method. It iterates ALL nodes in the tree in order. Use firstChild and nextSibling instead.   / Erik   -Original Message-From: Milan Tomic [mailto:[EMAIL PROTECTED] Sent: den 6 november 2003

RE: Parser

2003-11-06 Thread Erik Rydgren
: RE: Parser         I have one problem. Both createTreeWalker() and createNodeIterator() goes through ALL nodes in the XML document. It should iterate only through child nodes of first given node (root node in this example). Here is code sample:   DOMTreeWalker* walker = theDOM

RE: Parser

2003-11-06 Thread Milan Tomic
ent: den 5 november 2003 16:13To: [EMAIL PROTECTED]Subject: RE: Parser         I'm using this:   DOMNodeIterator* iterator = theDOM->createNodeIterator(rootElem, DOMNodeFilter::SHOW_ELEMENT, NULL, true);       but I still see #text "nod

RE: Parser

2003-11-05 Thread Erik Rydgren
ber 2003 16:13 To: [EMAIL PROTECTED] Subject: RE: Parser         I'm using this:   DOMNodeIterator* iterator = theDOM->createNodeIterator(rootElem, DOMNodeFilter::SHOW_ELEMENT, NULL, true);       but I still see #text "nodes". Am I missing something? I&#x

RE: Parser

2003-11-05 Thread Milan Tomic
hing else.   Thank you.     -Original Message-From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:33 PMTo: [EMAIL PROTECTED]Subject: RE: Parser Use the createTreeWalker method or createNodeIterator method on the DOMDocument.   / Erik

RE: Parser

2003-11-05 Thread Erik Rydgren
Title: Message Use the createTreeWalker method or createNodeIterator method on the DOMDocument.   / Erik   -Original Message- From: Milan Tomic [mailto:[EMAIL PROTECTED] Sent: den 5 november 2003 13:04 To: [EMAIL PROTECTED] Subject: RE: Parser     Thank you

RE: Parser

2003-11-05 Thread Milan Tomic
MTo: [EMAIL PROTECTED]Subject: RE: Parser That is standard DOM behavior. The carage-return line-feed characters you have mixed into the XML are treated as non ignorable text content. Hence text nodes are created. There are several ways to solve your problem but the easiest is

RE: Parser

2003-11-05 Thread Erik Rydgren
Title: Parser That is standard DOM behavior. The carage-return line-feed characters you have mixed into the XML are treated as non ignorable text content. Hence text nodes are created. There are several ways to solve your problem but the easiest is to create a tree iterator that doesn’t s

RE: parser->parse() question

2003-07-16 Thread Gareth Reakes
Hi, On Wed, 16 Jul 2003, Erik Rydgren wrote: > DOMNode is the interface and DOMNodeImpl is the implementation hence is > DOMNodeImpl::release the place to begin. Just to clarify this. DOMNodeImpl is unlike the other DOM classes with a interface and a implementation. The release in DOMNodeImpl

RE: parser->parse() question

2003-07-16 Thread Erik Rydgren
DOMNode is the interface and DOMNodeImpl is the implementation hence is DOMNodeImpl::release the place to begin. / Erik > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: den 16 juli 2003 17:10 > To: [EMAIL PROTECTED] > Subject: RE: parser-&g

RE: parser->parse() question

2003-07-16 Thread elliot . rapp
| | cc: | | Su

RE: parser->parse() question

2003-07-16 Thread Erik Rydgren
Nahh. Just look at the DOMNode::release functionality and un-nest the code from there. I'm sure you'll figure it out. / Erik > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: den 16 juli 2003 16:44 > To: [EMAIL PROTECTED] > S

RE: parser->parse() question

2003-07-16 Thread elliot . rapp
: <[EMAIL PROTECTED]> | | cc: | | Subject

Re: parser->parse() question

2003-07-16 Thread Gareth Reakes
Hi, > OkI think I am finally beginning to understand the full story of > release ;-) when you are sure please tell me ;) > One more question though. The part that I still find confusing is how > decisions are made about child nodes. For instancelets say that I load > a document, get

RE: parser->parse() question

2003-07-15 Thread Erik Rydgren
TED] > Sent: den 15 juli 2003 18:49 > To: [EMAIL PROTECTED] > Subject: Re: parser->parse() question > > > Thanks. > > OkI think I am finally beginning to understand the full story of > release ;-) > > One more question though. The part that I still find co

Re: parser->parse() question

2003-07-15 Thread elliot . rapp
]" <[EMAIL PROTECTED]> | | cc: | | Subject

Re: parser->parse() question

2003-07-15 Thread Gareth Reakes
Hi, On Tue, 15 Jul 2003, [EMAIL PROTECTED] wrote: > > So. If I try to operate on a node that has been released, it should still > be in memory? If it has not been reused. > Or, is it possible that I get some other node that is now > using the memory freed up during that release? yep, I hav

Re: parser->parse() question

2003-07-15 Thread elliot . rapp
| | To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> | | cc: | | Subject

Re: parser->parse() question

2003-07-15 Thread Gareth Reakes
Hi, > BTW, I asked this in a different thread (probably poor etiquette), and got > the UserData answer. However, I'll bring it up again here since it is > relatedis there any other way to tell if a node is still in memory or > valid? I would like some sort of derefence mechanism to just do a

RE: parser->parse() question

2003-07-15 Thread Gareth Reakes
cheers Erik, I did not make that clear at all. Gareth On Mon, 14 Jul 2003, Erik Rydgren wrote: > Gareth, you forgot to mention that the first document is still valid > after a reset. The parser keeps the document in an internal list until > the parser is deleted or the method resetPool is calle

RE: parser->parse() question

2003-07-14 Thread Erik Rydgren
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: den 14 juli 2003 22:03 > To: [EMAIL PROTECTED] > Subject: Re: parser->parse() question > > > Exactly ;-) > > Thanks for the help! > > BTW, I asked this in a different thread (probably poor etiquette), and got > th

Re: parser->parse() question

2003-07-14 Thread elliot . rapp
---| But resetPool() is proected, so i guess u shall call resetDocumentPool() instead. Rgds, PeiYong - Original Message - From: "Erik Rydgren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 14, 2003 3:50 PM Su

Re: parser->parse() question

2003-07-14 Thread PeiYong Zhang
But resetPool() is proected, so i guess u shall call resetDocumentPool() instead. Rgds, PeiYong - Original Message - From: "Erik Rydgren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 14, 2003 3:50 PM Subject: RE: parser->parse() question >

RE: parser->parse() question

2003-07-14 Thread Erik Rydgren
ilto:[EMAIL PROTECTED] > Sent: den 14 juli 2003 21:38 > To: [EMAIL PROTECTED] > Subject: RE: parser->parse() question > > > Would it acceptable to use resetDocumentPool()? Or is resetPool() > superior > in some way? > > > > > > |-+---

RE: parser->parse() question

2003-07-14 Thread elliot . rapp
: <[EMAIL PROTECTED]> | | cc: | | Subject

RE: parser->parse() question

2003-07-14 Thread Erik Rydgren
Original Message- > From: Gareth Reakes [mailto:[EMAIL PROTECTED] > Sent: den 14 juli 2003 19:41 > To: [EMAIL PROTECTED] > Subject: Re: parser->parse() question > > Hi, > > > So, what is my question? What is the status of these nodes "left over" >

Re: parser->parse() question

2003-07-14 Thread Gareth Reakes
Hi, > So, what is my question? What is the status of these nodes "left over" > from the first parsing? I thought they would be orphaned, but apparently > not. > 1. Am I responsible for releasing them? You should call reset between parses. If you do this then the parser will delete the docs for

RE: parser->parse() method

2003-03-20 Thread vinayak
no you dont. everything is in place. but depending on your platform, you may need to link with your socket implementation libs. e.g, for windows you may need to link with ws2_32.lib -Vinayak > -Original Message- > From: John Meyer [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 20, 20

Re: parser feature fgXercesUserAdoptsDOMDocument

2002-12-20 Thread Gareth Reakes
Hi, I think thats a bug. Ill have a look into it. thanks Gareth On Fri, 20 Dec 2002, Gary Hughes wrote: > Hi Gareth, > > The parser does not seem to relinquish ownership of the document, I am > also concerned over the fact that calling setFeature does not raise an > exception while

Re: parser feature fgXercesUserAdoptsDOMDocument

2002-12-19 Thread Gary Hughes
Hi Gareth, The parser does not seem to relinquish ownership of the document, I am also concerned over the fact that calling setFeature does not raise an exception while getFeature or canSetFeature both raise a not found exception for the same feature (fgXercesUserAdoptsDOMDocument). I'll try y

Re: parser feature fgXercesUserAdoptsDOMDocument

2002-12-19 Thread Gareth Reakes
Hi, when you say it does not change the behaviour what do you mean? What you should see is that when you delete the parser it does not delete the document. The following code works for me: parser->parse(gXmlFile); DOMDocument *doc = parser->getDocument(); parser->adoptDocument(); std::c

RE: Parser pointers, Node pointers, leaks etc

2002-10-03 Thread Erik Rydgren
1. If you get the document pointer by calling adoptDocument instead of getDocument you can delete the parser. 2. No you do not have to delete pinters you "get" only if you "adopt" pointers. General idea. If you didn't make the _new_ then don't do the _delete_. Regards / Erik -Original Messag

Re: parser

2002-03-13 Thread Matt Leinhos
Make sure you pass the parser an InputSource (I think you'll need the MemBufInputSource) when you want to send the parser straight XML. So, you'll have DOMParser parser; // set parser attrs MemBufInputSource is( (XMLByte *)xmlstring, ... ); // don't recall the constructor args; look them up p

Re: parser

2002-03-11 Thread pankaj bavishi
Here are the details: I am using xerces-c, DOM parser (DOMParser* DP = new DOMParser); I have a string (that has xml nodes) like: std::string strXml(pOrg) here char*pOrg . I have to parse this string as a DOM tree and get hold of root node. So I am doing: Parser->parse(pOrg) DOM_Document doc =

Re: parser

2002-03-11 Thread Matt Leinhos
Which parser are you using? How have you set it up (via set___() methods)? What are the contents of strXml? Does the document you are parsing really exist? We need way more details. Matt On Mar 11, pankaj bavishi wrote: - > > > >I have a xml file to parse. > >I am using: > >pa

Re: Parser for Tru64

2002-02-11 Thread Tinny Ng
And XERCESCROOT should point to the root of Xerces-C++ installation, and thus I believe should be: XERCESCROOT=/tmp/XML/xml-xerces/c not XERCESCROOT=/tmp/XML/xml-xerces/c/src/xercesc Tinny Martin Kalen wrote: > > ./runConfigure -p tru64 -x cxx -d > > > > After that : make , but got erro

Re: Parser for Tru64

2002-02-10 Thread Martin Kalen
> ./runConfigure -p tru64 -x cxx -d > > After that : make , but got errors. Elena, you need GNU make to build Xerces. If you have a fairly recent Tru64-distribution from Compaq, gmake should be included on one of the freeware discs. Regards, Martin

Re: Parser reuse

2002-01-25 Thread Tinny Ng
Do not set validation to true. Setting validation to true will overwrite the dynamic switch, and always validate even DTD does not exist, and thus error. Just set validation/dynamic to true is enough, which will validate only if grammar exists. Tinny Drew Tennenbaum wrote: > I am using an XM

RE: Parser Functionality

2001-09-04 Thread Evert Haasdijk
The whitespace in the document is read and stored by the parser. The DOMWriter simply writes everything (including whitespace) in the document. To strip ignorable whitespace, set the parser's flag to exclude it with DOMParser::setIncludeIgnorableWhitespace(false); Ta, evert > -Original Messa

RE: parser trying to read twice

2001-07-25 Thread Joseph_Kesselman
> My problem would be the same if I would try to >parse from memory but have two XML "files" in this memory separated by >Ctrl-L (or any other encoding which allows to seperate "files" in the >stream. XML syntax, and XML parsers, were never designed to handle that case; in fact, XML parsers are

RE: parser trying to read twice

2001-07-24 Thread Norbert Kiesel
Hi, I just found the source of my current problem: the parser behaves differently for very short XML "files" than for longer ones: if the number of translated bytes is less than 100, it does an additional XMLReader::RefreshRawBuffer in XMLReader::xcodeMoreChars, which ultimately calls BinInputS

RE: parser trying to read twice

2001-07-24 Thread Norbert Kiesel
Murphy, James writes: > I think you are running into a socket programming issue more than anything > else. I would set a flag in BinSockInputStream that gets signaled when you > get a short buffer. If you ask for 1024 bytes and get 73 set the flag. > Check the flag on the way into readBytes

RE: parser trying to read twice

2001-07-24 Thread Murphy, James
I think you are running into a socket programming issue more than anything else. I would set a flag in BinSockInputStream that gets signaled when you get a short buffer. If you ask for 1024 bytes and get 73 set the flag. Check the flag on the way into readBytes to see if you are done or not.

Re: parser trying to read twice

2001-07-24 Thread David_N_Bertoni
The parser will always have to do this, because your data might be a multiple of its internal buffer size. In that case, you'll still have to do your "gross hack", which doesn't really seem that gross a hack to me. Dave

Re: Parser ErrorHandler behavior

2001-07-19 Thread Joseph_Kesselman
According to the SAX spec, if you don't define an ErrorHandler then validation errors are simply discarded. No exception, no other announcement. No, that isn't a great default behavior. But since it's part of a standardized API, Xerces isn't really free to change it. --

RE: Parser external synchronization

2001-04-04 Thread Dean Roddey
You could dummy the implementations out, but it probably wouldn't gain much. Other than in the current DOM implementation, there isn't really much synchronization required. Its already assumed that any use of the parser itself will be synchronized externally. So there is just a little synchronizat

RE: Parser problem

2001-03-27 Thread Jones, Brian O.
Thanks that's what I need, I appreciate all the help. > -Original Message- > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, March 27, 2001 11:45 AM > To: [EMAIL PROTECTED] > Subject: RE: Parser problem > > > Hi, Br

RE: Parser problem

2001-03-27 Thread peiyongz
Hi, Brian, Please try this. DOM_NodeList nodeList = doc.getElementsByTagName("HostName"); // Not "Server" for( unsigned int i=0; i on 03/27/2001 11:05:21 AM Please respond to [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" <[EMAIL P

RE: Parser problem

2001-03-27 Thread Jones, Brian O.
27, 2001 10:57 AM > To: [EMAIL PROTECTED] > Subject: Re: Parser problem > > > Hi, Brian, > > Is the ###doc### a typo? > > for(DOM_Node child=doc.getFirstChild(); child!=NULL; > child=child.getNextSibling() ) > { > if

Re: Parser problem

2001-03-27 Thread peiyongz
Hi, Brian, Is the ###doc### a typo? for(DOM_Node child=doc.getFirstChild(); child!=NULL; child=child.getNextSibling() ) { if (child.getNodeType()== DOM_Node::ELEMENT_NODE) { int chTypeNode = child.getNodeType(); DOMString chNodeName = child.getNodeName();