Friday, March 20, 2020
Create, Parse and Manipulate XML Documents With Delphi
Create, Parse and Manipulate XML Documents With Delphi What is XML? Extensible Markup Language is aà universal language for data on the Web. XML gives developers the power to deliver structured data from a variety of applications to the desktop for local computation and presentation. XML is also an ideal format for server-to-server transfer of structured data. Using an XML parser, software evaluates the hierarchy of the document, extracting the structure of the document, its content, or both. XML is in no way limited to Internet use. In fact, XMLs main strength organizing information makes it perfect for exchanging data between different systems. XML looks much like HTML. However, whereas HTML describes the layout of content on a webpage, XML defines and communicates data, it describes the type of content. Hence, extensible, because it is not a fixed format like HTML. Think of each XML file as a self-contained database. Tagsà the markup in an XML document, offset by angle brackets delineate the records and fields. The text between the tags is the data. Usersà perform operations like retrieving, updating and inserting data with XML using a parser and a set of objects exposed by the parser. As a Delphi programmer, you should know how to work with XML documents. XML with Delphi For more information about pairing Delphi and XML, read: Learn how to store TTreeView component items to XML preserving the Text and other properties of a tree node and how to populate a TreeView from an XML file. Simple Reading and manipulating RSS feeds files with DelphiExplore how to read and manipulate XML documents with Delphi using the TXMLDocument component. See how to extract the most current In The Spotlight blog entries (RSS feed) from the About Delphi Programmingà content environment, as an example. Create XML files from Paradox (or any DB) tables using Delphi. See how to export the data from a table to an XML file and how to import that data back to the table. If you need to work with dynamically created TXMLDocument component, you might get access violations after you try to free the object. This article offers a solution to this error message. Delphis implementation of the TXMLDocument component, which uses Microsoft XML parser by default, does not provide a way to add a node of the ntDocType (TNodeType type). This article provides a solution to this problem. XML in Detail XML W3CPeruse the full XML standard and syntax at the W3C site. XML.comA community website where XML developers share resources and solutions. The site includes timely news, opinions, features and tutorials.
Wednesday, March 4, 2020
A Fable by Mark Twain
A Fable by Mark Twain One of the basic exercises (or progymnasmata) practiced by students of classical rhetoric was the fable- a fictional story meant to teach a moral lesson. What lesson about the nature of perception is contained in A Fable, by American humorist Mark Twain? A Fable by Mark Twain Once upon a time, an artist who had painted a small and very beautiful picture placed it so that he could see it in the mirror. He said, This doubles the distance and softens it, and it is twice as lovely as it was before. The animals out in the woods heard of this through the housecat, who was greatly admired by them because he was so learned, and so refined and civilized, and so polite and high-bred, and could tell them so much which they didnt know before, and were not certain about afterward. They were much excited about this new piece of gossip, and they asked questions, so as to get at a full understanding of it. They asked what a picture was, and the cat explained. It is a flat thing, he said; wonderfully flat, marvelously flat, enchantingly flat and elegant. And, oh, so beautiful! That excited them almost to a frenzy, and they said they would give the world to see it. Then the bear asked: What is it that makes it so beautiful? It is the looks of it, said the cat. This filled them with admiration and uncertainty, and they were more excited than ever. Then the cow asked: What is a mirror? It is a hole in the wall, said the cat. You look in it, and there you see the picture, and it is so dainty and charming and ethereal and inspiring in its unimaginable beauty that your head turns round and round, and you almost swoon with ecstasy. The ass had not said anything as yet; he now began to throw doubts. He said there had never been anything as beautiful as this before, and probably wasnt now. He said that when it took a whole basketful of sesquipedalian adjectives to whoop up a thing of beauty, it was time for suspicion. It was easy to see that these doubts were having an effect upon the animals, so the cat went off offended. The subject was dropped for a couple of days, but in the meantime, curiosity was taking a fresh start, and there was a revival of interest perceptible. Then the animals assailed the ass for spoiling what could possibly have been a pleasure to them, on a mere suspicion that the picture was not beautiful, without any evidence that such was the case. The ass was not troubled; he was calm, and said there was one way to find out who was in the right, himself or the cat: he would go and look in that hole, and come back and tell what he found there. The animals felt relieved and grateful and asked him to go at oncewhich he did. But he did not know where he ought to stand; and so, through error, he stood between the picture and the mirror. The result was that the picture had no chance, and didnt show up. He returned home and said: The cat lied. There was nothing in that hole but an ass. There wasnt a sign of a flat thing visible. It was a handsome ass, and friendly, but just an ass, and nothing more. The elephant asked: Did you see it good and clear? Were you close to it? I saw it good and clear, O Hathi, King of Beasts. I was so close that I touched noses with it. This is very strange, said the elephant; the cat was always truthful beforeas far as we could make out. Let another witness try. Go, Baloo, look in the hole, and come and report. So the bear went. When he came back, he said: Both the cat and the ass have lied; there was nothing in the hole but a bear. Great was the surprise and puzzlement of the animals. Each was now anxious to make the test himself and get at the straight truth. The elephant sent them one at a time. First, the cow. She found nothing in the hole but a cow. The tiger found nothing in it but a tiger. The lion found nothing in it but a lion. The leopard found nothing in it but a leopard. The camel found a camel, and nothing more. Then Hathi was wroth, and said he would have the truth, if he had to go and fetch it himself. When he returned, he abused his whole subjectry for liars, and was in an unappeasable fury with the moral and mental blindness of the cat. He said that anybody but a near-sighted fool could see that there was nothing in the hole but an elephant. MORAL, BY THE CAT You can find in a text whatever you bring, if you will stand between it and the mirror of your imagination. You may not see your ears, but they will be there.
Subscribe to:
Posts (Atom)