Click here to Skip to main content
11,926,805 members (53,289 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


15 bookmarked

State names and abbrev in XML

, 17 Feb 2002 BSD
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

QuestionWhat about an XML list of world countries? Pin
Jesse Sedwick2-Jul-08 10:37
memberJesse Sedwick2-Jul-08 10:37 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 18 Feb 2002
Article Copyright 2002 by Jason Gerard
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid