Jump to content


Photo

Problem With Xml Functions


  • Please log in to reply
2 replies to this topic

#1 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 22 January 2004 - 12:16 AM

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.


#2 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 22 January 2004 - 12:56 AM

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.

#3 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 22 January 2004 - 01:33 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users