Total Pageviews

Sunday, November 13, 2011

XML DOM

DOM (Document Object Model) defines a standard way for accessing and manipulating documents.
The XML DOM
The XML DOM defines a standard way for accessing and manipulating XML documents.
The XML DOM views an XML document as a tree-structure.
All elements can be accessed through the DOM tree. Their content (text and attributes) can be modified or deleted, and new elements can be created. The elements, their text, and their attributes are all known as nodes.

The HTML DOM
The HTML DOM defines a standard way for accessing and manipulating HTML documents.
All HTML elements can be accessed through the HTML DOM.

Example
<html>
<body>
<h1>W3Schools Internal Note</h1>
<div>
<b>To:</b> <span id="to"></span><br />
<b>From:</b> <span id="from"></span><br />
<b>Message:</b> <span id="message"></span>
</div>
<script type="text/javascript">
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","note.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.getElementById("to").innerHTML=
xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
document.getElementById("from").innerHTML=
xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML=
xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
</script>
</body>
</html>

Example
<html>
<body>
<h1>W3Schools Internal Note</h1>
<div>
<b>To:</b> <span id="to"></span><br />
<b>From:</b> <span id="from"></span><br />
<b>Message:</b> <span id="message"></span>
</div>
<script>
txt="<note>";
txt=txt+"<to>Tove</to>";
txt=txt+"<from>Jani</from>";
txt=txt+"<heading>Reminder</heading>";
txt=txt+"<body>Don't forget me this weekend!</body>";
txt=txt+"</note>";
if (window.DOMParser)
  {
  parser=new DOMParser();
  xmlDoc=parser.parseFromString(txt,"text/xml");
  }
else // Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async="false";
  xmlDoc.loadXML(txt);
  }
document.getElementById("to").innerHTML=
xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
document.getElementById("from").innerHTML=
xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML=
xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
</script>
</body>
</html>

XML


XML Schema is an XML-based alternative to DTD.
An XML schema describes the structure of an XML document.
The XML Schema language is also referred to as XML Schema Definition (XSD).
What You Should Already Know
Before you continue you should have a basic understanding of the following:
HTML / XHTML
XML and XML Namespaces
A basic understanding of DTD

What is an XML Schema?
The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.
An XML Schema:
defines elements that can appear in a document
defines attributes that can appear in a document
defines which elements are child elements
defines the order of child elements
defines the number of child elements
defines whether an element is empty or can include text
defines data types for elements and attributes
defines default and fixed values for elements and attributes
XML Schemas are the Successors of DTDs
We think that very soon XML Schemas will be used in most Web applications as a replacement for DTDs. Here are some reasons:
XML Schemas are extensible to future additions
XML Schemas are richer and more powerful than DTDs
XML Schemas are written in XML
XML Schemas support data types
XML Schemas support namespaces

W3C DTD

Introduction to DTD
A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes.
A DTD can be declared inline inside an XML document, or as an external reference.
Internal DTD Declaration
If the DTD is declared inside the XML file, it should be wrapped in a DOCTYPE definition with the following syntax:
<!DOCTYPE root-element [element-declarations]>
Example XML document with an internal DTD:
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>

External DTD Declaration
If the DTD is declared in an external file, it should be wrapped in a DOCTYPE definition with the following syntax:
<!DOCTYPE root-element SYSTEM "filename">
This is the same XML document as above, but with an external DTD (Open it, and select view source):
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
And this is the file "note.dtd" which contains the DTD:
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
Why Use a DTD?
With a DTD, each of your XML files can carry a description of its own format.
With a DTD, independent groups of people can agree to use a standard DTD for interchanging data.
Your application can use a standard DTD to verify that the data you receive from the outside world is valid.
You can also use a DTD to verify your own data.


Wednesday, November 9, 2011

What is left of 5 crores


The game show ‘Kaun Banega Crorepati’ (KBC) is an extremely popular game show in India hosted by Amitabh Bachchan. His charishma and mass appeal ensures that people are glued to their TV-sets during the show every week.

Recently, Sushul Kumar an IAS aspirant and school teacher won the grand prize of Rs.5 crores. He currently earns a meagre Rs.6,000 per month salary which is insufficient to lead a comfortable life.

I have seen from my vast experience that whenever there is excess money with a person, certain category of people called “vultures” hover around that person. The main aim of these vultures is to pinch as much money as possible from the naive and uninformed person.

Recently, Sushul Kumar an IAS aspirant and school teacher won the grand prize of Rs.5 crores. He currently earns a meagre Rs.6,000 per month salary which is insufficient to lead a comfortable life.

After meeting lakhs of people from various walks of life in my training programs, I have observed that there are very few people who give un-biased advice to needy investors. Although, not all advisors and consultants have an ulterior motive, many of them do and our bad experience in the past gives us the impression that all of them provide biased and wrong advice. Please understand that a person who has nothing to gain or loss by giving you suggestions regarding money management or other aspects of life is more believable then some person who stands to gain by selling you a product or service.

Whoever you are and whatever you earn, your financial success is dependent on the number of wise decisions you make in your life. Earning crores of rupees but not managing or investing it properly is worse than earning far less but investing and growing it effectively.

I urge you and your near and dear ones to wisely invest your time and money to increase your financial literacy thereby protecting yourselves from the vultures in the real world!


Unfortunately, earning a huge amount is not bundled with gaining “sound financial knowledge.” If Sushil Kumar or anyone of us does not take the efforts to learn and educate ourselves in the subject of financial literacy, we will sooner rather than later end up with unsatisfactory results in life.


The vultures can be insurance advisors selling (rather misspelling insurance policies such as ULIPs), mutual fund advisors approaching the prospective client with the entire list of “best-performing” schemes to invest in and stock brokers claiming to provide the best “tips” for super profits.

Want a Favour


Dear Friend,

On an average about 500-800 people read this blog regularly.
We have no idea how many Bangaloreans are reading this blog regularly.
Also we have no idea of how many out station readers of this blog have friends and relatives in Bangalore.

I want to ask you for a favour. Hope you will oblige me.

I request all blog readers of Bangalore and others who have friends and relatives in Bangalore
to inform their kith and kin of the next seminar on Stocks and Personal Finance in Kannada in Nov 2011. The workshop dates are 19-20 Nov 2011 (sat-sun) from 9am to 7pm at Bell Hotel, near City Railway Station.

To make it easy for your friends to take a decision of joining, we have organised a FREE Introductory Seminar on 9 Nov and 10 Nov ( wed, thur) at Bharatiya Vidya Bhavan, Race Course Road, Near Chalukya Hotel, Blore at 6 pm. They can attend any of the seminars and decide to join the workshop based on your advice.

What action you can take.

1- Make a list of 50 of your friends.
2-Out of which, select 30 friends who you think would value my workshop the most.
3- Send them an email requesting them to attend the free seminar on 9-10 Nov at Bharatiya Vidya Bhavan. at 6pm.
4- Send the news of the free seminar to at least 10 of them by sms.
5- Send us an email at successdigest@gmail.com and we will send you the sample text to be sent to your friends.

When to take action- Very urgent- Today or Tomorrow morning.
after that it may be too late.

The reason that I am asking you to send the emails from your email ID is because if I send the emails from my side, the mails are sure to bounce back or go to the junk folder. Whereas from your email ID, the emails sent to your contacts will be delivered without any problems.

Hope you will oblige me.
The whole exercise will take about 10 mins for you.
But that will go a long way for us to propagate the science of safe investment.
For more details call 9900520066 or ref to our website www.drbharathchandra.com for the syllabus or ref to our face book pages.

Thanks in advance.


----------------------------------------------------------------
Today's Analysis of Stock Market is as follows.

Today the Global cues are mixed.
Europe was up- Asia was mixed and as of now the American markets are mixed.
Indian markets are looking for direction from global cues-specially the Greece and Italy crisis.
But whatever happens is only a temporary setback.
On a long run basis the stock market has to go up.

Nifty is in hold position.
Other stocks which are in hold are.
TATA STEEL, HINDALCO, HDFC, MAHINDRA,. MARUTI, INFOSIS. TCS, RELIANCE,

BUY SIGNALS AS OF TODAY ARE.
BHEL, LARSEN, SESA GOA, STERLITE, SBI, AXIS BANK, HDFC BANK, TITAN,

I am still hoping that this rally is going to give us 10%.
Let us hope for the best.

All the best.

Share Market


Dear Friends,

The US and European Markets ended 0.5%-1 down on Friday. Let us see how they trade on Monday.

Tomorrow (7th Nov) is a holiday for Indian Stock markets on account of Bakrid.

Please read the previous blog on the upcoming Bangalore Stock Market Workshop in Kannada. Refer your friends and relatives for the Workshop.

I will update the blog tomorrow night after watching the global cues on Monday's trading session.

Share Market


Dear Friends,

Today's global cues are slightly negative. Most US and European markets have closed about 0.5% down. The crisis in Greece is affecting global markets thereby influencing Indian Stock markets also.

I am still holding on to my recent purchases. Still waiting for 10% profits in this rally.

Long term investors must continue as per their plan. Do not miss your monthly investments in bluechips.

Keenly watch the markets to see if your stocks give you 10% in the next few days.

All the other purchases you might have made for short term are HOLD. You can hold it hoping for 10% profits or wait for the 5% stop loss if it falls.


As per technical analysis, the following are BUY-
Sterlite Industries & L&T.