3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by xml_looser
0

>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.

0
<?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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.