"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.
>
> ---
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
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:
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
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
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]
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
it works!!
finally, here is the proper code for the archive:
// ---
// printAttributeValue
// ---
static void printAttributeValue(DOMNode *node, char *at
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
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]
The C++ syntax for static cast is static_cast(node)
Good try. Unfortunately it has not helped. :-/
Time to get drunk...
// ---
// printAttributeValue
// --
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
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
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
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
; 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
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
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
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
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
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...
// ---
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
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
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]
24 matches
Mail list logo