Click here to Skip to main content
13,835,897 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


15 bookmarked
Posted 17 Feb 2002
Licenced BSD

State names and abbrev in XML

, 17 Feb 2002
Rate this:
Please Sign up or sign in to vote.
An XML file containing US state and territory names and their two letter abbreviation.
<!-- Add the rest of your HTML here -->


I figured this could come in handy to anyone who needed it so I just threw it together. I got tired of not having a list of states. I so often have to implement a dropdown or validate an input that takes an abbreviation and always have to get the information from some website that has a similar list. So this time I finally got smart and made an XML file out of it. I got the information from the USPS website.

The file uses a very simple structure:

  <state name="ALABAMA" abbreviation="AL" /> 
  <state name="ALASKA" abbreviation="AK" /> 

That's all there is to it. Hope you find this useful.


This article, along with any associated source code and files, is licensed under The BSD License


About the Author

Jason Gerard
Web Developer 20k inc.
United States United States
I've been coding professionally since 1998. I'm proficient with C# and .NET. I used to be really good with Java and even VB! Currently, I spend most of my coding time writing JavaScript (client and server-side) and Python.

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
fredatcodeproject29-Feb-12 4:30
professionalfredatcodeproject29-Feb-12 4:30 
Generalproper function applied ;) Pin
andrei_teodorescu18-May-11 23:51
memberandrei_teodorescu18-May-11 23:51 
GeneralYou totally rock! Pin
Kim Finleyson14-Aug-08 12:03
memberKim Finleyson14-Aug-08 12:03 
QuestionWhat about an XML list of world countries? Pin
Jesse Sedwick2-Jul-08 10:37
memberJesse Sedwick2-Jul-08 10:37 
Generalthanx Pin
suniltauro5-Oct-07 6:15
membersuniltauro5-Oct-07 6:15 
QuestionI need some type of state list and more importantly, a city list Pin
tejas559-Sep-07 19:27
membertejas559-Sep-07 19:27 
GeneralAWESOME Pin
regwood7927-Oct-06 10:01
memberregwood7927-Oct-06 10:01 
GeneralThanks! Pin
lexzxzx24-Apr-06 18:05
memberlexzxzx24-Apr-06 18:05 
GeneralCapitals Pin
Anonymous21-Oct-02 4:34
memberAnonymous21-Oct-02 4:34 
GeneralRe: Capitals Pin
Anonymous16-Apr-04 4:31
memberAnonymous16-Apr-04 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190114.1 | Last Updated 18 Feb 2002
Article Copyright 2002 by Jason Gerard
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid