Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

WebGL XmlDocument LoadXml issues with RC3

Discussion in 'Unity 5 Pre-order Beta' started by Scott-Elson, Feb 25, 2015.

  1. Scott-Elson

    Scott-Elson

    Joined:
    Mar 21, 2013
    Posts:
    19
    Is anyone else having issues with using XmlDocument's LoadXml? I had no problems with it up until b018 but now that I've updated to RC3 it throws and exception when running the WebGL build. I printed out the string in case there was some issue with the Resources Load but it looks fine. Does anyone have any thoughts?

    Thanks,

    Scott
     
  2. Scott-Elson

    Scott-Elson

    Joined:
    Mar 21, 2013
    Posts:
    19
    Well I went through and started with a basically empty file and kept adding stuff until it hit an exception, which didn't take long except for the build times. It appears the WebGL version of the XmlDocument.LoadXml method may currently have an issue with attributes. The following xml loads fine:

    <?xml version="1.0" encoding="utf-8"?>
    <CaseData>
    <CaseName>DeQuarvains Test</CaseName>
    <CaseType>DeQuarvains</CaseType>
    <ReferenceDictionary>ReferencesFile</ReferenceDictionary>
    <CaseDescription>DeQuarvains Case Description</CaseDescription>
    <VersionNumber>1.000</VersionNumber>
    <Stage>
    <StageName>Initial</StageName>
    <AssetModuleTemplate>ExpoAnim</AssetModuleTemplate>
    </Stage>
    </CaseData>


    While this causes an exception:

    <?xml version="1.0" encoding="utf-8"?>
    <CaseData>
    <CaseName>DeQuarvains Test</CaseName>
    <CaseType>DeQuarvains</CaseType>
    <ReferenceDictionary>ReferencesFile</ReferenceDictionary>
    <CaseDescription>DeQuarvains Case Description</CaseDescription>
    <VersionNumber>1.000</VersionNumber>
    <Stage>
    <GameBundle WaitForDone ="true">SceneExpoAnim.unity3d</GameBundle>
    </Stage>
    </CaseData>

    which it didn't use to. If anyone has any ideas about this let me know otherwise I'll bug it tomorrow.

    Scott
     
  3. Scott-Elson

    Scott-Elson

    Joined:
    Mar 21, 2013
    Posts:
    19
    Well I submitted the bug. If anyone is interested this is the code I sent for them to reproduce it. As mentioned before, I've only been able to reproduce the problem when I do a WebGL build.

    // Start of code.......................
    string sLoadsOK = "<?xml version=\"1.0\" encoding=\"utf-8\"?><CaseData><CaseName>DeQuarvains Test</CaseName></CaseData>";
    string sCausesException = "<?xml version=\"1.0\" encoding=\"utf-8\"?><CaseData><CaseName someasset=\"true\">DeQuarvains Test</CaseName></CaseData>";

    Debug.Log ("Getting ready to load XML without assets.");
    Debug.Log (string.Format("XML to loaded: {0}", sLoadsOK));
    XmlDocument xmlDocWOA = new XmlDocument();
    xmlDocWOA.LoadXml(sLoadsOK);
    Debug.Log ("Load without assets successful.");
    Debug.Log ("Loading xml with an asset.");
    Debug.Log (string.Format("XML to loaded: {0}", sCausesException));
    XmlDocument xmlDocWA = new XmlDocument();
    xmlDocWA.LoadXml(sCausesException);
    Debug.Log ("Load with assets successful, test complete *************************************.");
    // End of code......................................................

    Scott