well, unfortunately it seems that this isn't going to work either.

i changed the package names on my fixed-up harmony and configured the 
DocumentBuilderFactory and SAXParserFactory to reference the new 
classes.

first problem is that although the factory can find my 
DocumentBuilderFactory, it can't instantiate my SAXParserFactory. 
this doesn't make any sense because i can instantiate it fine using 
the exact same code in my activity.

second problem is that even if the fixed classes are instantiated 
directly rather than made by factories, it doesn't work because it 
turns out there is a *native* component to the Expat parser (wtf?) on 
which harmony depends and which it can't find because the package 
name is different.

third problem is that even if i fix the imports to use the original 
Expat classes, the compiler can't find org.apache.harmony. i notice 
that while it's in the platform, it's not in the SDK, so i can't 
directly import it. i could include a duplicate harmony version of 
the class for import purposes, but i found that having two copies 
available caused the runtime to have problems.

getting a working DOM on Android has turned into a massive odyssey. 
i'm up for fixing it, but the situation won't even let me do that.

at this point i'm going to try and call Xerces's factories directly, 
as a last resort. if that doesn't work, i'm completely sunk.

(my application works fine on every other DOM i've used.)



>I'm not sure if this is what you're looking for and I never tried it myself.
>
>Try setting the property 'javax.xml.parsers.DocumentBuilderFactory' to
>your own implementation of the DocumentBuilderFactory.
>
>The DocumentBuilderFactory.getInstance first tries to load a class by
>name that's stored in that system property. If either that property is
>not set or loading the class set doesn't succeed it will return the
>default DocumentBuilderFactory.
>
>If you tried this already then I don't know how it can be done.
>Comments in DocumentBuilderFactory say that other configuration
>possibilities are not implemented (yet?).
>
>For the SaxParserFactory it would be following property:
>javax.xml.parsers.SAXParserFactory
>
>-- Urs
>
>On Fri, May 22, 2009 at 1:46 AM, Jason Proctor
><[email protected]> wrote:
>>
>>>fix them upstream then ship a forked copy until a new Android
>>>release re-merges, or use a different dom implementation.
>>
>>  seems i'm up against it here too. i included a copy of the harmony
>>  DOM source in my Android project, and it builds fine, but at runtime
>>  it uses the regular one. is there a way to force the usage of the
>>  local one?
>>
>>  i'd use another DOM, but Xerces won't let me instantiate its document
>>  implementation directly, so i'd have to change the parser factories
>>  in javax.xml.parser. i'd be up for doing that, but Android heads me
>>  off at the pass there too by not allowing me to include anything off
>>  java.* or javax.* in my apk.
>>
>>  it would be really nice if the javax.xml.parser.* factories could be
>>  configured to make Documents from different implementations, but i'm
>>  not seeing how right now.
>>
>>  thanks in advance,
>>  --
>>  jason.software.particle
>>
>>  >
>>
>
>

-- 
jason.software.particle

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to