[Closed] XML Help Please |
Post Reply |
Author | |
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
Posted: 14 July 2006 at 5:11am |
<?xml version="1.0"?>
<enumerations CompactMode="1"> <!-- Sample ARRL Sections file --> <choices id="arrl-sections" xml:lang="EN"> <item><label>Alabama</label><value>AL</value></item> ... Question - how do I extract Alabama and AL? I can iterate the item data but don't know how to use the Codejock classes to get these values. Here's where I am so far, in the while loop I am iterating the <item></item> data but need to dig out the label and value strings: ... CXTPPropExchangeEnumeratorPtr ptrEnumeratorItem(pPXSec->GetEnumerator(_T("item"))); POSITION posItem = ptrEnumeratorItem->GetPosition(0); while (posItem) { CXTPPropExchangeSection secItem(ptrEnumeratorItem->GetNext(posItem)); // NOW WHAT :-( } Thanks, Simon |
|
Simon HB9DRV
|
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
Well I answered this myself - it seems that the Codejock classes cannot handle a mixture of CompactMode and non-CompactMode as in:
<value lower="0.136" upper="0.137">2190m</value> whereas other parsers can. What's the clever way of extracting lower, upper and value without toggling the CompactMode setting? |
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
I can only suggest to switch SetCompactMode when you need to get text.
I think we will add some smarter way for next release.
Thank you.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
Hi,
Thanks - what's really needed is a good example which iterates a non-Codejock XML file, maybe there are some test XML files out on there. I don't mind switching - I'm wrapping my own class around the Codejock classes and test which mode to use with IsSectionExists - so in fact you could add this easily. Cheers, |
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Primary porpose of PropExchange is storing configurations (XML/Archive/Registry) - not parse XML files....
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Simon HB9DRV
Senior Member Joined: 07 July 2005 Location: Switzerland Status: Offline Points: 458 |
Post Options
Thanks(0)
|
I agree, but Codejock has done a lot of very good work - with a little extra effort you have an excellent set of classes for XML support. |
|
Simon HB9DRV
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok, ok :) Added for next release. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |