Smart XSLT editing

Eclipse's XSLT editor is getting really smart. Here's a small example.

  1. Type

    <xsl:var
  2. Press Ctrl+Space to open Content Assist. Next press Enter to select the only available suggestion.

  3. Your line now looks like this:

    <xsl:variable name=""></xsl:variable>
  4. Enter a name in the name attribute and add another attribute s.

  5. Your line now looks like this:

    <xsl:variable name="myname" s></xsl:variable>
  6. Press Ctrl+Space to open Content Assist. Next press Enter to select the default suggestion.

  7. Your line now looks like this:

    <xsl:variable name="myname" select=""></xsl:variable>
  8. Enter an expression in the select attribute and type a / after the attribute value.

  9. Your line now looks like this:

    <xsl:variable name="myname" select="/some/path"/>

Especially the automatic cleanup of empty elements is cool.

Topic: 

Add new comment