[fw4spl-discuss] Help with accessing tags in XML

5 views
Skip to first unread message

Anant Vemuri

unread,
May 18, 2010, 6:39:26 AM5/18/10
to fw4spl-...@googlegroups.com
Hi,

I am creating a bundle in which I need to specify tags as below. I was wondering if anyone could help me with the procedure to access it

<config ... >
    <tagID val1="1" val2="t1" />
    <tagID val1="2" val2="t2" />
    <tagID val1="3" val2="t3" />
</config>

How can I access these multiple entries of tagID?

Thank you,

Best regards,
Anant.

--
Anant S. Vemuri
email: anant...@gmail.com

Vincent Agnus

unread,
May 18, 2010, 8:38:17 AM5/18/10
to fw4spl-...@googlegroups.com
Hi Anant,

you can try ConfigurationElement::find method


configElement points to <config ... >

std::vector < ::fwRuntime::ConfigurationElement::sptr > tagIdElements = 
configElement->find("tagID");
BOOST_FOREACH ( ::fwRuntime::ConfigurationElement::sptr tagId tagIdElements)
{
   int val1= ::boost::lexical_cast<int>( 
tagID->ggetAttributeValue("val1") );
   // ...
}

2010/5/18 Anant Vemuri <anant...@gmail.com>
Reply all
Reply to author
Forward
0 new messages