Click here to Skip to main content
Licence 
First Posted 17 Feb 2002
Views 68,176
Bookmarked 15 times

State names and abbrev in XML

By | 17 Feb 2002 | Article
An XML file containing US state and territory names and their two letter abbreviation.

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Jason Gerard

Web Developer

United States United States

Member

Jason has been coding professionally since 1998. He is an expert with Java, J2EE, C#, .NET, and VB.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmemberfredatcodeproject3:30 29 Feb '12  
Generalproper function applied ;) Pinmemberandrei_teodorescu22:51 18 May '11  
GeneralYou totally rock! PinmemberKim Finleyson11:03 14 Aug '08  
QuestionWhat about an XML list of world countries? PinmemberJesse Sedwick9:37 2 Jul '08  
Generalthanx Pinmembersuniltauro5:15 5 Oct '07  
QuestionI need some type of state list and more importantly, a city list Pinmembertejas5518:27 9 Sep '07  
GeneralAWESOME Pinmemberregwood799:01 27 Oct '06  
GeneralThanks! Pinmemberlexzxzx17:05 24 Apr '06  
GeneralCapitals PinsussAnonymous3:34 21 Oct '02  
GeneralRe: Capitals PinsussAnonymous3:31 16 Apr '04  

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.

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