[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [Philosophical] What is an XML document?

  • From: Dimitre Novatchev <dnovatchev@gmail.com>
  • To: Roger L Costello <costello@mitre.org>
  • Date: Sat, 4 Jun 2022 20:20:22 -0700

Re:  [Philosophical] What is an XML document?
> <Greeting>Hello, world!</Greeting>

This may be an encrypted message...  Much more than it seems...  It may mean different things on different date-times...

And 10 thousand years from now archaeologists may accidentally discover it and have different theories about its meaning...

And generally it may not be possible to say which is the message and which is the noise -- depends on the observer. What some people think is the noise may be the really interesting content for others.


Thanks,
Dimitre

On Sat, Jun 4, 2022 at 11:00 AM Roger L Costello <costello@mitre.org> wrote:
Hi Folks,

There is a file on my laptop that consists exclusively of these characters:

<Greeting>Hello, world!</Greeting>

Question: Is the file an XML document?

Answer: No, it is simply a text file.

Evidence to support my answer: I opened Notepad, dragged and dropped the file into Notepad, and subsequently Notepad displayed the file's content as a linear sequence of characters, i.e., text.

Philosophical Discussion:

An XML document is "in the eye of the beholder." That is, to Notepad my file is just text, but to Apache Xerces my file has a structure consistent with the XML specification and therefore -- to Xerces -- it is an XML document.

In order for a file to be considered an XML document, two things must align:

1. The application assessing the file must have internalized the grammar rules specified in the XML specification.

2. The application must process the file to determine that the file has a structure consistent with the grammar rules.

Only if 1 and 2 are satisfied may the application pronounce "Yes, this is an XML document."

Let's dig a bit deeper...

Clearly the following is a linear sequence of characters:

<Greeting>Hello, world!</Greeting>

It only becomes an XML document when an XML-aware application has processed it (assessed it) and determined compliance with the XML grammar. The most common method of determining if an input string conforms to a grammar is to lexically analyze the string into tokens and then see if the tokens matches a specified grammar; along the way an in-memory "parse tree" is created. If we successfully create a complete parse tree, then we have an XML document. If we have an XML document, then we have successfully created a complete parse tree. An XML document is a parse tree.

No one would deny that a parse tree is a "data structure." Therefore an XML document is a data structure.

Do you agree with my line of reasoning? Where does my logic go astray?

/Roger



_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.