RE: Accessing file position information during a SAX parse

2004-11-16 Thread Erik Rydgren
Try this path: SAXParser().getScanner().getSrcOffset() The problem is that the getScanner method is protected. You might inherit the SAXParser into your own class to get access. But it should give you the number of characters eaten by the XMLReader. That is the current fileposition. / Erik > --

RE: validating against multiple XSD File

2004-11-15 Thread Erik Rydgren
Well it looks to me that you are trying to reference a type. Try referencing an element instead. Declare a math element in your math scema and reference to it. http://www.w3.org/2001/XMLSchema"; targetNamespace="http://www.isis.vanderbilt.edu/2004/schemas/math"; xmlns:math="http://www.isis.

RE: More include Schema in a Schema problems

2004-11-05 Thread Erik Rydgren
ments with no prefix will have an ecb namespace. As a result, the inner 'Cube' element is invalid. If you change the xmlns declaration to xmlns:eb, and use the eb prefix with the 'Cube' child element of Envelope, your XML document will parse fine. Regards, Khaled

RE: More include Schema in a Schema problems

2004-11-05 Thread Erik Rydgren
idator selects the wrong Cube definition. That suspicion was strengthened after a look at the output from PSVIWriter. It seems like the system uses the same typedefinition for Cube disregarding of which context the Cube element occurrs in. I did a quick edit of the ecb.xsd to use this format

More include Schema in a Schema problems

2004-11-04 Thread Erik Rydgren
As I said XmlSpy regards the data as valid but Xerces tells me that Cube is not valid content to envelope. I can't figure out what the problem is. Any help would be greatly appriciated. Best regards Erik Rydgren - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Simple SAX-C++-Parser Documentation - Newbie

2004-06-11 Thread Erik Rydgren
No there is only one namespace for the whole Xerces package. I just realized that I wrote the wrong namespace for you last time. It should have been XERCES_CPP_NAMESPACE and not XALAN_CPP_NAMESPACE. Sorry. My bad. / Erik > -Original Message- > From: Andre Stock [mailto:[EMAIL PROTECTED] >

RE: Simple SAX-C++-Parser Documentation - Newbie

2004-06-11 Thread Erik Rydgren
The default handler is only a stub interface (it does nothing). As you suggested you'll have to inherit the DefaultHandler and override the methods you need. / Erik > -Original Message- > From: Andre Stock [mailto:[EMAIL PROTECTED] > Sent: den 11 juni 2004 09:37 > To: [EMAIL PROTECTED] >

RE: Newbie's question -- extracting information from XML file

2004-06-04 Thread Erik Rydgren
Your XML file actually looks like this in a DOM tree. Relation - ELEMENTNODE Whitespace - TEXTNODE Subtype - ELEMENTNODE Whitespace - TEXTNODE The endlines in your document is stored inside the DOM tree as well. You can filter them out using a DOMTreeWalker. Regards / Erik > -Original

RE: Repost: Xerces XML performance problems

2004-05-26 Thread Erik Rydgren
// Obtain list of child nodes > >cChildNodeList = cXMLNodeList->item(i)->getChildNodes(); > > > >// Loop through all child nodes > >for (int j = 0; j < cChildNodeList->getLength(); j++) > >{ > > strcpy(name, > XMLStri

RE: Repost: Xerces XML performance problems

2004-05-25 Thread Erik Rydgren
Can you please provide a snippet of your DOM tree traversing code. It is hard to see what the problem is if we do not know what you are doing. Regards Erik > -Original Message- > From: Nath [mailto:[EMAIL PROTECTED] > Sent: den 25 maj 2004 19:07 > To: [EMAIL PROTECTED] > Subject: Repost:

RE: Linking Xerces C++ statically

2004-05-13 Thread Erik Rydgren
dll) : error LNK2005: __stricmp already defined in > > >libcmt.lib(stricmp.obj) > > >MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strnicmp already > > defined in > > >libcmt.lib(strnicmp.obj) > > >LINK : warning LNK4098: defaultlib 'MSVCRT' conflict

RE: optimizing the xerces libraries

2004-02-26 Thread Erik Rydgren
We use .NET now but we used VS6 before. Changing from dll to static lib is done in project settings -> General -> project defaults -> Configuration type. / Erik > -Original Message- > From: Adam Heinz [mailto:[EMAIL PROTECTED] > Sent: den 26 februari 2004 21:29 > To: [EMAIL PROTECTED] > S

RE: optimizing the xerces libraries

2004-02-26 Thread Erik Rydgren
X unless all of your libraries > (including libgcc.a) have also been compiled with -static." > If the xerces and xalan projects are not self-contained, this could be > a static-killer. > > -Mark > > > > On Feb 26, 2004, at 2:29 AM, Erik Rydgren wrote: > > >

RE: optimizing the xerces libraries

2004-02-26 Thread Erik Rydgren
I recommend static linkage if you want a small footprint. Static linkage does only bring in what you actually use. / Erik > -Original Message- > From: Mark Goldstein [mailto:[EMAIL PROTECTED] > Sent: den 26 februari 2004 02:01 > To: [EMAIL PROTECTED] > Subject: optimizing the xerces libra

RE: Linking Xerces C++ statically

2004-02-17 Thread Erik Rydgren
USE_WIN32_MESSAGELOADER. - Change the defines for PLATFORM_EXPORT and PLATFORM_IMPORT by removing the _declspec(dllexport) and _declspec(dllimport) - Rebuild. Hope I didn't forget anything. Good luck Erik Rydgren Aptic AB Sweden > -Original Message- > From: Chaudhuri, Hiran [mailto:[EMAIL PROTEC

RE: GrammarResolver and noNamespaceSchemaLocation

2004-02-05 Thread Erik Rydgren
7;t mix them. > > So, either: > a) turn off schema caching, > b) use different DOMBuilder/DOMParser to parse XML documents using > different schemas > c) use a targetNamespace in your schemas > > Alberto > > At 14.42 05/02/2004 +0100, Erik Rydgren wrote: > >We have j

GrammarResolver and noNamespaceSchemaLocation

2004-02-05 Thread Erik Rydgren
idea when using namespaces but it doesn’t work for the default namespace. I probably don't see the whole picture here, but why hash on the target namespace and not the systemid of the loaded schema document? Erik Rydgren Software engineer Aptic AB Kåsatorpsvägen 5 SE 541 34 SKÖVDE Sweden tfn:

Implementation of DOMNodeImpl::setTextContent

2004-02-04 Thread Erik Rydgren
is at the same time but I seem to have forgotten to submit it. Could someone please revise and commit the following code? Best regards Erik Rydgren Software engineer Aptic AB *** CODE void DOMNodeImpl::setTextContent(const XMLCh* textContent){ DO

RE: How to get the nodevalue/textcontent of a cdatasection? ? ?

2003-12-02 Thread Erik Rydgren
What version of the parser do you use? The getTextContent method wasn't implemented up to the 2.3.0 version. Using the current implementation I have no problems reading the text content of an element containing CDATASections. / Erik > -Original Message- > From: Thomas Zabel [mailto:[EMAIL

RE: help Xerces c++

2003-11-27 Thread Erik Rydgren
There is only one mailing list, this one. Users are welcome to post implementation questions here but please read the FAQ and look at the examples before posting. Thank you. / Erik > -Original Message- > From: Purdy, Edgar M [mailto:[EMAIL PROTECTED] > Sent: den 26 november 2003 20:16 > T

RE: Document root node

2003-11-24 Thread Erik Rydgren
Well Gareth now you have to read your own code a bit. ;) The replaceChild method on document level works like a charm for replacing the document root element against another element node. Best regards Erik Rydgren > -Original Message- > From: Gareth Reakes [mailto:[EMAIL PRO

RE: Document root node

2003-11-24 Thread Erik Rydgren
Title: Document root node Nothing to it, use the method replaceChild on the DOMDocument.   / Erik   -Original Message- From: Milan Tomic [mailto:[EMAIL PROTECTED] Sent: den 24 november 2003 14:00 To: Xerces-C Subject: Document root node         How can I replace docum

RE: Use local DTD

2003-11-13 Thread Erik Rydgren
Not a command, it is a class. Derive from EntityResolver. Implement the resolveentity method. Connect your resolver to the parser and you are good to go. If your resolver doesn't provide an InputSource then the parser will fallback to the default behavour. Validating a document that doesn't have a

RE: Clone a DOM subtree to the root of a new DOMDocument efficiently ?

2003-11-11 Thread Erik Rydgren
Well I have no problems replacing a document root with the 2.2.0 codebase. I use the following code. The code is pure DOM so no extra fancy stuff, don't mind the wrapper classes. cDocument* poDoc1 = GetDOMImplementation().CreateDocument("", "test", NULL); cDocument* poDoc2 = GetDOMImplementation()

RE: Best way to store parsed objects?

2003-11-10 Thread Erik Rydgren
Parsing BIG files is usually a job for the SAX interface. SAX doesn’t create any internal data structure at all so it is up to you to store the important information in a memory efficient way.   / Erik   -Original Message- From: Yang Wen [mailto:[EMAIL PROTECTED] Sent: den 8

RE: Parser

2003-11-07 Thread Erik Rydgren
t; > > Thank you for your help. I finally succeded to make it work. > > Does Xerces supports XML Schema and/or DTD validation? > > Best regards, > Milan > > > > -Original Message- > From: Erik Rydgren [mailto:[EMAIL PROTECTED] &

RE: Parser

2003-11-07 Thread Erik Rydgren
ct: RE: Parser       Thank you for your help. firstChild() works well, but nextSibling() returns NULL, altough there is more then 1 node. :(   Best regards, Milan     -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 2:48 PM To: [EMAIL PRO

RE: Parser

2003-11-06 Thread Erik Rydgren
ing::release(&strValue); }       It iterates through ALL nodes in the document, but it should show only child nodes (elements) of root node.   Thanks.   Milan     -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: Wednesday, Nov

RE: Parser

2003-11-05 Thread Erik Rydgren
27;d like to see only real elements (i.e. ), nothing else.   Thank you.     -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:33 PM To: [EMAIL PROTECTED] Subject: RE: Parser Use the createTreeWalker method or create

RE: Parser

2003-11-05 Thread Erik Rydgren
.   > easiest is to create a tree iterator that doesn’t show text nodes while traversing the DOM tree.   How can I do that?   Milan     -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 12:58 PM To: [EM

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: crash when using dom parser to parse an invalid xml file

2003-11-03 Thread Erik Rydgren
arse an invalid xml file > > > yes, domcount app. crashes upon parsing as well. > > Regards, > Xuefu > > > > "Erik Rydgren" > <[EMAIL PROTECTED] To: [EMAIL PRO

RE: crash when using dom parser to parse an invalid xml file

2003-10-31 Thread Erik Rydgren
Input of malformed xml should neither throw nor crash. The parse method should only return false and the error is reported through the registered error handler. Have you initialized Xerces before using any of the classes? Are you linking with the correct runtime? Try parsing your input document wi

RE: DOMWriter::nodeWrite is very slow

2003-10-12 Thread Erik Rydgren
There was a bug in the file output source which made the system work unbuffered against the disc. Flushing after every single byte is SLOOOW. Try out the latest build. / Erik > -Original Message- > From: Jarle Aase [mailto:[EMAIL PROTECTED] > Sent: den 11 oktober 2003 04:51 > To: [EMAIL

RE: Writing a big DOM document to a file take very long

2003-10-12 Thread Erik Rydgren
There was a bug in the file output source which made the writing REALLY slow (no buffering). I can't remember which version it was fixed in but I know it is fixed in the last version released. Why not try that one out? / Erik > -Original Message- > From: Patrick Blanchette [mailto:[EMAIL

RE: Efficiency of document fragments?

2003-09-29 Thread Erik Rydgren
Nope the penalty for using document fragments is very low. The fragment has to be allocated / deallocated of course and there will be an extra node insert performed. So the price is low. However if you construct many fragment the overhead will be noticeable. And if you construct a fragment for each

Carrage return in attribute

2003-09-19 Thread Erik Rydgren
way to make the #xA character pass through the parser unharmed? I don’t have a grammar and I don’t have the option of adding one either.   Regards Erik Rydgren Mandarin FS Sweden  

FW: Validation against XML schema without internet connection

2003-09-18 Thread Erik Rydgren
No, all requests for external entities are routed through your entity resolver. Just have the resolver return an inputstream pointing to a local file representing the URL. The parser will only try to open the URL if the entityresolver doesn't provide an inputsource. / Erik > -Original Message

RE: Validation against XML schema without internet connection

2003-09-18 Thread Erik Rydgren
You will have to write an EntityResolver and jack it into the parser. I believe there is an example that shows how to do it. Best regards Erik Rydgren Mandarin FS Sweden > -Original Message- > From: Ilan Nehama [mailto:[EMAIL PROTECTED] > Sent: den 18 september 2003 09:57 >

RE: xerces 1.6.0 questions

2003-09-16 Thread Erik Rydgren
alize the node yourself. Look in the examples for code. Best regards Erik Rydgren Mandarin FS Sweden > -Original Message- > From: Hieu Bui [mailto:[EMAIL PROTECTED] > Sent: den 16 september 2003 16:52 > To: [EMAIL PROTECTED] > Subject: xerces 1.6.0 questions > >

RE: DOM performance/coding issue

2003-09-15 Thread Erik Rydgren
rocess node break; // No need to search for more inner nodes } } pInnerNode = pInnerNode->getNextSibling(); // <-- this one } } pNode = pNode->getNextSibling(); } / Erik > -Original Message- > From: Erik Rydgren > Sent: den 15 september 2003 10:13 >

DOM performance/coding issue

2003-09-15 Thread Erik Rydgren
} But if you know that you'll never will see other nodes than PatchData nodes under the rootnode you don't have to compare tagname for those either. Regards Erik Rydgren Mandarin FS Sweden > -Original Message- > From: David Hoffer [mailto:[EMAIL PROTECTED] > Sent

Another testmessage. Sorry. plz ignore

2003-09-15 Thread Erik Rydgren
Exchange isn't a mailserver, it is a torture device. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Testmessage, plz ignore.

2003-09-15 Thread Erik Rydgren
test - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: linkproblems

2003-07-17 Thread Erik Rydgren
[EMAIL PROTECTED]; Erik Rydgren > Subject: Re: linkproblems > > On Wednesday 16 July 2003 13:37, Erik Rydgren wrote: > > Just feed the linker the required libraries and these errors should go > > away. > > I fear that the problem might be more complicated than it

RE: parser->parse() question

2003-07-16 Thread Erik Rydgren
t;parse() question > > > In continuation of my public humiliation thread ;-) > > I can't find the implementation of DOMNode::release() > > I can find DOMNodeImpl::release() and many others...but not > DOMNode::release() > > > > |-----+----

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] > Subject: RE: parser->parse() quest

RE: Validating XML docs against a Schema

2003-07-16 Thread Erik Rydgren
No the parser never throws on invalid input. The parser calls the errorhandler, aborts the parse and returns false. If you want the parser to throw an exception then you'll have to throw the exception in the errorhandler. / Erik > -Original Message- > From: Suchit Batheja [mailto:[EMAIL P

RE: RE: linkproblems

2003-07-16 Thread Erik Rydgren
lem is that the dependencies comes from libxerces- > c.so.22, > so I must know exactly what shared libary they depend on and make sure > that I > have them installed and that I can link with them? > > //daniel > > > Erik Rydgren (2003-07-16 13:37): > >A shared library

RE: linkproblems

2003-07-16 Thread Erik Rydgren
A shared library never includes dependencies. It would go against its very purpose, to provide a library of code that an application can use parts of. Which external libraries that is required for a specific purpose is not known until you actually link a complete application. Just feed the linker

RE: RE: C/C++ library (api's) to generate XML doc umen t

2003-07-16 Thread Erik Rydgren
Yes I believe that you can but you'll have to remove the sourcefiles one by one yourself. There is no switch for the makefile or anything else simple. If I were you I would start out with the utils, platform support, internal, DOM (dump the deprecated stuff, take just impl) and then add any other f

RE: parser->parse() question

2003-07-15 Thread Erik Rydgren
I would guess that the whole subtree is released but to be sure you'll have to read the large documentation (the one that starts with the function main). Oh the wonderful world of open source... :) / Erik > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: den

RE: parser->parse() question

2003-07-14 Thread Erik Rydgren
| > | > | > | To: <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> > | > | cc: > | > | Subject: Re: parser->parse() question > | > >------- >

RE: Validating a XML Document to an External Schema

2003-07-14 Thread Erik Rydgren
You need to set an errorhandler. The parser reports all document errors to an errorhandler. Just inherit the class ErrorHandler and implement the virtual methods. Then create an instance of your ErrorHandler and connect it to the parser with the setErrorHandler method. / Erik > -Original Mess

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: Help with xPath and DOM

2003-07-14 Thread Erik Rydgren
etNextSibling(); } } As I said. This is usually best done in Xalan but if you need a small footprint and can't handle the overhead applied by Xalan then do it in DOM. But Xalan WILL make your application more flexible and easier to maintain when requirements change. Regards Erik Rydgren

RE: parser->parse() question

2003-07-14 Thread Erik Rydgren
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 called on the parser. Do a reset before each parse and smile just like Gareth says unless you REALLY want to

RE: getTextContent()

2003-07-13 Thread Erik Rydgren
ngLength+1) * sizeof(XMLCh)); getTextContent(pzBuffer, nStringLength); pzBuffer[nStringLength] = 0; return pzBuffer; } Regards Erik Rydgren Mandarin IT Sweden > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: den 11 juli 2003 21:54 > To: [EMAI

RE: Subtree validation

2003-07-03 Thread Erik Rydgren
> As far as i know the DOM core level 3 is released and being usedis > there > any support for this in Xerces C++ to validate a subtree > > -Original Message- > From: Erik Rydgren [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 03, 2003 6:31 PM > To: [

RE: Subtree validation

2003-07-03 Thread Erik Rydgren
The sad answer is: you can't. Validation of a DOM tree is DOM core level 3 which is still in working draft. It is definitely planed to be implemented. But when? I don't know. Regards Erik Rydgren Mandarin IT Sweden > -Original Message- > From: Paramdeep Ahuja [mailto:

RE: XMLString handler

2003-06-11 Thread Erik Rydgren
hild(); while ( node != null ) { node.setNodeValue(value); node = node.getNextSibling(); } Regards Erik Rydgren Mandarinen systems AB Sweden - .H file - // // **

RE: Ownership of const XMLCh *

2003-06-03 Thread Erik Rydgren
Every pointer that is returned is owned by the document. You shouldn't deallocate them. regards /Erik -Original Message- From: Colin Paul Adams [mailto:[EMAIL PROTECTED] Sent: den 2 juni 2003 16:52 To: [EMAIL PROTECTED] Subject: Ownership of const XMLCh * When a method such as DOMNode::

RE: DOMNode::removeChild(oldChild) etc

2003-05-30 Thread Erik Rydgren
With a quick look it seems like it is the same object that is returned. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 29 maj 2003 22:39 To: [EMAIL PROTECTED] Subject: DOMNode::removeChild(oldChild) etc

RE: setTextContent

2003-04-03 Thread Erik Rydgren
Frell! (*slaps myself for using Farcape reference*) I read the specification again. And I think I got it this time. http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#Node3-textC ontent "When it is defined to be null, setting it has no effect." Content is defined to be null for DO

setTextContent

2003-04-03 Thread Erik Rydgren
re it is in the normal format: Compiled but untested. Please verify. I had one issue though and it is commented in the code. Regards Erik Rydgren Mandarinen systems AB Sweden void DOMNodeImpl::setTextContent(const XMLCh* textContent){ if (textContent != NULL) { if (isRea

RE: does Xerces-C support XPointer?

2003-04-03 Thread Erik Rydgren
Well no. Xerces does not support XPointer. And me personally doesn't know any other cross platform XML parser that does. Anyone else that does? / Erik -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: den 3 april 2003 15:51 To: [EMAIL PROTECTED] Subject: does Xer

RE: xerces shared lib size

2003-04-03 Thread Erik Rydgren
ike it was designed to be scripted isn't it? :) Combined with funtion level linking you will end up with the smallest binary image you can get because only those functions that you actually use is linked in from Xerces. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message-

RE: Implementing getTextContent

2003-04-02 Thread Erik Rydgren
o put the method in the impl file and cast down to it. Gareth On Wed, 2 Apr 2003, Erik Rydgren wrote: > I agree that this is a good way of providing both functionalities and it > actually made implementation a bit easier. > I took the liberty to write the whole shabang down in code. >

RE: Implementing getTextContent

2003-04-02 Thread Erik Rydgren
. Regards Erik Rydgren Mandarinen systems AB Sweden --- CODE --- const XMLCh* DOMNodeImpl::getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const { unsigned int nRemainingBuffer = rnBufferLength; rnBufferLength = 0; if (pzBuffer) *pzBuffer = 0; DOMNode *this

RE: Implementing getTextContent

2003-04-01 Thread Erik Rydgren
I agree, I like consistency. Let's register the string into the document by allocating the memory on the documents heap. Although, the result can be very large. Should we allow the user to release the memory when not used anymore? How? / Erik -Original Message- From: Gareth Reakes [mailto

RE: Implementing getTextContent

2003-04-01 Thread Erik Rydgren
PROTECTED]; [EMAIL PROTECTED] Subject: RE: Implementing getTextContent Hi, Eric is correct. Take a look at http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#Node3-t extContent for a more full explanation of what the method should do. Gareth On Mon, 31 Mar 2003, Erik Rydgren wro

RE: Implementing getTextContent

2003-03-31 Thread Erik Rydgren
Using my best judgement I'd have to say yes. CDATA section should also be included. CDATA nodes is only a specialization of text nodes to prevent parsing of markup. / Erik -Original Message- From: Magnus Strand [mailto:[EMAIL PROTECTED] Sent: den 31 mars 2003 16:26 To: [EMAIL PROTECTED]

RE: DOM thread safe

2003-03-30 Thread Erik Rydgren
ed to implement a reader/writer lock to protect your document if you'll want access to a document from multiple threads. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Bagepalli, Kiran [mailto:[EMAIL PROTECTED] Sent: den 29 mars 2003 02:36 To: '[EMAIL PROT

RE: Re: Getting text off all subnodes

2003-03-27 Thread Erik Rydgren
currentNode = nodeIterator.nextNode(); } } return pzContentStr; } This of course forces the user to delete the returned string, which is non-standard behavour. BTW, this is completly untested code. It compiles but not more. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Messag

RE: Validating DOM

2003-03-25 Thread Erik Rydgren
eventhandler. In the eventhandler do your extended validations. If valid, add the element to a document tree (hence build your own DOMDocument with the standard DOMDocument API) Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Bagepalli, Kiran [mailto:[EMAIL

RE: parsing DOM tree: How to get attribute values

2003-03-24 Thread Erik Rydgren
You need to cast it to an DOMElement*, see below. // Erik -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED] Sent: den 24 mars 2003 14:02 To: [EMAIL PROTECTED] Subject: RE: parsing DOM tree: How to get attribute values Oh THAT! :) Just cast your DOMNode* to a DOMElement*. I

RE: parsing DOM tree: How to get attribute values

2003-03-24 Thread Erik Rydgren
Oh THAT! :) Just cast your DOMNode* to a DOMElement*. If you are paranoid then you can do a check that the node really is an element. DOMElement poElement = NULL; if (poNode->getType() == ELEMENT_NODE) poElement = static_cast(poNode); Regards Erik Rydgren Mandarinen systems AB Swe

RE: parsing DOM tree: How to get attribute values

2003-03-24 Thread Erik Rydgren
e("min")); const char* pzMax = XMLString::transcode(poElementLength->getAttribute("max")); // use the values delete pzMin; delete pzMax; Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Andreas B. Thun [mailto:[EMAIL PROTECTED] Sent: den 24 mars 20

RE: To access DOMParser object from EntityReolver

2003-03-19 Thread Erik Rydgren
at a given time. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Shirish Kulkarni [mailto:[EMAIL PROTECTED] Sent: den 19 mars 2003 08:48 To: [EMAIL PROTECTED] Subject: To access DOMParser object from EntityReolver Hi, The xerces DOMParser is observed to b

RE: DOCTYPE problems

2003-03-17 Thread Erik Rydgren
This is a known bug which has been fixed. I'm not sure in which version the patch first appered. It should be in the latest stable build (2.2) though. Download and try it out. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Mark Van Orman [mailto:[

RE: DOCTYPE node

2003-03-04 Thread Erik Rydgren
Yes the doctype must be specified in the XML file to be able to be loaded by a validating parser. It is XML standard. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Raghu Nandan [mailto:[EMAIL PROTECTED] Sent: den 3 mars 2003 22:23 To: [EMAIL PROTECTED

RE: Retrieving a specific element in an XML doc, when it belongs to a namespace.

2003-02-28 Thread Erik Rydgren
Take a look at the getElementsByTagNameNS method. A simple getElementsByTagNameNS("*", "alarm") would suffice. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Axelle Apvrille (LMC) [mailto:[EMAIL PROTECTED] Sent: den 28 februari 2

RE: Special #text nodes when parsing XML doc with DOM ?

2003-02-28 Thread Erik Rydgren
element. This will make the document almost unreadable for a human eye though. Another way is to create a TreeWalker/TreeIterator that filters out all textnodes during traveral of the DOMDocument or diong it manually by checking the nodeType() for each node you process. Regards Erik Rydgren Mandarinen

Memoryleak, DOMDocument forgets to delete doctypeNode.

2003-02-27 Thread Erik Rydgren
lease function instead. Those who need brutal performance can still use the DOMDocumentImpl::createDocumentType() - DOMDocumentImpl::setDocumentType() combo. Suggestions? Flames? Anyone who want to send me the biggest fryingpan in the cupboard to swat bugs with? Regards Erik Rydgren Mandarinen s

RE: appendChild

2003-02-20 Thread Erik Rydgren
c1 to doc2 doc1_root = doc1.getDocumentElement(); doc2_root = doc2.getDocumentElement(); cloned_nodes = doc2.importNode(doc1_root, true); // Deep node tree cloning doc2_root.appendChild(cloned_nodes); Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Williams, R

RE: Xerces C++ compiler

2003-02-19 Thread Erik Rydgren
++ i do not know. You will just have to test it. http://xml.apache.org/dist/xerces-c/stable/xerces-c2_2_0-linux7.2Proton.tar. gz If it isn't then compiling Xerces source with gcc should be a breeze. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Esther Par

RE: how to extract xml fragments while parsing with SAX

2003-01-29 Thread Erik Rydgren
gain using another parser. (BBTW, I think we might be able to make MemBufFormatTarget Class a little (Bfaster if we use 'realloc()' instead of 'new', 'delete', and 'memcpy()'. I (Bdo hope they will add this feture the next time. (B (BBest Regards (B (BLei

RE: How can I feed the DTD independently from the working directory?

2003-01-29 Thread Erik Rydgren
Take a look at the EntityResolver functionality. An entityresolver translates public and system id's to InputSources for the parser to use. In other words, you can store the DTD anyway you want. Filesystem, database, resource... only you set the limit. / Erik -Original Message- From: Sven

RE: how to extract xml fragments while parsing with SAX

2003-01-29 Thread Erik Rydgren
Take a look at the class SAXPrintHandlers. It does just that. It writes (Bnodes to a XMLFormatter from SAX interface calls. (BI think the easiest way for you to go is to inherit the class (BSAXPrintHandlers into you own class and override those methods you need (B(startElement, endElement and s

RE: is it possible to append instead of rewrite entire XML file output?

2003-01-17 Thread Erik Rydgren
Well your program doesn't seem to need the actual XML functionality but rather a log. Why not just barf out the file in a non valid format like: It is not parsable as a file like this but if you just put the xml declaration and a root node starttag and endtag on it then the fi

RE: Finding the schema

2003-01-17 Thread Erik Rydgren
Yes this is exactly what the EntityResolver is for. Usage: Override the EntityResolver class. Implement the ResolveEntity method. Return a InputSource for a known entity or return null to use the normal Xeces behavour. Create an instance of your EntityResolver and plug it into the parser with the

RE: still can't find DTD for my DOM program

2003-01-16 Thread Erik Rydgren
The entity resolver is a functionality actually stolen from SAX to DOM and if I'm not mistaken it is proposed as a DOM standard as well. It is not DOM standard yet, but it has been a part of Xerces DOM for a long time. Lemme check how you can plug it in... *lots of muffled dissorganized searching*

RE: loadGrammar

2003-01-16 Thread Erik Rydgren
hanging by a thin thread. If I need the performance then the DTD gets axed in a heartbeat (we also have a controlled environment and I have yet to see a corrupted package) Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Bagepalli, Kiran [mailto:[EMAIL PROTECTED

RE: whitespace problem- help!

2003-01-15 Thread Erik Rydgren
t ourselves and this is one piece of code I do not have to look at anymore. Although it contains classes that I will not give to you (cXMLString is to large), but it is an easy modification to make it work. Regards Erik Rydgren Mandarinen sy

RE: Dom Bridge

2003-01-09 Thread Erik Rydgren
Damn! I was to slow typing this. First thing I saw after I sent it was that someone else had given the same answer and code to come with it! Man I do LOVE this mailing list :) / Erik -Original Message- From: Erik Rydgren [mailto:[EMAIL PROTECTED]] Sent: den 9 januari 2003 19:01 To

RE: Dom Bridge

2003-01-09 Thread Erik Rydgren
user traverses the whole tree and hence you will have to create and hold the whole tree in memory. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message- From: Alan LaViolette [mailto:[EMAIL PROTECTED]] Sent: den 9 januari 2003 17:42 To: [EMAIL PROTECTED] Subject: Dom Bridge

RE: DTD caching

2002-12-30 Thread Erik Rydgren
Yes you can use the caching in the parser. And frankly it is THE way to go, if you like speed that is :) Simplest way to go: poParser->setFeature(XMLUni::fgXercesCacheGrammarFromParse, true); Then use the same parser for all parses (do not delete it). The grammar will be cached on the first pars

RE: sample code?

2002-12-17 Thread Erik Rydgren
The difference is that the XercesDOMParser is a little bit more low level. But if you want to be more W3C DOM level 3 compliant then use the DOMBuilder. The only added functionality for you in the XercesDOMParser as I suggested was the adoptDocument which removes your need for a document clone. The

RE: Serializer will not accept doctype?

2002-12-16 Thread Erik Rydgren
> > Check a known bug in hangon... *much muffled noises and irrational > > searching* > > [ CODE REMOVED ] > I changed that line of code and now everything works OK :-) > THANK YOU! You saved my day (and my paper :-) No worries mate. But you are lucky. The reason that I could identify the pro

RE: Serializer will not accept doctype?

2002-12-16 Thread Erik Rydgren
now trashes. It should be this instead. internalSubset = docImpl->cloneString(internalSubset); Then you will get your SYSTEM identifiers back. PS: This was fixed quite a while ago and is present in the nightly build. Regards Erik Rydgren Mandarinen systems AB Sweden -Original Message

  1   2   >