File talk:XML.svg
Appearance
![]() | This file does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
icon content
[edit]The xml in this icon is not well formed. should be more along the lines of <problem><question /> <answer /></problem> —Preceding unsigned comment added by 74.202.89.125 (talk) 19:32, 4 February 2008 (UTC)
- It is well-formed. You're right that it would make more sense to wrap the <question> and <answer> elements in a separate <problem> element when you start adding more questions, but nothing in XML compels you to do that. You could add a new <giraffe> element after <answer> and it would still be valid, well-formed XML. 82.95.254.249 (talk) 21:28, 18 August 2008 (UTC)
- Contextually it is bad. Since in this instance, there is no coupling of "question" with "answer", so the two are logically disjoint. Since with XML you relate entities in subsets, you would use a main element for the question, and sub-elements for the question text and it's answer.
In this SVG, it asserts that <question> and <answer> are independent of eachother. At first glance it appears trivial, but later you realise:
- How can you distinguish each question's answer?
- If I give question and answer an attribute, i.e "muffin=blue" to link the two, why not just reduce complexity and give the parent element "muffin=blue"?
So, in other words. The guy at the top is CORRECT. The guy below him is wrong. —Preceding unsigned comment added by 81.138.133.197 (talk • contribs)
- Well no, I'm not. The point is that well-formed has a clearly defined meaning in the context of XML, see XML#Well-formedness. Is the document show in the SVG well-formed? Yes. Well-formedness is a very weak demand. (I did make a mistake saying the XML is "valid" -- it's not, validity also has a specific meaning and it involves having a DTD or schema, which this document doesn't have.)
- If this document was used in real life to provide a list of questions with answers, it probably wouldn't be done like this -- that's true. However, even in this case it's very easy to come up with an interpretation which makes sense: all <answer> elements belong to the last seen <question> element. Order of elements is significant in XML, so this works. XML doesn't say how to interpret the document, it just allows you to lay down a tree structure. This is a questionable design and it's easy to come up with a better one, but it's not in any way malformed.
- So again: this document is well-formed, it's just not as sensible as it could be. If anyone wants to step up and replace it with a more sensible alternative so we can avoid discussions like this in the first place, feel free... 82.95.254.249 (talk) 14:46, 1 June 2009 (UTC)
paba
[edit]<title>2008-10-14</title> <location>http://cdn.splashcast.net/assets/01/video/import-567131.flv</location> <meta rel="type">flv</meta> </track> </trackList> </playlist>
Better XML sturcture image
[edit]I created a new file with better XML structure but can't upload it - Not sure if this is an issue with my permissions or that the name "xml.svg" has been blacklisted.
![](http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/XML_Example.svg/220px-XML_Example.svg.png)