Hello! I am very interested in learning how to create XML data using XSLT, so after reviewing some of the information, I took a shot at my first XML dataset plus a corresponding schema. That being said, I am a total newb to XML and am sure there is something wrong with this. Before I do that, here was what I was trying to accomplish - something simple to start.
I wanted to create a script on a site that contained recent news items from a ficticious company. These items would be written by whomever runs the site. Since these would be updated frequently, I wanted to create an easy way to dynamically update the information while only coding the html once. That is why I want to use XML for it. At this point, the only way the information can get updated is through editing the xml file itself. Once I get better at it, I would like to create a form that will update the xml data in the xml file.
I realize there are already all sorts of things out there that create this functionality and that is fine, but remember, I am trying to learn XML here, so this is where I started. Here is my code:
The XML file:
<news_item xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<teaser>Just some text here that is a teaser of the full news item</teaser>
<xs:element name="date" type="xs:string"/>
<xs:element name="teaser" type="xs:string"/>
<xs:element name="full_text" type="xs:string/>
Basically, what I need to know is 1.) If the syntax and structure is correct, and 2.) In the state that it is in now, can I start using code in my html to draw this info into the page and display it without any errors? Any tips on where to find simple code to allow me to simply pull this information into a div in my html page? Thanks.
I appreciate any feedback. Thanks!