-1

The XML specification reserves a number of characters such as & or <. I have written an XML exporter that exports our tree structure, but we have attribute values that contain reserved characters.

I am not sure what is good approach to dealing with this. Should I look for a library for XML exporting (and figure out how to adapt our tree to it)? Just write my own method that replaces the reserved characters with the appropriate substitutions?

MxLDevs
  • 19,048
  • 36
  • 123
  • 194
  • Asked and answered here: http://stackoverflow.com/questions/439298/best-way-to-encode-text-data-for-xml-in-java – Bill Gregg Jun 07 '13 at 16:00

1 Answers1

0

I would recommend the library approach - this is just the sort of thing library developers solve for you so that you don't have to reinvent the wheel.

JAXB seems like a good candidate: http://www.intelrate.com/articles/java/jaxb/

uptownnickbrown
  • 987
  • 7
  • 22