-1

I am looking to write a method where the input is an string representation of the xml. Below is the example:

<input>
  <name>John</name>
  <some_field>0x00</some_field>
</input>

Now, I need to convert this input string to something like:

John|NULL

Is this possible?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Sumved Shami
  • 102
  • 2
  • 15
  • 1
    “How can I configure the XML parser…” What parser? – VGR Nov 21 '15 at 21:03
  • [XY] problem. You're assuming the parser can do it and assuming there is a configuration step for it when all you need is a *post* parse conversion. Even an XSLT. And NB "NULL" is n the same thing as `null`. – user207421 Nov 21 '15 at 22:19

1 Answers1

0

1 first you must parse it: see this: DOM XML Parser Example

2 when you get the value: 0x00, you can test it and convert it to NULL

if (value.contentEquals("0x00"))
   { 
   value="NULL";
   // or do what you want
   }
Community
  • 1
  • 1