0

i have one xml variable that contains forwardslash .Now am trying to parse to string using xmlparser.parseFromString(xmlval ,"text/xml")

**var xmlval = < name > forward/slash/error < /name >**
  var result = xmlparser.parseFromString(xmlval ,"text/xml")

Getting syntax error because of forwardslash. How can i solve the problem ?

User
  • 45
  • 1
  • 10
  • can you add in the actual xml you're working with? or at least a part of it? I doubt that the forward slash should cause any issues in parsing the xml. – Reza Karami Mar 14 '17 at 13:39
  • @RezaKarami yes the forward slash only cause the error – User Mar 14 '17 at 13:50
  • The forward slash is not a reserved character for xml, read here: http://stackoverflow.com/a/539158/4266776 – Reza Karami Mar 14 '17 at 13:54
  • in your question, the `xmlval` isn't wrapped as string. If that's intended then that's your problem. Otherwise the parser should handle it without problems – KarelG Mar 14 '17 at 14:14

0 Answers0