Results 1 to 2 of 2
  1. #1
    salman.kagzi is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default Escaping special characters in User Input in IzPack Installer

    I have an IzPack installer that takes in a lot of User Inputs and substitutes them in an XML file. This XML file is actually the configuration file for my application.

    There is a major problem that I have hit and I cant move on from it.

    In the Input fields (in the installer) user can enter any text and also special characters like & # % ' etc. These special characters messes up my XML file as they are no allowed in the XML syntax and needs to be escaped. for example for & one would need & So far I have been asking the user to do this, as in escape the special characters themselves, but thats now working either.

    Is there a way to have this done automatically? I really need a solution fast.

    I am using IzPack V 4.1

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,308
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by salman.kagzi View Post
    I have an IzPack installer that takes in a lot of User Inputs and substitutes them in an XML file. This XML file is actually the configuration file for my application.

    There is a major problem that I have hit and I cant move on from it.

    In the Input fields (in the installer) user can enter any text and also special characters like & # % ' etc. These special characters messes up my XML file as they are no allowed in the XML syntax and needs to be escaped. for example for & one would need & So far I have been asking the user to do this, as in escape the special characters themselves, but thats now working either.

    Is there a way to have this done automatically? I really need a solution fast.

    I am using IzPack V 4.1
    Is there a possibility to Map each input character to the XML equivalent sequence (if appplicable)? A simple Map<Character, String> could do the job.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Help - special characters producing 404 errors
    By Knedlikova in forum New To Java
    Replies: 3
    Last Post: 11-17-2010, 09:13 AM
  2. XML with special characters
    By Kaizah in forum XML
    Replies: 1
    Last Post: 11-06-2009, 02:26 PM
  3. [SOLVED] special characters (ASCII)
    By AlejandroPe in forum New To Java
    Replies: 8
    Last Post: 04-06-2009, 10:42 AM
  4. Searching for Microsoft special characters
    By Tim McDaniel in forum Eclipse
    Replies: 2
    Last Post: 02-24-2009, 03:11 PM
  5. special characters
    By ravian in forum New To Java
    Replies: 2
    Last Post: 11-16-2007, 01:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •