Using the following data, create a well-formed XML file... Please see attached file.

can you help me with xml coding with that attached file? I really need it ASAP.

Recommended Answers

All 2 Replies

>can you help me with xml coding with that attached file?
XML is a hierarchical data modeling language. The image you gave shows nested data in the blocks to the right, so this:

+-----------------+
|     |     | baz |
|     | bar +-----+
|     |     | baz |
| foo +-----+-----+
|     |     | baz +
|     | bar +-----+
|     |     | baz |
+-----------------+

Might result in the following XML if you use the height of the blocks to mark a nesting level:

<foo>
    <bar>
        <baz>
        </baz>
        <baz>
        </baz>
    </bar>
    <bar>
        <baz>
        </baz>
        <baz>
        </baz>
    </bar>
</foo>

I'm sure you can figure out the rest on your own. Just interpret the image to something sensible and the XML structure practically writes itself.

<?xml version="1.0"?>

<root>
	<customer>
		<name>Mr. Lynn</name>
		<type>Home</type>
		<address>
			<nr>211</nr>
			<place>Fox-Street</place>
			<town>Greenville</town>
			<postno>NH80021</postno>
			<phone>(315) 555-1812</phone>
			<email>dlynn@nhs.net</email>
		</address>
		<order id="OR10311">
			<date>8/1/2004</date>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
		</order>
	</customer>
	<customer>
		<name>Mr. Lynn</name>
		<type>Home</type>
		<address>
			<nr>211</nr>
			<place>Fox-Street</place>
			<town>Greenville</town>
			<postno>NH80021</postno>
			<phone>(315) 555-1812</phone>
			<email>dlynn@nhs.net</email>
		</address>
		<order id="OR10311">
			<date>8/1/2004</date>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
		</order>
	</customer>
	<customer>
		<name>Mr. Lynn</name>
		<type>Home</type>
		<address>
			<nr>211</nr>
			<place>Fox-Street</place>
			<town>Greenville</town>
			<postno>NH80021</postno>
			<phone>(315) 555-1812</phone>
			<email>dlynn@nhs.net</email>
		</address>
		<order id="OR10311">
			<date>8/1/2004</date>
			<item>
				<product>DCT3Z</product>
				<qty>1</qty>
				<price>559.59</price>
			</item>
		</order>
	</customer>
</root>

data a wronge copy and paste

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.