Re: parsing DOM tree: How to get attribute values ( I don ╢t like mondays)

2003-03-25 Thread Vitaly Prapirny
"Andreas B. Thun" wrote: > > >XMLCh* attrName = XMLString::transcode(attributeName); > >attrVal = nodeElement->getAttribute(attrName); > >delete [] attrName; XMLString::release(&attrName); Would it be better ? > > Yep. Now it╢s perfect. > > ---

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
It is my opinion that if you already know the names of your attributes, it would be more efficient to just walk the attribute list ONCE and keep picking out the attributes you encounter. of course you are right but in my case the XML file is small. There are only 4 attribute lists defined in the DT

RE: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread vinayak
makes no sense to compare with this attrib again when you want to get attrib2... just my two cents. -Vinayak > -Original Message- > From: Andreas B. Thun [mailto:[EMAIL PROTECTED] > Sent: Monday, March 24, 2003 11:31 AM > To: [EMAIL PROTECTED] > Subject: Re: parsing DOM tree:

Re: parsing DOM tree: How to get attribute values ( I don ´t like mondays)

2003-03-24 Thread Andreas B. Thun
XMLCh* attrName = XMLString::transcode(attributeName); attrVal = nodeElement->getAttribute(attrName); delete [] attrName; Yep. Now it´s perfect. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread David N Bertoni/Cambridge/IBM
d N Bertoni/Cambridge/IBM) Subject: Re: parsing DOM tree: How to get attribute values ( I don´t 03/24/2003 08:26 like mondays) AM

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
wow ! we are all really very glad that it worked for you :-) please do not put me in the mail filter already! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread vinayak
wow ! we are all really very glad that it worked for you :-) > -Original Message- > From: Andreas B. Thun [mailto:[EMAIL PROTECTED] > Sent: Monday, March 24, 2003 11:26 AM > To: [EMAIL PROTECTED] > Subject: Re: parsing DOM tree: How to get attribute values ( I don´t

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
it works!! finally, here is the proper code for the archive: // --- // printAttributeValue // --- static void printAttributeValue(DOMNode *node, char *at

Re: parsing DOM tree: How to get attribute values ( Idon´t like monday s)

2003-03-24 Thread Alberto Massari
At 16.55 24/03/2003 +0100, you wrote: The C++ syntax for static cast is static_cast(node) Good try. Unfortunately it has not helped. :-/ Time to get drunk... I think so; has the following code been written *after* my e-mail? I still see the parenthesis "()" instead of the angle brackets "<>" arou

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
The C++ syntax for static cast is static_cast(node) AAAHH! I see! < not ( !!! ...bloody C... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
The C++ syntax for static cast is static_cast(node) Good try. Unfortunately it has not helped. :-/ Time to get drunk... // --- // printAttributeValue // --

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
I am attaching the new domcount file for your convenience. Thank you. In DOMCount, getAttributes() is used. IMHO to retrieve the attribute by name I must use getAttribute(). ?! Do I? - To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread vinayak
IL PROTECTED] > Subject: Re: parsing DOM tree: How to get attribute values ( I don´t > like mondays) > > > > you may want to take a look at the new DomCount.cpp file. > This comes with the samples. I believe it has an example of > accessing and using attributes. > > s

Re: parsing DOM tree: How to get attribute values ( Idon´t like mondays)

2003-03-24 Thread Alberto Massari
At 16.26 24/03/2003 +0100, you wrote: [...] nodeElement = static_cast(DOMElement *) (node); // what is the problem? The C++ syntax for static cast is static_cast(node) Alberto - To unsubscribe, e-mail: [EMAIL PROTECTED

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
you may want to take a look at the new DomCount.cpp file. This comes with the samples. I believe it has an example of accessing and using attributes. scanned all examples. No getAttribute found - To unsubscribe, e-mail: [EMAIL

RE: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread vinayak
; To: [EMAIL PROTECTED] > Subject: Re: parsing DOM tree: How to get attribute values ( I don´t > like mondays) > > > > printAttributeValue(typeChild->getFirstChild(), "min"); > > Thx. That helped a lot. In my opinion the first child of ElementLength > was the

Re: parsing DOM tree: How to get attribute values ( I don´t like mondays)

2003-03-24 Thread Andreas B. Thun
printAttributeValue(typeChild->getFirstChild(), "min"); Thx. That helped a lot. In my opinion the first child of ElementLength was the attribute min. And by the way, getFirstChild() returns a DOMNode* which doesn't have the getAttribute method. You need to cast it to an DOMElement*, see below. Yo

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
den -Original Message- From: Andreas B. Thun [mailto:[EMAIL PROTECTED] Sent: den 24 mars 2003 12:10 To: [EMAIL PROTECTED] Subject: Re: parsing DOM tree: How to get attribute values Thx, Erik and Paul but ... how can I get the element? I selected the right node (ElementLength) but I cannot comp

Re: parsing DOM tree: How to get attribute values

2003-03-24 Thread Andreas B. Thun
Thx, Erik and Parul but ... how can I get the element? I selected the right node (ElementLength) but I cannot compile this because getAttribute is not a member of the DOMElement class. I tried getAttributeNode, but it doesn´t work, either... Jeez. I am completely stuck now. No ideas any more... May

Re: parsing DOM tree: How to get attribute values

2003-03-24 Thread Andreas B. Thun
Thx, Erik and Paul but ... how can I get the element? I selected the right node (ElementLength) but I cannot compile this because getAttribute is not a member of the DOMElement class. I tried getAttributeNode, but it doesn´t work, either... // ---

RE: parsing DOM tree: How to get attribute values

2003-03-24 Thread Baliyan, Parul
I'm not sure about this but following code will help u out // temp is the pointer to ElementLength element in your xml. So if it not a very first elemnt //trace down till the lement whose attribute u want to get /*here with this code if u will print the value of temp by usin DOMNode *temp = eleme

RE: parsing DOM tree: How to get attribute values

2003-03-24 Thread Erik Rydgren
Yes this is the function you would use to retreive attribute values and it should look something like this. cElement* poElementLength = poParent->getFirstChild(); // or something that retrives the correct element const char* pzMin = XMLString::transcode(poElementLength->getAttribute("min")); const

Re: parsing DOM tree: How to get attribute values

2003-03-24 Thread Andreas B. Thun
No it obviously is not How can I retrieve the values by name? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]