hi brad
(the usual netiquette here at apache is to keep things on list whenever
possible. not only does this increase the chances of getting the question
answered correctly but it also means that other people can look for
solutions to their problem by searching the archives.)
since i can't replicate, i'm going to need some more information to make
progress.
could you post up the full exception with stack trace? a full execution
log (from commons-logging) with level turned up to trace would also be
very useful.
- robert
On Monday, July 8, 2002, at 09:57 PM, Brad Jones wrote:
> Robert,
>
> Im using digester version 1.2...thanks for the suggestion regarding
> putting DIGESTER in the subject btw. If you can think of any reason why
> I would be getting that message, that would be great I just tried to run
> it again and it threw the same exception. I'm using the Websphere
> Application Development Environment WSAD to test my code if that helps.
>
> Thanks,
>
> Brad
>
>
>> From: robert burrell donkin <[EMAIL PROTECTED]>
>> Reply-To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
>> To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
>> Subject: [digester] Re: Rules for parsing to a Hashtable
>> Date: Mon, 8 Jul 2002 21:21:19 +0100
>>
>> hi brad
>>
>> i've given your code a whirl but i don't seem to have a problem.
>>
>> what version of digester are you using?
>>
>> BTW i would be useful if you could prefix your question with the
>> component name next time. (there are a lot of components in commons and
>> the prefix makes it easier for the right people to answer the right
>> questions.)
>>
>> - robert
>>
>> On Monday, July 8, 2002, at 08:04 PM, Brad Jones wrote:
>>
>>>
>>>
>>> I'm currently trying to parse objects from an XML file to a hashtable.
>>> I'
>>> m calling the put from the hashtable in my rule and passing 2
>>> parameters one that represents the key and the other that represents
>>> the value. For some reason I'm getting a SAXException saying that the
>>> put method does not exist on hashtable. Here's the code I'm working
>>> with currently. Any suggestions would be greatly appreciated:
>>>
>>> java.io.FileInputStream fileInputStream = null;
>>> Digester digester = new Digester();
>>>
>>> Hashtable ht = new Hashtable();
>>>
>>> digester.push(ht);
>>> digester.setValidating(false);
>>>
>>>
>>> //Sets filed 1 as the key and field 2 as the value
>>> digester.addCallMethod("toplevel/element", "put", 2);
>>> digester.addCallParam("toplevel/element/field1", 0, "field1");
>>> digester.addCallParam("toplevel/element/field2", 1, "field2");
>>>
>>> try {
>>> fileInputStream = new java.io.FileInputStream("C:/test.xml");
>>> } catch (java.io.FileNotFoundException fnfe) {
>>> }
>>>
>>> try {
>>> Object data = digester.parse(fileInputStream);
>>> fileInputStream.close();
>>>
>>> } catch (org.xml.sax.SAXException se) {
>>> System.out.println(se.getMessage());
>>> } catch (java.io.IOException ie) {
>>> }
>>>
>>> Here's the XML file that I'm parsing:
>>>
>>> <toplevel>
>>> <element>
>>> <field1>Value 1</field1>
>>> <field2>Value 2</field2>
>>> </element>
>>> <element>
>>> <field1>Value 3</field1>
>>> <field2>Value 4</field2>
>>> </element>
>>> </toplevel>
>>>
>>> Thank you for any sugestions that you can provide...
>>>
>>> Brad
>>>
>>>
>>>
>>> _________________________________________________________________
>>> MSN Photos is the easiest way to share and print your photos:
>>> http://photos.msn.com/support/worldwide.aspx
>>>
>>>
>>> --
>>> To unsubscribe, e-mail: <mailto:commons-user-
>>> [EMAIL PROTECTED]
>>> org>
>>> For additional commands, e-mail: <mailto:commons-user-
>>> [EMAIL PROTECTED]
>>> org>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail: <mailto:commons-user-
>> [EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:commons-user-
>> [EMAIL PROTECTED]>
>
>
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>