Print Page | Close Window

[Closed] XML Help Please

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4592
Printed Date: 21 December 2024 at 8:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Closed] XML Help Please
Posted By: Simon HB9DRV
Subject: [Closed] XML Help Please
Date 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



Replies:
Posted By: Simon HB9DRV
Date 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


Posted By: Oleg
Date 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


Posted By: Simon HB9DRV
Date 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


Posted By: Oleg
Date 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


Posted By: Simon HB9DRV
Date 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


Posted By: Oleg
Date Posted: 15 July 2006 at 11:14am

ok, ok :) Added for next release.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net