It true.
Use Xercesc, and lenguaje is C++.
The next link is the documentation the Attributes Class
http://xml.apache.org/xerces-c/apiDo...ttributes.html
and show howto get atributes
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
There are two ways for the SAX application to obtain information from
the Attributes. First, it can iterate through the entire list:
public void startElement (String uri, String localpart, String qName,
Attributes atts) {
for (int i = 0; i < atts.getLength(); i++) {
String Qname = atts.getQName(i);
String URI = atts.getURI(i)
String local = atts.GetLocalName(i)
String type = atts.getType(i);
String value = atts.getValue(i);
[...]
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
****2
As an alternative, the application can request the value or type of
specific attributes:
public void startElement (String uri, String localpart, String qName,
Attributes atts) {
String identifier = atts.getValue("id");
String label = atts.getValue("label");
[...]
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
I use the ****2 but when compile the next
public void startElement (String uri, String localpart, String qName,
Attributes atts) {
String identifier = atts.getValue("id");
}
send this error:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
error C2664: 'const XMLCh *xercesc_2_7::Attributes::getValue(const
unsigned int) const' : cannot convert parameter 1 from 'const char
[12]' to 'const unsigned int'
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
any of you have the error using Visual Studio 2005 C++ ??
ok
ATTE
Fuy
Joe Kesselman ha escrito:
It might help to tell us what library you're working with. I presume
it's something in C++, judging from the syntax.
From what you've shown us, looks like the Attributes object is behaving
like an array and wants you to give the getValue operation an integer
offset into that array. There may be a completely different function for
retrieving attribute value by name. Read The Fine Manual?
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry