.mxml) and OpenLaszlo's LZX files (by extension
.lzxfiles) with XML so that at least XML color coding and XML checks can be used with these files.
The next two images show how a Flex MXML file and an OpenLaszlo LZX file appear in NetBeans without any association of these files types with XML. Click on the images in this entry to see larger versions of the images.
MXML Source Code in NetBeans without Color Syntax Support
LZX Source Code in NetBeans without Color Syntax Support
To enable color coding for LZX and MXML files, one can use the main Tools drop-down menu in NetBeans, select Options, click on the Advanced Options button, expand IDE Configuration, expand System, expand Object Types, and select XML Objects. At this point, one can then click on the small button on the right (and to the right of the label Extensions and MIME Types) with three periods (...) to expand the list of file extensions and MIME types associated with XML objects.
The next two screen snapshots indicate how LZX and MXML files can be associated in NetBeans as XML files. Specifically, by adding mxml and lzx file extensions, NetBeans treats files with these extensions as XML, enabling color syntax and well-formed XML checking.
Associating MXML with XML via mxml Extension
Associating LZX with XML via lzx Extension
.lzxextension and the
.mxmlextension associated in NetBeans as XML, it is time to see how the sample code in both XML grammars now appears. The next two screen snapshots show the MXML and LZX source code shown above, but now with color syntax thanks to NetBeans recognizing these as XML format.
MXML with XML Color Coding Syntax in NetBeans
LZX with XML Color Coding Syntax in NetBeans
Associating LZX and MXML with XML in NetBeans also enables XML checking for well-formed XML documents to be performed on these files.
Enabling color syntax and XML checking for Flex MXML and OpenLaszlo LZX files is easy with NetBeans 6.1 beta. However, it would be nice in a future version of NetBeans to have more comprehensive support for Flex and for OpenLaszlo development.
Speaking (or writing) of NetBeans 6.1 beta, the NetBeans IDE 6.1 Beta Blogging Contest ends on Friday, April 19, 2008 (tomorrow or today depending on where you live). I intend to submit this blog entry for consideration in that contest because it covers features of NetBeans and expresses a desire of mine for additional NetBeans support of Flex and OpenLaszlo.