Intro to XML, Part The Second
Ready to go?
If you open this file in another tab/window, you can see it rendered in your web browser. As you can see the whole file is displayed. If you’re in Internet Explorer or FireFox (or most other browsers), you should see a + in front of any element that has child elements. In our case, the document element has a +, but no other elements.
These allow you to collapse or expand elements that you want to consider. This becomes very helpful when you want to look for a certain piece of data in the XML file. I’d like to point out that all your browser is doing is showing you your file without performing any action on it. No UI has been applied to your document. If you would like to apply some UI to it, you can include
<?xml-stylesheet type="text/css" href="demoLayoutFile.css"?>
Just after your xml header, and define how the XML should be displayed. Each element name you use would then be available to define CSS to control. I’m not going to get into CSS here, since that’s outside the scope of XML. If you want me to build a CSS series, let me know!
If you have any questions, send them in. I’m here to help!