You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jennifer Yip <je...@hotmail.com> on 2004/07/22 10:42:21 UTC
Multi Dimension Arrays
Hi guys just started using cocoon this morning and one area I need to focus
is JXPath expression.
Need your newbie help - sorry to be a pain.
Ok I have a class wrapped around a 2d Array
public static class ArrayTest {
String ts[][] = { { "ABC", "DEF" },
{ "GHI", "JKL" }
};
String[][] getFieldItems() {
return ts;
}
}
in the jxpath expression I use something like
JXPathContext arrayContext = JXPathContext.newContext(new ArrayTest());
Object item = arrayContext.getValue("fieldItems[1]");
This returns from the node-set an array of 2 objects
Q: How do I write this to access just the one element
ie ts[i][j] example on JXPath site is for 1d int array
really appreciated
Jenny
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org