02.06.2013 Views

XML Demystified

XML Demystified

XML Demystified

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 Creating an <strong>XML</strong> Document<br />

Review any documentation, such as that for a new account, which describes the<br />

information required to open this account.<br />

Here’s a list of the information that’s needed to open a new account:<br />

• First Name<br />

• Last Name<br />

• Title<br />

• Company<br />

• Street Address 1<br />

• Street Address 2<br />

• City<br />

• State<br />

• Zip<br />

• Business Phone<br />

• Cell Phone<br />

• Home Phone<br />

• Fax<br />

• E-mail<br />

• Account Number<br />

Practically any word can be used as an <strong>XML</strong> markup tag so long as it isn’t a<br />

reserved <strong>XML</strong> word, such as , which is a processing instruction. The<br />

element tag cannot contain any white space. In places where white space makes it<br />

easier to read, such as “first name,” an underscore is typically used: “first_name.”<br />

<strong>XML</strong> parsers are case sensitive so “first_name” is not equal to “First_Name.” The<br />

common convention is to use all lowercase letters as it makes it less confusing for<br />

the programmers parsing the <strong>XML</strong>. The word should describe the information.<br />

Many times you can use the label you’ll use on the order form to describe the<br />

information for the <strong>XML</strong> markup tag. For example, a new account form will have<br />

First Name as a label. It makes sense to use this as the <strong>XML</strong> markup tag for the<br />

customer’s first name.<br />

19<br />

Creating <strong>XML</strong> Markup Tags

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!