Alagu Seenivasan

+ Follow
since Sep 30, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alagu Seenivasan

If you make a constructor private it does not mean there will be only one object.
But making a constructor private you can make sure there is only one object at all times (Singleton class)
If your doubt is very basic, (ie) how to convert a java object into an xml document, this is what you should do.
1. Write a java program to create a text file (e.g a.xml)using FileWriter (or any low level streams).
some thing like this,
FileWriter fw=new FileWriter(new File("a.xml"));
fw.write("<?xml version=\"1.0\"?>");
fw.write("<Name>" + obj.Name + "</Name>");
You will have to write another java program to parse this document using a parser like "xerces" (from and create the object from the parsed values.
If your doubt is about how to differentiate between an int and a string, since everything is treated as text in an xml document,
you could use attributes in the xml document.
For Example,
<Name type="String">
John Smith
<Phone type="int">

[This message has been edited by Alagu Seenivasan (edited December 20, 2000).]
There are few xml based communication protocols under development.
SOAP (Simple Object Access Protocol) is one of them.
SOAP is a light weight communication protocol used for communication between applications. It is designed to communicate via HTTP and it is based on XML.
Any protocol whether http or xml-rpc, if it involves "lot of records" will be slower than "few records"

[This message has been edited by Alagu Seenivasan (edited December 20, 2000).]
Recently I came across an interesting product, XYZFind
( )
XYZFind is a persistent repository for XML integrated with a powerful search and query processor.
� A single repository for all XML, regardless of document type.
� Indexes any well-formed XML (DTD agnostic; no schema design or configuration required).
� Incremental Update Incrementally add or delete documents from the repository. Automatically handles changes to document structure in addition to changes in the data values.
� No restrictions on number or types of documents
� Built-in statistics about the documents including the number of occurrences of each unique value (both text and numeric), the hierarchical relevance (what level of depth in the parent-child hierarchy) for every value in the index, and the minimum and maximum values for numeric elements.
Search and Query
� Global Search
� Path-specific search
� Query support for Boolean operators
� Open-ended queries (wildcard query any of a given element's children)
� Unrooted queries (match patterns requiring no absolute path)
� Queries on numeric ranges
� Aggregated results (Document/sub-document content, versus a listing of URLs)
� Directives on which fields to return and/or suppress in returned results
� Metadata results, including lists of available document types, lists of documents, and schema descriptions
� Results pagination
� Aggregated results across common and extended schemas
� XML / HTTP (using XYZQL, our XML Query Language)
� Java API
I changed the header to
<?xml version="1.0" encoding="ISO-8859-1" ?>
Now it works fine.

How do you handle non-english characters ?
I have to parse the following
I am using xerces to parse. It does not work. The character � is replaced by a ?.
I am trying to convert the xml to a text file.
I tried
It does not work either .
Any ideas ? Is it something to do with the parser ?

1. "Arbortext's Epic E-Content Engine (E3) aggregates content from disparate sources, converts that content to reusable XML components, stores those components in a content repository, and assembles and distributes content to a multitude of devices."
2. From Bluestone's article "Building Financial Applications Using Dynamic XML servers"
"XML servers break down into two basic categories
respository XML servers and dynamic xml servers.
Repository-based XML servers essentially store XML documents for efficient storage, update and retrieval. As one would expect, these server products tend to be offered by databse companies as well as some of the traditional SGML companies like Arbortext, Poet and Inso. These servers will become important as more information begins to be held and stored in XML documents "
Content management is one application where data can be stored in XML format. I am still trying to find out what are these XML servers and what is an XML Repository etc
- Srini.

I understand that XML is not a substitute for RDBMS.
What prompted me to try to capture persistent data in the form of xml as a seperate entity or with in an RDBMS table, are two things
Firstly the project ORACLE did.
"Oracle moved the site's assets (documents, images, scripts, etc.) from file systems around the world into a single content management system (CMS) that they built on the Oracle8i platform."
This includes storing HTML content as is, in a table as a CLOB (character Large Object ?)
Secondly, the article "Creating XML based web applications using visual age for java" from the November'00 edition of Java Developer Journal. The authors explain a "Conference Survey Application" where they suggest to keep the data in XML.
(The data is the results of the survey. How many votes per category etc. Not a complex data)
Following is the explanation.
"using XML documents as the vehicle for persistent data, you maintain the flexibility to mine the data as you deem fit without being forced down any particular path in terms of how it will be presented. For the amount of data being represented here, using a relational database would be overkill, while using serialized beans is overly complex. Because XML is self-describing by definition, and XML parsers are readily available, using XML is preferable to a flat file (which might use, for example, name-value pairs), where the programmer is forced to write a custom parser."
I still beleive that while XML is not a substitute for RDBMS, it can be an alternative some times.
What do you think ?

[This message has been edited by Alagu Seenivasan (edited December 04, 2000).]
Hi Guys,
I am doing some research on using xml instead of RDBMS to store persistent data (or store xml data in an RDBMS)
I would appreciate any directions or links to related resources on the net.
Thank you,
There is a good example with code in "Core Servlets and Java Server Pages" by "Marty Hall"
20 years ago

Originally posted by kantu Deshpande:
byte b;
int i=257;
[b]b= (byte)i;

If I type cast as shown above, I'm getting answer b=1. But, if I intialize int i=144 I'm getting the answer b=-112. Can any body explain how this type casting been done. Please if you give me one example, I would really appreciate.

int i=257 is represented as 0000 0001 0000 0001
when you cast an int into byte only the lower order bits are copied
so byte b= 0000 00001 which is 1.

int i=144 is represented as 0000 0000 1001 0000
1001 0000 (in 2's complement form) represents -112.
(to get the 2's complement of 112)
112 = 0111 0000
1' complement = 1000 1111
add 1 = 1001 0000

[ for more info search this forum for the words - 2's complement ]

[This message has been edited by Alagu Seenivasan (edited October 05, 2000).]
(#132)TRUE or FALSE:if an exception is not caught,the finally block will run and the rest of the method is skipped. - TRUE.
The question does not say "only when it is not caught".
There is a difference.
As far as this question is concerned, it is TRUE.
May be the following question's answer is FALSE.
TRUE or FALSE: The finally block will run and the rest of the method is skipped only when an exception is not caught

[This message has been edited by Alagu Seenivasan (edited October 05, 2000).]
Assumption: characters() callback is not automatically fired for empty elements.
This indeed is a strange requirement because I need to convert the xml into a fixed length text file where,if the element is not present there should be so many blanks. So after looking around I had already done exactly what you said.
In the "startelement" set a flag and remember the supposed length
and reset the flag in the "characters". check the flag in the "endelement" and do accordingly.
I know that the firing "characters" call back is (parser) implementation dependent.
My problem is solved for the time being. If I come across a better solution, I will post it here.
Thanks Frank.
[This message has been edited by Alagu Seenivasan (edited October 02, 2000).]
"An object of a sub-class can be assigned to a super class's instance variable". Since "Object" is the root class, any class descending from "Object" can be assigned to "Object".
another example