EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Newlines in XML (https://www.eq2interface.com/forums/showthread.php?t=9746)

ryokousha 11-17-2007 03:44 PM

Newlines in XML
 
I've seen several threads mentioning that the XML parser reads from top to bottom and right to left. To me that top to bottom part is most interesting since it seems to imply I can put newlines in my xml file to make it easier to read (rather than having every element property be all on one line)
ex: rather than
<button localtext="click me" MyElem="first" MySecond="second" Location="250,30" Name="mybutton" ScrollExtent="42,42" Size="42,42">mybutton</button>

having
<button localtext="click me"
MyElem="first"
MySecond="second"
Location="250,30" Name="mybutton" ScrollExtent="42,42" Size="42,42">
mybutton</button>


However, whenever I have any xml file with newlines like those in it - my game crashes immediately upon loading the UI.

Am I misunderstanding the the top-to-bottom reading? Or are there special end of line characters I need to be inserting (or not inserting) - I use Emacs under Windows for my xml editing. I've tried manually adding some ^M characters at the end with no luck. I've also tried editing in Notepad with the same results.

Putting all the property elements on a single line works but is incredibly annoying to edit.

Thanks

lordebon 11-17-2007 03:49 PM

In my experience, new lines are ok inside of properties, but NOT ok inside of a tag.

For example, this is ok:

<Button localtext="this is ok
"></button>

This is NOT ok:
<Button localtext="this is not ok"
></button>

Notice that in the first example, the newline occurs inside the localtext properties, but in the second line its inside the button but NOT inside a property.

Also, keep in mind this is just what i've noticed in my tinkering.

ryokousha 11-17-2007 03:57 PM

Ah ok thank you.

I was trying to play with the conditionals (as referenced in the Concatenate thread and they showed some properties on multiple lines. Was confusing when I couldn't get it to work.


All times are GMT -5. The time now is 12:22 AM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI