Rank amateur here. I get the instructions on HOW to use an empty element in XML. But why would you? What would it be used for, other than (I guess) to add a blank record when th
From my experience, Ive come across many of these formats when using APIs. Sometimes, the API creator has variables that are empty, thus resulting in these empty XML tags. For example, let's say you are creating a website that gathers hotel availability for different hotels. Company A ( some hotel company ) provides you with access to their API. You send a request and they provide you with the following:
2008-01-10
TRUE
But Sometimes you may get:
2008-01-10
FALSE
Or sometimes you may get:
2008-01-10
As a developer, you have to create code that is ready for any type of response since we dont know exactly how the data is sent back from the API creators, which is why this is mentioned in tutorials. Hope this helps.