This section assumes that schema, is present in local system.
For validating XML through schema, you have to specify below two attributes in root element of XML document.
1. Using absolute path
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.example.com/ file://C:/schema/test/SampleOne.xsd'
2. Using relative path
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.example.com/ ./SampleOne.xsd'
Suggested Reading
http://www.wrox.com/WileyCDA/Section/Editing-XML-and-XML-Schema-in-Visual-Studio-2008.id-320326.html
Sunday, August 22, 2010
Tuesday, May 11, 2010
COBOL programs for windows
Most of the enterprise code till date is still in COBOL. Understanding COBOL is a good experience, and can be an arrow in your sheath.
I used Fujitsu NetCobol for running sample COBOL programs on windows. The IDE it provides is built on eclipse platform and thus is convenient for a person already using eclipse, RAD or similar IDE..
For now running COBOL programs seems to be fun and learning... :)
I used Fujitsu NetCobol for running sample COBOL programs on windows. The IDE it provides is built on eclipse platform and thus is convenient for a person already using eclipse, RAD or similar IDE..
For now running COBOL programs seems to be fun and learning... :)
Determining version of compiled class..
Came across an issue which involved determining on what version a particular file was compiled. There is one nice utility that comes with JDK, which allows to get this information from class file.
Usage:
javap -verbose
if you want to redirect output to a text file.
javap -verbose TestClass >> output.txt
Usage:
javap -verbose
if you want to redirect output to a text file.
javap -verbose TestClass >> output.txt
Monday, February 22, 2010
Asynchronus Javascript and JSON !!!!
With ajax finding its due place in web app world, the need for faster communication with server components has manifested clearly. XML requiring large memory footprint is now frequently replaced by JSON as the medium of data communication. Since when I have been involved with JSON I am looking for some good Java-JSON binding framework. We have some good Java-XML binding frameworks (JAXB, JIBX, Castor to name a few.. ). Searching the internet following JSON binding frameworks seems to be doing what is required.
Jackson (http://jackson.codehaus.org/)
Skaringa (http://skaringa.sourceforge.net/)
If JSON-Java is there, aren't you finding yourself thinking about XML-JSON conversions. Yes you can enjoy reading and example at http://www.thomasfrank.se/xml_to_json.html
Suerly, there are other tools for the same purpose which are budding.
Particularly interesting are the tools coming up that aims to achieve what has been done with XML for a long time, i.e XSLT. Go on with some reading at the links below and you will find them interesting.
http://goessner.net/articles/jsont/ (XML: XSLT :: JSON : -----)
Jackson (http://jackson.codehaus.org/)
Skaringa (http://skaringa.sourceforge.net/)
If JSON-Java is there, aren't you finding yourself thinking about XML-JSON conversions. Yes you can enjoy reading and example at http://www.thomasfrank.se/xml_to_json.html
Suerly, there are other tools for the same purpose which are budding.
Particularly interesting are the tools coming up that aims to achieve what has been done with XML for a long time, i.e XSLT. Go on with some reading at the links below and you will find them interesting.
http://goessner.net/articles/jsont/ (XML: XSLT :: JSON : -----)
........
Friday, January 15, 2010
Few strange errors..
1. java.lang.classFormatError: Bad magic number at offset=0
probable cause: deploying a corrupted jar file.
When you create a jar file using command jar -cf and if by chance you forget to specify the name of jar file, then the classes are corrupted you have to recompile the classes and again create the jar file.
2. Ajax response getting cached.
On using below code I observed that servlet was hit only once, the reason being that the response is cached by IE
xmlHTTP.open("GET" ,"../servlet/MyServlet", true);
xmlHttp.send(null);
hence when using "GET" method in ajax request, (based on your requirement i.e if you do not want the browser to cache your response) set the
response.setHeader("Cache-Control", "no-cache");
in your server side code, in this case servlet.
probable cause: deploying a corrupted jar file.
When you create a jar file using command jar -cf and if by chance you forget to specify the name of jar file, then the classes are corrupted you have to recompile the classes and again create the jar file.
2. Ajax response getting cached.
On using below code I observed that servlet was hit only once, the reason being that the response is cached by IE
xmlHTTP.open("GET" ,"../servlet/MyServlet", true);
xmlHttp.send(null);
hence when using "GET" method in ajax request, (based on your requirement i.e if you do not want the browser to cache your response) set the
response.setHeader("Cache-Control", "no-cache");
in your server side code, in this case servlet.
Subscribe to:
Posts (Atom)
