 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Mon May 30, 2005 7:00 pm
Strict XML Data Source? |
Hey Zugg, I am playing around with my ToDo program, and I want to store the Todos in an xml file, without the need for a database. I was wondering if this was possible, or if I was going to have to create a sqlite db, and use the import xml/export xml functions?
I would rather just use the xml file strictly, otherwise I'll need to do the import on every open and the export on every save. |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue May 31, 2005 4:19 pm |
zApp has a powerful XML library to deal with XML files directly. Take a look at the zXML object. You can load an XML file directly and then access the tree structure. You won't have the powerful query or SQL operations that a database has, but you still have a lot of power in manipulating the XML tree.
The zXML object is based upon the so-called "DOM" XML parsing model. zApp implements all of the standard DOM properties and methods. So any book or resource that talks about XML DOM-parsing should be useful for this.
But it should be pretty straight-forward. |
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Tue May 31, 2005 6:16 pm |
I actually know a lot about DOM from my Java courses with xml, I just didn't notice the zXML object in the references.
|
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Tue May 31, 2005 6:58 pm |
Oh Lol, I found my erorr, Wow..heh, bad error msg for what the error was. Poorly formated xml document.
So yeah, your LoadFile example needs fixing..
Also, I'm not sure if this is an error with the way the COM file is made with LoadFile, but when an element that has no children is loaded, the ChildCount property is set to 1, OR the tree is just thinking there is one element.
This is true for elements that have an opening and closing tag, and a text node.
ALSO (I'm sorry) there still seems to be serious redraw issues with the zTree or zSplitter control. They are quiet apparent in the zapppro.zml app. Try to minimize/maximize it, major ick. |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue May 31, 2005 7:43 pm |
Thanks for letting me know about the bad sample code. I've got the example fixed now.
As far as the error message, that one actually is coming from the Microsoft Scripting Engine, so I guess they are really to blame. All I do is display the error message exactly as it comes from the scripting engine. You are right...it's a really stupid error message. But unfortunately it's outside my control.
I'm not getting any redraw issues in the zTree or zSplitter that I can see. I minimized zapppro.zml and then maximized it so maybe you can post a screen shot showing what is happening on your system. |
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
|
|
 |
theNerd Adept

Joined: 01 Mar 2005 Posts: 277
|
Posted: Wed Jun 01, 2005 2:42 am |
Zugg, here's something to demonstrate some redraw and resizing problems. Just resize it, expand and restore it, etc., to see what I mean.
Code: |
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE zapp [
<!ENTITY AppTitle "Sample ZML">
<!ENTITY AppAuthor "Some Author Name">
<!ENTITY AppVersion "1.0">
<!ENTITY AppURL "http://www.someurl.com/">
<!ENTITY AppImage "ZAPP">
<!ENTITY AboutBox SYSTEM "aboutbox.xml">
<!ENTITY LabelGrad "color='#C4D2ED' colorto='#7E98CB'">
]>
<zapp>
<splash color='#C4D2ED'>
<image image='zapp' deltaleft='8' deltatop='8'/>
<label align='Client' bevelouter='Lowered' autoleft='true' deltaleft='8' width='-8' height='-8' gradienttype='FullVertical' color='#C4D2ED' colorto='#7E98CB'><![CDATA[<b>&AppTitle;</b><br><br>
Version &AppVersion;<br><br>
by &AppAuthor;]]></label>
</splash>
<toolbar name='mainmenu' Fullsize='true'>
<menu caption='&File'>
<item action='_FileExit'/>
</menu>
<menu caption='&View'>
<item caption='Normal' script='core.themeindex = -1'/>
<item caption='Office11' script='core.theme = "office11"'/>
<item caption='Aqua' script='core.theme = "aqua"'/>
<item caption='Watercolor' script='core.theme = "watercolor"'/>
<item caption='Plex' script='core.theme = "plex"'/>
<item action='_ThemeSelect'/>
</menu>
<menu caption='&Help'>
<item caption='&About' script='core.execwindow( "About")'/>
</menu>
</toolbar>
<MAINWINDOW>main</MAINWINDOW>
<window name='main' caption='Some Title' width='640' height='480'>
<toolbar name='mainmenu'/>
<panel align='client'>
<pages name='EditPages' align='client' showclosebutton='false' events='true'>
<tab name='MainTab' caption='Tab 1'>
<label align='top' caption='Some title information here.' &LabelGrad;/>
<PANEL Name='PanelA' Align='Left'>
<label align='top' caption='This is where the translated message will appear.' &LabelGrad;/>
<memo align='client'></memo>
</PANEL>
<SPLITTER/>
<PANEL Name='PanelB' Align='client'>
<memo align='client'></memo>
</PANEL>
</tab>
<tab name='SecondTab' caption='Another Tab'>
<label align='top' caption='Just another title.' &LabelGrad;/>
</tab>
</pages>
</panel>
</window>
&AboutBox;
</zapp> |
|
|
|
 |
theNerd Adept

Joined: 01 Mar 2005 Posts: 277
|
Posted: Wed Jun 01, 2005 5:07 am |
Sorry for the lousy example but it was part of something I was working on. I tried to take out all the unnecessary things and leave in filler text. 
|
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Fri Jun 03, 2005 2:23 pm |
Any word on this zugg?
|
|
|
 |
theNerd Adept

Joined: 01 Mar 2005 Posts: 277
|
Posted: Fri Jun 03, 2005 3:06 pm |
I would also like to know if there is any word on this. When resizing with the splitter, resizing the form, etc., it does some funky things. The example was based on something I was doing for my sister. I decided to do it in VB instead because of this but I *really* want to do it in zApp instead. 
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jun 03, 2005 4:30 pm |
Sorry for the delay in getting back to you on this.
The problem in the sample code that theNerd posted seems to be with the and controls. If you remove those, then the panel and splitter seems to work fine here.
DevExpress just released a new version with a new PageControl that I can finally use in zApp. In the current 2.3 version, zApp is using a page control from Raize components because the DevExpress code didn't support colored tabs. Now the DevExpress supports this, I'll be replacing the entire page and tab controls in the next version with the DevExpress code. Because of this change, I haven't spent any time messing with the current version when it comes to bugs in the page and tab controls.
Hopefully I'll have the new version out in a week or so. |
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Fri Jun 03, 2005 6:52 pm |
what about in the dbview one? And my little app also has the problem too, it's just 2 panels, 1 has a tree, the other nothing, and a splitter between.
|
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Sun Jun 19, 2005 3:24 pm |
Any progress on this zugg?
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sun Jun 19, 2005 11:07 pm |
No, I've been working on zMUD the past 2 weeks and am now working on the zApp white paper and the zApp demo disk for the Shareware conference. Probably won't get a chance to replace the page control for at least another week, sorry.
And I'm afraid I still don't get any problem with dbview and the tree. You should send me a screen shot of what it looks like when its messed up. |
|
|
 |
Krule Adept
Joined: 12 Nov 2000 Posts: 268 Location: Canada
|
Posted: Mon Jun 20, 2005 12:02 am |
Didn't I already? I'll do so again if not.
|
|
|
 |
|
|