[281421] [editor] StringIndexOutOfBounds exeception
https://bugs.eclipse.org/bugs/show_bug.cgi?id=281421
diff --git a/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/TestTestAttributeProposals.xsl b/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/TestTestAttributeProposals.xsl
new file mode 100644
index 0000000..4b7c07b
--- /dev/null
+++ b/tests/org.eclipse.wst.xsl.ui.tests/projectfiles/TestTestAttributeProposals.xsl
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:template match="/">
+		<xsl:choose>
+           <xsl:when test=""></xsl:when>
+        </xsl:choose>
+	</xsl:template>
+</xsl:stylesheet>
+<!-- Unit test to make sure we get proposals for test attributes -->
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/tests/contentassist/TestXPathXMLCompletionProposal.java b/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/tests/contentassist/TestXPathXMLCompletionProposal.java
index 7233d15..d8952aa 100644
--- a/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/tests/contentassist/TestXPathXMLCompletionProposal.java
+++ b/tests/org.eclipse.wst.xsl.ui.tests/src/org/eclipse/wst/xsl/ui/tests/contentassist/TestXPathXMLCompletionProposal.java
@@ -86,5 +86,24 @@
 		fail("Did not find XSD proposals.");
 	}
 	
+	public void testTestAttributeProposal() throws Exception {
+		fileName = "TestTestAttributeProposals.xsl";
+		String xslFilePath = projectName + File.separator + fileName;
+		try {
+			loadFileForTesting(xslFilePath);
+
+			ICompletionProposal[] proposals = getProposals(4,28);
+			assertNotNull("Did not find proposals.", proposals);
+
+			for (int i = 0; i < proposals.length; i++) {
+				if (proposals[i].getDisplayString().contains("document")) {
+					return;
+				}
+			}
+		} finally {
+			model.releaseFromEdit();
+		}
+		fail("Did not find XPath proposals for the test attribute.");
+	}
 	
 }
\ No newline at end of file