| QUOTE |
<testxml> <somenode> <someelement anotherattr="ThisIsAnotherAttr!" someattr="ThisIsAnAttribute!">ThisIsAnElement, too!</someelement> <someelement index="1" /> <someelement index="2" /> <someelement index="3" /> <someelement index="4" /> <someelement index="5">This Is the 6th Element!</someelement> <someelement index="6" /> <someelement index="7" /> <someelement index="8">This Is the 9th Element!</someelement> <someothernode somenodeattr="ThisIsAnAttribute!"> <anotherelement>ThisIsAnElement!</anotherelement> </someothernode> <someothernode testid="3"> <anotherelement>ThisIsAnElement Node 1!</anotherelement> </someothernode> <someothernode testid="4"> <anotherelement>ThisIsAnElement Node ID 4!</anotherelement> </someothernode> </somenode> </testxml> |
Now this is what I call an example. Good job BJ. I also think it's fantasic that with this new way the <element attr="value" /> works now unlike before when it would put it like
<element attr="value">
</element>
Yes, you'll notice that when I set a value for the 9th identically named node, it created enough nodes to give me a proper node, and attributed them with an index value (except the first one, which by default is "0" numerically)
Same for Queried nodes and elements - it will create these nodes in a referencable fashion, meaning the query key and value will be set as attributes.
I imagine this will make life a LOT easier for using XML. Tetris and other big scripts could probably shave a lot of weight off of them with the new access methods.
Well I gonna go and mess around with this stuff now. It's 3PM here now, I'll probable post my "thoughts" in a few hours
| QUOTE |
Yes, you'll notice that when I set a value for the 9th identically named node, it created enough nodes to give me a proper node, and attributed them with an index value (except the first one, which by default is "0" numerically)
|
Your referring to this part, part
<someelement index="1" />
<someelement index="2" />
<someelement index="3" />
<someelement index="4" />
<someelement index="5">This Is the 6th Element!</someelement>
My question about this is, is the "index" the default attr if not specified?
Cool, makes so much so much easier.
Skin customization will be much simpler:
XMLSetElementAttr !.LayoutElement?Source="DriveFFree" Source DriveGFree
/off to clean up tetris further
*still working on dialog maker, in case anyone's wondering
Nevermind I figured it out myself. Yes, I am just that good.
Maybe we could get an XMLForceOrder type of deal though.
Cause I just made a script that spits out the avalaunch xml and it is putting the internal menu stuff before the user menus.
Settings
IRC
Games
instead of
Games
Settings
IRC
Because the internal nodes are <item while the user ones are <list. So I am assumming this is done alphabetically.
Glad you figured it out.
MXM's parser reads everything in order of the file.
Let me know, within reason, if there's something I can provide for the XML access. The new access methods only apply to XMLGetValue and XMLSaveValue and the "@" variable access methods, but I'll add it to other XML commands as I can.
There actually was a whole slew of things I am scrapping that were never documented, including a way to increment through the tree - but using the indexed values is far better anyway.
I'll have to add a method to check to see if a "location" is actually there, too. Accessing a location with an XMLGetValue won't create a node - it will just return the default if it doesn't exist. XMLSetValue, on the other hand, always creates the nodes, and they will be created in the order you create them in, on a given node.
Of course, if you want to do a sort, you could always use an intermediate XML tree to performs something like that.
I just want to make sure nothing is broken. I ran Tetris after making the changes only to find all the text disappeared.
Turns out I never initialized the default text colors (fixed in 1175 to WHITE) for ActionDraw lists, and since it was never defined, they were coming up as "0" in the previous build. Doh.
At least Tetris is a good exercise in testing XML functionality
Well with this new (better) way, I can't see anything thats needs to added at the moment.
But what's up with it automaking an index="1" etc whenever you use and index? This is kinda annoying.
| QUOTE (flattspott @ Feb 21 2004, 09:54 PM) |
Well with this new (better) way, I can't see anything thats needs to added at the moment.
But what's up with it automaking an index="1" etc whenever you use and index? This is kinda annoying. |
I needed a way of making a set of new values that had at least some unique aspect to them, but it also allows you to create a large number of nodes or elements, kind of like BASIC's DIM statement.
Well I hate it, take it out
I quess I can live with it then. Actually, this could be usefull when you writing scripts and are using an XML with some sort of index. You'll have an index count readily available.
You could take them out when saving, and put them back in on load, if required.
Anyway, what're ActionDraw lists? Haven't been keeping up lately.
| QUOTE (geniusalz @ Feb 22 2004, 12:36 AM) |
You could take them out when saving, and put them back in on load, if required. Anyway, what're ActionDraw lists? Haven't been keeping up lately. |
It's the stuff between "BeginDraw" and "EndDraw" in your ActionScripts.
That's how I render the scenes with ActionScripts - I track the ACTIONs you DRAW in a LIST of commands and parameters, then every time I have to render a frame, I simply re-draw each item.
That may yet get some tweaking as well, but there's other stff to wrap up before I play with that yet.
| QUOTE (BenJeremy @ Feb 22 2004, 01:28 AM) |
| That's how I render the scenes with ActionScripts - I track the ACTIONs you DRAW in a LIST of commands and parameters, then every time I have to render a frame, I simply re-draw each item. |
thought i was gonna whip up a little script real quick, but ran into a problem. here's an example of the problem...
| CODE |
XMLCreate TestXML Main XMLSetValue TestXML !.Item.One "This is the value of item one." XMLSave TestXML f:\dashboards\mxm\scripts\test.xml XMLClose TestXML
|
produces...
| QUOTE |
<main> <item> <one> <value>This is the value of item one.</value> </one> </item> </main>
|
is that supposed to happen now? (the <value>...</value> tags)?
| CODE |
| Note the new separators... "^" precedes an element. Must be last or second-to last (proceeded by a dotted attribute name or the tilded attribute name) |
thanks! that did the trick!
Yes, the "location" specifier is now more specific in determining where to place things....
"~" indicates attribute, "^" indicates element.
Don't forget the new Query features... it will save you a lot of trouble in scripts.
Can the Query be use for things other then attributes?
Like !.submeu.item?title=applications
| QUOTE (flattspott @ Mar 7 2004, 06:39 PM) |
Can the Query be use for things other then attributes?
Like !.submeu.item?title=applications |
Yes, queries on elements work, too...
Cool, I wondered if that would work
Can someone tell me if it is possible to get the game icon to display from an inserted disk? If so what is the command as I am going to try to add this to the game copy script so it shows a picture of the game when it is copieng.
Thanks in advance!
Well if you're a WIP tester, you could do something like the testdialog. All you got to do is select an XBE file and the image shows up just like another other image file
| QUOTE (flattspott @ Mar 18 2004, 11:56 PM) |
| Well if you're a WIP tester, you could do something like the testdialog. All you got to do is select an XBE file and the image shows up just like another other image file |
All I want to know if there is what is the command to display the XBE icon...
I am a wip tester.