To get the value of a known attribute, do something like this:
SOAPParameter *p; // Given a pointer to a parameter
SOAPParameter::Attrs::Iterator href = p->GetAttributes().Find("href");
if (href)
{
const char *value = href.Item().GetName();
...
}
To iterate over all attributes on a parameter you would do something like this:
for (SOAPParameter::Attrs::Iterator i = p->GetAttributes().Begin(); i; ++i)
{
const char *name = i.Key().GetName();
const char *value = i.Item().GetName();
...
}
The Key and Item values in the Hashmap are of type SOAPQName. The GetName() method returns the name portion of the QName and is most likely the value you are interested in.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
How can i readout attributes from a parameter?
I dont understand the stuff with the SOAPHashMap.
Could anyone give me a example?
Thanks,
Thomas
To get the value of a known attribute, do something like this:
SOAPParameter *p; // Given a pointer to a parameter
SOAPParameter::Attrs::Iterator href = p->GetAttributes().Find("href");
if (href)
{
const char *value = href.Item().GetName();
...
}
To iterate over all attributes on a parameter you would do something like this:
for (SOAPParameter::Attrs::Iterator i = p->GetAttributes().Begin(); i; ++i)
{
const char *name = i.Key().GetName();
const char *value = i.Item().GetName();
...
}
The Key and Item values in the Hashmap are of type SOAPQName. The GetName() method returns the name portion of the QName and is most likely the value you are interested in.