02Hero XML
2:44:46
Calling all Limited Time Offer lovers
Any day now we will need to update our prices, lock in before our rates go up.It’s not limited, It’s a no-brainer.
Topics
- XML Overview and Context (12:47)
- Elements (08:22)
- Nesting Elements (09:18)
- Attributes (08:12)
- More Then Just Leftovres (13:53)
- Validation (08:17)
- E4X - ActionScript 3.0 (24:56)
- XML DOM (11:12)
- JavaScript (13:51)
- Looping XML (14:19)
- XML as a Remote (09:18)
- Loading XML in PHP (04:57)
- Elements and Attributes in PHP (04:44)
- foreach (07:00)
- PHP XML compare (05:07)
- Modifying XML (08:34)
What is the real need behind data storage?
A good question to think about before learning more about XML or the many ways to store and transport data on the web(or any application) is to understand why we need a separate language for data storing. You might be new to development or a veteran by now and if you worked with more then one programing language at this stage you must of noticed that there are many things that are similar but even more so many things that are just not the same. for Language A(lets say PHP) to talk with language B(lets say JavaScript) they must have some common denominator and they don't so how can they communicate with each other and share information there must be a way for us to interact with each other (and there are many ways the most common ones are XML, JSON & sockets(such as AMF - not covered in this title)).
Second problem is how do we store information in general in a way that the information could be shared between more then one application. it must be out of the scope of the application to do so and as such XML is a really great option so before we watch the videos and become XML masters lets take a quick over view of the alternatives.
What is XML?
XML sounds like HTML.. well not really but it does have that ML part in it and its not by chance. The same organization created it the W3C. Although XML was born after HTML (a lot after) it didn't come to replace HTML. The creators of HTML noticed that HTML has a lot of very powerful features from layout,organization and interactive powers but as the web was evolving it seamed like a smart move to separate between some of these elements. Who cares about history what maters is what it actually is. So XML is a byproduct of HTML. XML is where we like to put in content that needs to be organized. XML since its creation became a very popular option for data storing. So in the most simple terms XML is not a replacement for HTML but was created to store/transport data in a data focused way without the clutter of having nodes that have visual meaning its all about structure while HTML was designed to showcase how data looks like. AKA HTML=Showing data , XML = Storing Data.
While HTML nodes do things a B tag will bold what ever is inside it XML is just a data bucket it has no information that has a visual reference its just "nodes". Although XML originated from a need to separate data from XML it has been widely embraced by all programing languages as a means to store/transport data.
Since the early days of XML it was a big hit. you would be surprised to know how deeply this technology is in most of what we do online, mobile, desktop. you name it XML is there. many times with other file extensions to hide them. XML is one of the most common data storage technologies. XML is ideal for small set of data that doesn't change often such as configurations, RSS feeds and such. There are many other storage technologies that we should explore such as Database and JSON.
So why use a Database if we have XML?
Before we can delve into why to use one over the other lets take a quick detour and understand what are databases. A Database goal is to store information in a easy to search way its built for a large amount of data and built to change quickly and repeatedly. Imagine a web site that is working of an XML file that changes often imagine 10 people trying to change the file at the same time. what will happen? Exactly something very unexpected on the other hand Databases are built to deal with these type of issues they are built to read write and and they produce a quick way to get only the data that you needs. While XML is really what you see is what you get. Now we must mention that you can produce XML on the fly on the server to transfer data(many times these types of data are called Data Packets or Deltas). But that is just cheating to creating XML on the fly(well not exactly cheating). It creates many more steps for our poor server as we would need to grab data from a DB convert it to XML and then send it to the client. when ever we can skip steps its always better and faster and that leads us to the next modern type JSON.
What is JSON and when to use it(vs. XML)?
JSON is one of the more modern options. It was boarn out of some issues with XML when the need for smaller data packets arised to when dealing with live data such as live games,chat and such. The core idea behind JSON that seperates it from XML is its goal to keep the data size small to enable quicker communication. this technology is ideal in scenarios when you have a lot of data communication and you want to save on data sizes. XML can easily become really huge as it has a lot of structure involved. JSON on the other hand is a simple translation of objects into strings. you don't need to know actually how to write or read JSON all you need is a parser that would take your objects and covert them to a JSON string and send it out while on the other end you would have a JSON encoder. Most modern (if not) languages have a built in JSON encoder/decoder or an open source solution(and XML as well so its down to needs). JSON is ideal for fast small data feeds while not as optimized for large amounts of data and isn't ideal for storing as its not very human readable (it can be stored and is stored many times but it shines really in small live data interactions). So JSON would be ideal for data that isn't saved that needs to be as small as possible while XML is ideal for when you want to store large amounts of data that could/might need to be person readable(such as if you manually edit the data).
Our free content is sponsered by these ads become a prime member and get rid of them.
Calling all Limited Time Offer lovers
Any day now we will need to update our prices, lock in before our rates go up.It’s not limited, It’s a no-brainer.

