Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 5th, 2013, 06:29 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML data representation

If I take data (1,2,3,a,b,c,..) and I put it in XML form (<a>, <b>, <c>,..), does that mean that data becomes information because of XML? Does XML turn data into information by representing it in tags?

I am also reading here in a slideshow: "In JDOM, every XML tree is approached as a document even though the content has nothing to do with documents". I looked up the definition of 'document' on dictionary.com and it states that a document is meant as being informative. 'informative' means 'to convey information'. Then, if the purpose of XML is to represent data into information, why does the content of an XML tree supposedly not have anything to do with a document and therefore nothing to do with information? This is confusing. Perhaps the author of that slideshow was using different semantics than I have in my mind right now.

Any thoughts on this?

Thank you.
  #2 (permalink)  
Old April 5th, 2013, 06:32 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you are interested in the metaphysics of XML, you will find plenty of like-minded souls on the xml-dev mailing list.

The people here are more interested in the practicalities of programming.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
  #3 (permalink)  
Old April 5th, 2013, 06:44 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you mean this? http://www.xml.org/xml-dev/
  #4 (permalink)  
Old April 5th, 2013, 07:04 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Difficult to answer really, but in my mind at least XML is just another representation of data.

In XML speak an XML 'document' has some restrictions, in the sense that to be a proper document is must have only a single root element and be well formed (I think). Something that isn't well formed can still be valid XML if is is considered an XML 'fragment'.

A valid XML document:
Code:
<root>
  <child>1</child>
  <child>2</child>
</root>
A valid XML Fragment, but not a valid XML document:
Code:
  <child>1</child>
  <child>2</child>
A 'document' in this sense has little to do with word documents and the like. I wouldn't use a dictionary site like dictionary.com to look up definitions for terms used in a technical way, as they are likely to be different (which I think is probably what the author of the slideshow is getting at).
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #5 (permalink)  
Old April 5th, 2013, 07:26 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It makes sense now, indeed.
A document in XML has a root and children.. yes.

So if XML is just another representation of data, it does not necessarily mean that data becomes information when poured into the XML format? After all, information is meaningful by itself (and therefore having semantics), as is said here:
http://answers.yahoo.com/question/in...3173846AA6IEbh
XML translates data into a structure and our brain translates that structure into entities that make sense to us.. ultimately conveying to our brain that what is being seen is actually information. I have my doubts on that last part.

When we introduce 1 and 2 into the element <child>, then our brain (like the gestalt theory postulates: http://en.wikipedia.org/wiki/Gestalt_psychology) translates that <child> as having the 'child' relationship with its 'parent'. We therefore see it as a whole, an entity and not as a 'sum of parts'. Another relationship would be that values 1 and 2 are now associated with the word 'child'. I could say as well <a>1</a>, <a>2</a>. Now our brain knows that 1 is an 'a'. And so forth.

In practical terms however, XML (as is stated in the slides I am reading) represents data like this:

(input)XML file -> (search its structure and represent it)XPath -> (output) XAML, XHTML, XML, CSV. As we can see, another XML itself can be the result of an input XML file. Therefore it confuses me a little bit what the purpose of the language itself actually is. I agree that it is just another representation of data like you stated. In my example, one could say that one takes data, represents it into XML, uses XPath to search in its tree to use its values, to finally represent it into another format.

I will do some more thinking on this.


Similar Threads
Thread Thread Starter Forum Replies Last Post
two’s compliment binary representation of the negative value shantai BOOK: Beginning C# 2005 Databases 1 September 21st, 2009 05:44 PM
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
String representation in .NET ashooagarwal .NET Framework 1.x 0 July 2nd, 2007 09:12 PM
array representation malli_kv2 Java Basics 2 March 20th, 2007 11:05 PM
saxon:character-representation="decimal" ROCXY XSLT 3 November 9th, 2006 05:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.