(SOLVED)Creating an XML document


(TaylorAnderson) #1

Hey guys. I’m working on a game that requires a lot of dialogue so I thought I’d try to set up an XML document so I can write in and access messages and responses easily. I’ve never created my own XML before, but I’ve been working with Ogmo for a while so I have a basic idea of how to manipulate them. However, the XML document I made with XML NotePad 2007 gets syntax errors for each and every line that I don’t know how to solve. The document is here:

<?xml version="1.0" encoding="utf-8"?>

<Conversations>
  <Message Content="This is a test message.">
    <Response1 Content="This is a test response 1" Value="0" />
    <Response2 Content="This is a test response 2." Value="1" />
    <Response3 Content="This is a test response 3." Value="2" />
  </Message>
  <Message Content="This is test message 2">
    <Response1 Content="This is the first response." Value="0" />
    <Response2 Content="This is the second response" Value="1" />
    <Response3 Content="This is the third response" Value="2" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
  <Message Content="">
    <Response1 Content="" Value="" />
    <Response2 Content="" Value="" />
    <Response3 Content="" Value="" />
  </Message>
</Conversations>

It’s just a framework right now,but pretty well all of those lines are bringing up syntax errors in FlashDevelop.


(Zachary Lewis) #2

What do you mean they were “bringing up syntax errors in FlashDevelop?” Have you tried using the XML in Flash yet?


(TaylorAnderson) #3

Oh, yeah probably should have mentioned that :P. I basically stripped all code out of it, just left enough to reference the XML

public function GameWorld() 
{
	add(playerManager)
	add(charManager);
	add(gameManager);
	LoadConvoXML(Assets.CONVOXML)
}

public function LoadConvoXML(xml:Class):void
{
	var convoXml:XML = FP.getXML(xml);
	
}

(Jonathan Stoler) #4

Only two things I can think of (your XML validated just fine when I ran a validator):

  1. Is Assets.CONVOXML set properly?
  2. Did you remember to declare mimeType="application/octet-stream" in your Embed for Assets.CONVOXML?

EDIT: another possible problem would be if playerManager, charManager, and/or gameManager are not set properly or if their respective classes have bugs or throw errors.

Telling us specifically which syntax errors you are receiving would help a lot.


(TaylorAnderson) #5

Ahh, I did not set mimeType=“application/octet-stream” before, but now that I have I seem to be getting no errors. Thanks a lot!