xboxscene.org forums

Author Topic: Problem With Xml Functions  (Read 105 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Problem With Xml Functions
« on: January 21, 2004, 04:16:00 PM »

QUOTE
Like I said in that one post I'm working on an ActionScript. The problem is the XML part.

First one is:
STRINGINPUT NEWNAME Single "Enter a new name for your current BIOS"

SET CkSm $BIOSMD5$

XMLOPEN TestXML ::BIOSMD5
XMLGetNodeCount TestXML count
XMLSetValue TestXML !.ROM:%count% %CkSm%
XMLSetElementAttr TestXML descr "%NEWNAME%"
XMLSAVE TestXML ::BIOSMD5
XMLCLOSE TestXML

This one ends up replacing the <bios> tags to just <>and</>
but the <rom> node is there between them as it should be. All the other <rom> nodes are gone.

Second one is:
STRINGINPUT NEWNAME Single "Enter a new name for your current BIOS"

SET CkSm $BIOSMD5$

XMLOPEN TestXML ::BIOSMD5
XMLCreate TestXML BIOS
XMLCreateNode TestXML ROM
XMLSetValue TestXML !.ROM %CkSm%
XMLSetElementAttr TestXML descr "%NEWNAME%"
XMLSAVE TestXML ::BIOSMD5
XMLCLOSE TestXML

This works. It keeps the <bios> tags. But still it basically creates a new a new BIOSMD5.xml with only one rom listed.

So how can I get the new <rom> tag to the end of a filled BIOSMD5.xml? Cause in the internal.xml it shows "SetNodePtr -- !.FTPServer" and then the GetNode part which is the <user> nodes. I also tried SetNodePtr --- ! (because I'm trying to get the nodes from the root node) then GetNodeCount but it didn't work.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Problem With Xml Functions
« Reply #1 on: January 21, 2004, 04:56:00 PM »

Can't a new element be created in the existing <BIOS> node?

XMLOpen TestXML ::BIOSMD5
XMLSetNodePTr !
XMLCreateElement TestXML "ROM"
XMLSetElementValue TestXML %CkSum%
XMLSetElementAttr TestXML descr %Description%
XMLClose TestXML



Remember... these are ELEMENTS, not NODES.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Problem With Xml Functions
« Reply #2 on: January 21, 2004, 05:33:00 PM »

QUOTE
XMLSetNodePTr !


Okay so we can use just "!" to set the pointer to the root node. That good to know. I'll see how it goes now.
Logged