Carriage return in XML file

Hi, i’m tryng to insert a “carriage return” in the string i’m reading from an XML file, cause i need to specify the word wrapping in some text labels populated with the XML tags.
I find how to read the XML, and all works fine, but i need to insert line breaks special characters!
I try with \n
and various special codes starting with …but nothing seems work!
here is the code… but i think i need to modify the XML, not the code!

var myXMLFile : TextAsset;
private var myXMLString : String;


function Start(){
	myXMLString = myXMLFile.text;
}



function OnGUI () {
	GUI.Label (Rect (30,30,400,400), readXMLTag("myTag"));
}



function readXMLTag(myTag : String){
	var tagStart : int = myXMLString.IndexOf("<"+myTag+">") + myTag.length +2;
	var tagEnd : int = myXMLString.IndexOf("</"+myTag+">");
	myTag = myXMLString.Substring(tagStart, tagEnd - tagStart);
	return myTag;
}

TNX!

OK… i answer myself:

a simple carriaga return in the XML file is the solution!

…what a stupid! :slight_smile:

As a side note - if you want to get terribly fancy with the formatting it would be a good idea to wrap the value in CDATA to ensure your XML file remains valid.