users@fi.java.net

StAX extension for FI

From: Aaron Anderson <nickmalthus_at_yahoo.com>
Date: Mon, 12 Feb 2007 13:17:06 -0800 (PST)

 I have read several references about extending the StAX API to support FI built-in algorithms. Is there any time line for this to occur? While the StAX cursor API is rigidly typed for Strings it seems the event API is more extensible. According to http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html "You can create subtypes of XMLEvent that are either completely new information items or extensions of existing items but with additional methods." I am interested in using StAX in conjunction with FI in order to parse in an XML document that contains numerous float and integer arrays. I would like to leverage the parsing model of StAX while still being able to access the raw FI primitive data arrays read into memory and avoid decoding them as strings. Would it be feasible to create a new version of the StAXEventReader that would emit custom XMLEvents that would contain additional methods to access the underlying FI data? For example, XMLEventReader r = new StAXEventReader2(new FileInputStream(filename)); float[] data; while(r.hasNext()) { XMLEvent e = r.nextEvent(); if (e instance of Characters){ if (e instanceof FICharactersEvent){ data=((FICharactersEvent)e).getFloatData(); }else{ data=myFloatStringParserMethod((Characters)e).getData()); } } } Any comments? ____________________________________________________________________________________ No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail