RBXLX should support self-closing tags

Using a self closing tag in .rbxlx gives an XML error when it shouldn’t. A self closing tag is a tag that has no content and closes itself. As an example, <this /> is equivalent to <this></this>.

Unable to parse XML attributes. ‘=’ not found

Roblox Studio does not support this, making it difficult to write external tools that automatically make self-closing tags (like BeautifulSoup).

Reproduction:

  1. Make a .rbxlx file with the following code:
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
	<External>null</External>
	<External>nil</External>
	<Item class="Workspace" referent="RBXEED2C33B325D44BDA01FA78D25391CEF">
		<Properties>
			<BinaryString name="Tags"></BinaryString>
       		</Properties>
    	</Item>
</roblox>
  1. Open it up. Notice that it works.

  2. Replace <BinaryString name="Tags"></BinaryString> with <BinaryString name="Tags" />, which should be the exact same.

  3. Unable to parse XML attributes. ‘=’ not found

Why it matters

A lot of external XML programs will automatically create these self-closing tags, meaning if you want to write an external program that plays around with rbxlx files (which I am), you have to choose the right one that doesn’t do this or has a configuration option for it. If Roblox’s XML parser supported self-closing tags, this would make writing these external programs easier.

6 Likes

I’d be fine with this if it cuts down on file sizes.
This might also be a good excuse for @zeuxcg to get his pugixml library integrated into Roblox.

4 Likes

I recently learned that when loading built-in plugins in Studio, we spend ~150+ ms parsing the rbxmx files :-/ maybe it’s time.

4 Likes

Support, i love using self closing tags :yum:.