commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jennifer Yip" <jenyip...@hotmail.com>
Subject Multi Dimension Arrays
Date Thu, 22 Jul 2004 08:42:21 GMT
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


Mime
View raw message