How to locate homescreen variables within XML text blocks |
![]() ![]() |
How to locate homescreen variables within XML text blocks |
Nov 12 2004, 00:44
Post
#1
|
|||
|
Regular Group: Posters Posts: 109 Joined: 28th March 2003 Member No.: 4,033 |
I know almost nothing about the MS XML document object model. I knew that a homescreen plugin was passed two IXMLDOMNode as parameters, and that every parsing example I could find used get_text to grab the text inside a label. All fine and dandy, except I wanted to implement variables within the label just like the calendar and messaging plug-ins do. (e.g. ,
I spent a good many hours on this one and finally came to a solution. It may not be the "correct" solution. I'm posting this here in the hopes of saving someone else a few dozen hours. The trick (obvious to most maybe?) is to parse the tree all the way down, to the "text" node's children. There I found the text broken up and ordered, with the parsed XML variables in between. Example: |
||
|
|
|||
Feb 1 2005, 08:38
Post
#2
|
|||
|
Addict Group: Posters Posts: 546 Joined: 22nd April 2004 From: Australia Member No.: 40,928 Device(s): o2 xphone / imate 2 |
I had the same hassle so I just ended up grabbing the raw xml for the text node, stripping off the
Cheers Bretto -------------------- Cheers
Bretto -------------------------------------------- "Lifes a garden...DIG it!" -------------------------------------------- o2 xphone (e200) wm2003 Imate 2 (HTC Himalaya) wm2003se O2 xda2 (HTC Himalaya) wm2005 O2 xda2 Mini (Magician) "Say hello to my little friend.." |
||
|
|
|||
Feb 10 2005, 21:21
Post
#3
|
|||
|
Newbie Group: Posters Posts: 13 Joined: 10th February 2005 From: Germany Member No.: 109,866 Device(s): T-Mobile SDA music |
I took the same approach as you. Parse the text node's child nodes.
Another thing I was also struggling with is that get_text() trims the string, i.e. leadind and trailing spaces will be removed, which is annoying when you want to do variable substitution inside a string. I used get_nodeValue() instead. Thanks Bruno |
||
|
|
|||
![]() ![]() |
Similar Topics
| Topic | Replies | Topic Starter | Views | Last Action | |
|---|---|---|---|---|---|
![]() |
Pinned: The easy way to boost your default volume settings |
130 | Hendrickson | 63,183 | Today, 01:36 Last post by: ciscokidinsf |
![]() |
How can I add to my Omnia???? |
24 | Aneeliyo | 2,105 | Today, 02:03 Last post by: glennwa |
![]() |
Please help me locate a topic or trick to format the flash storage in another filesystem using storage manage |
5 | lastnikita | 72 | Yesterday, 22:35 Last post by: lastnikita |
![]() |
Link to new secany's ROM-i900-HL3_0137-HL5-HL3.exe | 2 | sardor | 270 | Today, 06:02 Last post by: giacomini |
![]() |
minimize to taskbar |
3 | denteno | 106 | Today, 06:55 Last post by: modacian |
![]() |
How to create a shortcut to programs screen ? so one doesn't have to go through start menu to access it |
0 | lastnikita | 44 | Yesterday, 22:52 Last post by: lastnikita |
|
Lo-Fi Version | Time is now: 9th January 2009 - 08:05 |
Please visit our 'Plus Partners' - these companies support MoDaCo through 'MoDaCo Plus' - Click Here for more details!
ActiveKitten |
Aiko Solutions |
Ateksoft |
Binaryfish |
Conduits |
DeveloperOne |
eSoft Interactive |
FTouchSL |
Inesoft |
Lingvosoft |
monocube |
Mykesoft |
OmegaOne |
Omnisoft |
Opera Software |
Resco |
SBSH |
Slipstream Solutions |
SPB Software House |
Splashdata |
Sprite Software |
Syncdata |
Teksoft |
VITO |
WalkingHotSpot |
WebIS |
z4soft
Would your company like to become a 'Plus Partner'? Click Here to contact us!