summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-09-19 21:14:20 (EDT)
committerpelder2006-09-19 21:14:20 (EDT)
commit3c0bbb3cfedabea044e5c46f9efe3fba11ab61e0 (patch)
tree4c17a1d4ebf58f9b4a0580ef6a3d4b46c77276aa
parent8b6f4882d3c6dc78f56719233f30620d394868a1 (diff)
downloadorg.eclipse.jet-3c0bbb3cfedabea044e5c46f9efe3fba11ab61e0.zip
org.eclipse.jet-3c0bbb3cfedabea044e5c46f9efe3fba11ab61e0.tar.gz
org.eclipse.jet-3c0bbb3cfedabea044e5c46f9efe3fba11ab61e0.tar.bz2
[157911] Set current string variable and attributes correctly.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
index c34fd93..7798b55 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/taglib/control/StringTokensTag.java
@@ -77,12 +77,19 @@ public class StringTokensTag extends AbstractIteratingTag {
*/
doAnotherIteration = index < tokens.length;
-
- tokenNode = tokens[index];
-
- context.setVariable(_name, tokenNode); // TODO Need an inspector for StringToken
-
- index++;
+ if (!doAnotherIteration) { return false; }
+
+ context.setVariable(_name, tokenNode);
+
+ XPathContextExtender xpathContext = XPathContextExtender.getInstance(context);
+
+ xpathContext.setAttribute(tokenNode,"value",tokens[index].getToken()); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"delimiter",tokens[index].getDelimiter()); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"first",String.valueOf(tokens[index].isFirst())); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"last",String.valueOf(tokens[index].isLast())); //$NON-NLS-1$
+ xpathContext.setAttribute(tokenNode,"index",String.valueOf(index)); //$NON-NLS-1$
+
+ index++;
/**
* End doEvalLoopCondition logic