Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [Closed] XML Help Please
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Closed] XML Help Please

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: [Closed] XML Help Please
    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
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2006 at 8:10am
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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2006 at 8:49am
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
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2006 at 8:53am
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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 July 2006 at 9:11am
Hello,
 
Primary porpose of PropExchange is storing configurations (XML/Archive/Registry) - not parse XML files....
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2006 at 12:26am
Originally posted by oleg oleg wrote:

Hello,
 
Primary porpose of PropExchange is storing configurations (XML/Archive/Registry) - not parse XML files....

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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 July 2006 at 11:14am

ok, ok :) Added for next release.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.