Click here to Skip to main content
11,702,168 members (65,210 online)
Click here to Skip to main content

State names and abbrev in XML

, 17 Feb 2002 BSD 79.8K 1.9K 15
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 -->

Introduction

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:

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

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

License

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

Share

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 3:30
memberfredatcodeproject29-Feb-12 3:30 
Generalproper function applied ;) Pin
andrei_teodorescu18-May-11 22:51
memberandrei_teodorescu18-May-11 22:51 
QuestionWhat about an XML list of world countries? Pin
Jesse Sedwick2-Jul-08 9:37
memberJesse Sedwick2-Jul-08 9:37 
Generalthanx Pin
suniltauro5-Oct-07 5:15
membersuniltauro5-Oct-07 5:15 
QuestionI need some type of state list and more importantly, a city list Pin
tejas559-Sep-07 18:27
membertejas559-Sep-07 18:27 
GeneralAWESOME Pin
regwood7927-Oct-06 9:01
memberregwood7927-Oct-06 9:01 
GeneralThanks! Pin
lexzxzx24-Apr-06 17:05
memberlexzxzx24-Apr-06 17:05 
GeneralCapitals Pin
Anonymous21-Oct-02 3:34
sussAnonymous21-Oct-02 3:34 
GeneralRe: Capitals Pin
Anonymous16-Apr-04 3:31
sussAnonymous16-Apr-04 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.150819.1 | Last Updated 18 Feb 2002
Article Copyright 2002 by Jason Gerard
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid