Thread: Dropping Zeroes

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Dropping Zeroes


    I have been thrust into this role and this is the my first time looking at XML Code and I am stumped :

    I am supporting a piece of code that is generating check data. This XML code is working nice but when it extracts a zip code field that begins with a leading Zero it is dropping that zero and making the Zip invalid( example zip 06060 is appearing as 6060).

    I have never worked with XML before so how can I add a zero if zip code length < 5 characters ?

    Below is the XML piece that extracts the zipcode:

    <Element type="DataElement" length="10" padchar="" justify="R" field="Summary/Address/PostCode" />

    I need to leave the length at 10 to allow for addresses with ZIP+4, so just 0 padding fixed my issue but created another.

    save the Noob and save the world
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    It's not really a question of XML: whatever code that generated the XML is what you have to fix.
    Sounds like it's treating the zip code as a number when it shouldn't?

IMN logo majestic logo threadwatch logo seochat tools logo