1

In my source-----

Element element1 = element.addElement("List");

element1.addAttribute("Number", (String)Map.get("NUMBER"));

element1.addAttribute("Indicator", null);

I want a result like that=> element1 Indicator=""/

I use use dom4j1.6 in java, I search the method, addattribute method => Attributes with null values are silently ignored.

but I have to print out element1 Indicator=""/

how can I do?

1 Answers1

0

Have you tried element1.addAttribute("Indicator", ""); ?

Jherico
  • 28,584
  • 8
  • 61
  • 87
  • 1
    @beth - points of SO etiqqette. 1) if someone provides a helpful answer, Vote for their answer. 2) if someone provides the definitive answer, Accept their answer. 3) Don't ask new questions in comments ... unless they are really requests for clarification of the original answer. – Stephen C Aug 24 '10 at 02:40
  • @Stephen C- I don't have any reputation. If I have some reputation, i give votes to Jherico. –  Aug 24 '10 at 03:56
  • But you can accept his answer, and that will give you some reputation points. – Stephen C Aug 24 '10 at 05:45