James' Blog

James’ personal blog

XML parsing trouble with & (aka ampersand, &)

I have been working with XML parsing recently using the StAX  (why use StAX?).  However, I ran into an issue with the & (ampersand) since it is a reserved character in xml and needs to be escaped.   But when the & was escaped the parser would fire multiple events, 1) text before the &, 2) the &, 3) text after the &.  This was a bit hard to integrate with, so instead of putting a & in the xml file I just replaced it with a different character and did a search and replace once the data was parsed.  This strategy saved me quite a bit of work.

Posted 1 year, 2 months ago at 3:36 pm.

Add a comment

Upgrading JAVA on Mac OS X (to 1.6)

I tried to update JAVA on MacOS X  by using the /Application/Utilities/Java/Java Preferences.app.  It seemed to work, but if you want it to work for root, then you need to run the application as root.  you can do it on the command line as follows:

root#   ./Applications/Utilities/Java/Java Preferences.app/Contents/MacOS/Java Preferences

I’m not sure if it was necssary but I also modified the symlinks also to point to 1.6 instead of 1.5.

ln -s /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK 1.6
you can delete the original symlink if necessary. As a word of warning, I have read that changing symlinks isn’t recommended by apple.

Posted 1 year, 3 months ago at 12:24 pm.

Add a comment