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
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
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
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
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
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.
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?
-
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
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
]
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
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:
: [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
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
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
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
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
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
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
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
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
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
|
| cc:
|
| Su
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
: <[EMAIL PROTECTED]>
|
| cc:
|
| Subject
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
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
]" <[EMAIL PROTECTED]>
|
| cc:
|
| Subject
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
|
| To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
|
| cc:
|
| Subject
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
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
[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
---|
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
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
>
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?
>
>
>
>
>
> |-+---
: <[EMAIL PROTECTED]>
|
| cc:
|
| Subject
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"
>
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
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
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
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
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
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
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
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 =
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
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
> ./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
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
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
> 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
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
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
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.
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
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.
--
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
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
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
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
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();
61 matches
Mail list logo