<head>
<script type="text/javascript">
function loadXMLDoc()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
alert('Http State is:' + xmlhttp.readyState);
alert('HTTP Status is :' + xmlhttp.statusText);
if (xmlhttp.readyState==4 )
{
if ( xmlhttp.status==200 )
{
alert('Response data as String :' + xmlhttp.responseText);
alert('Response data as XML:' + xmlhttp.responseXML);
}
}
}
try {
xmlhttp.open("GET","http://www.krishnababug.com/",true);
xmlhttp.send("");
}
catch (e) {
alert(e);
}
}
</script>
</head>
<body>
<h2>How to use XMLHttpRequest object</h2>
<div id="myDiv"></div>
<button type="button" onclick="loadXMLDoc()">Load URL - Click to change state</button>
</body>
</html>
References:
[1] [2]
Note : working only on Internet Explorer

Some times we may require to parse a given XML file to populate the data in objects.
So here the only source we have is a sample XML file, nothing else not even a xsd file available.
Requirement description :
You are given just one sample XML file which needs to be parsed and populate the data from XML file to java class objects.
There is no XSD (XML schema definition) file available.
Sample XML file contents :
Solution :
The solution I followed for this is using the jibx tool to reduce the code burden.
JIBX is one of the best xml parsing tool for xml data binding.
So all we need to do; to use jibx tool we have to do the below mentioned 5 steps.
1. Analyze the sample.xml
2. write the binding.xml.
3. Write the classes identified.
4. Compile using build.xml.
5. Write main method to parse the xml file and show the data.
Example below
<results
xmlns="urn:www-collation-com:1.0"
xmlns:coll="urn:www-collation-com:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:www-collation-com:1.0
urn:www-collation-com:1.0/results.xsd">
<ComputerSystem array="1" guid="0A59DB143A8B3B0F9385FE6A3E0BE095" xsi:type="coll:com.collation.platform.model.topology.sys.sun.SunSPARCUnitaryComputerSystem">
<fqdn>islrpbssn03.in.ibm.com</fqdn>
<type>ComputerSystem</type>
<OSRunning guid="8B9EF833438F3F769DF1C6B6F8EB6704" xsi:type="coll:com.collation.platform.model.topology.sys.sun.Solaris">
<OSConfidence>100</OSConfidence>
<OSName>SunOS</OSName>
<OSVersion>5.10</OSVersion>
<OSMode>64-bit sparcv9 applications, vis2 vis ,32-bit sparc applications, vis2 vis v8plus div32 mul32</OSMode>
</OSRunning>
<ipInterfaces array="1"
guid="B0DB02C0C1D03E248FCCF97D3744EFDF"
lastModified="1270881893121"
parent="0A59DB143A8B3B0F9385FE6A3E0BE095" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="0188E1E8633E3F5C849E2454ED7F92A2" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="3856A334B3D6306E9A2C5CEC97357808" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="1FF6C43DFD7A3D658939894CD2840FBB" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>9.126.85.190</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="2"
guid="4CE10626AD1F35879F2BFEFB911C0596"
lastModified="1270881893058"
parent="0A59DB143A8B3B0F9385FE6A3E0BE095" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="A5B55BF06F4F3568B0A3A08566776E34" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="C8538176AA8435568BAE99C81BDEFADE" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>127.0.0.1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
</ComputerSystem>
<ComputerSystem array="2" guid="1AE1BAE9EA5F37E3891BA093962E80D2" xsi:type="coll:com.collation.platform.model.topology.sys.linux.LinuxUnitaryComputerSystem">
<fqdn>islrpbeixn50.in.ibm.com</fqdn>
<type>ComputerSystem</type>
<OSRunning guid="70081092A0FB3F3CBF28A93850781F8B" xsi:type="coll:com.collation.platform.model.topology.sys.linux.Linux">
<OSConfidence>100</OSConfidence>
<OSName>Linux</OSName>
<OSVersion>SUSE Linux Enterprise Server 10 (i586)</OSVersion>
<OSMode>64-bit</OSMode>
</OSRunning>
<ipInterfaces array="1"
guid="C1E26AF496CB3E6898D4C681E7D4890F"
lastModified="1271145535996"
parent="1AE1BAE9EA5F37E3891BA093962E80D2" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="BBF92BDB2A9333B999AA5D1F3D2D7DB2" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="29D627F80C0635BD9FAD32842E97EC4B" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>0:0:0:0:0:0:0:1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="2"
guid="364EF12203853318BCAF2BE2DB279B67"
lastModified="1271145535918"
parent="1AE1BAE9EA5F37E3891BA093962E80D2" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="A5B55BF06F4F3568B0A3A08566776E34" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="29D627F80C0635BD9FAD32842E97EC4B" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>127.0.0.1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="3"
guid="99FE67EE21B733D18D730D9EB9668D9C"
lastModified="1271145535964"
parent="1AE1BAE9EA5F37E3891BA093962E80D2" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="8ABCC5879A4532DFAE9E8341D10F01B6" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="802D599BA72A3C84A78B2123F0E6DBB2" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>fe80:0:0:0:20e:cff:fe67:5433</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="4"
guid="BA733238179833AD91D43E542B9F93CC"
lastModified="1271145535980"
parent="1AE1BAE9EA5F37E3891BA093962E80D2" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="DB0FFF95E752314596831ACC9A0FC100" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="802D599BA72A3C84A78B2123F0E6DBB2" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>9.184.66.239</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
</ComputerSystem>
<ComputerSystem array="3" guid="5DB5CC25116C39C484C69F4330FEFF86" xsi:type="coll:com.collation.platform.model.topology.sys.aix.AixUnitaryComputerSystem">
<fqdn>islrpbixv06.in.ibm.com</fqdn>
<type>ComputerSystem</type>
<OSRunning guid="6CD3AF45BE603572ABF97B4B1D261D96" xsi:type="coll:com.collation.platform.model.topology.sys.aix.Aix">
<OSConfidence>100</OSConfidence>
<OSName>AIX</OSName>
<OSVersion>5.3.0.0</OSVersion>
<OSMode>64-bit</OSMode>
</OSRunning>
<ipInterfaces array="1"
guid="E518A4B9197138D0AB7A5671A7897A77"
lastModified="1270881954418"
parent="5DB5CC25116C39C484C69F4330FEFF86" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="A5B55BF06F4F3568B0A3A08566776E34" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="2038D4670E123063A7668E8AB92761C2" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>127.0.0.1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="2"
guid="ADDB51DDC2B73109ACD8374768D17BBE"
lastModified="1270881954214"
parent="5DB5CC25116C39C484C69F4330FEFF86" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="1832ABD3CD2D31E586A8FA14542B5C44" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="3FE22AF17C5F309CAB28E4C3FDBACB76" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="D8AC8F9F2A8433149A5CA169F466AAE4" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>9.122.166.118</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="3"
guid="529EED8B732333188CFD3490DA1922C5"
lastModified="1270881953980"
parent="5DB5CC25116C39C484C69F4330FEFF86" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="BBF92BDB2A9333B999AA5D1F3D2D7DB2" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="2038D4670E123063A7668E8AB92761C2" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>0:0:0:0:0:0:0:1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
</ComputerSystem>
<ComputerSystem array="4" guid="6E4C78F0B9463420ADBC21A2658AA22A" xsi:type="coll:com.collation.platform.model.topology.sys.linux.LinuxUnitaryComputerSystem">
<fqdn>rt4.in.ibm.com</fqdn>
<type>ComputerSystem</type>
<OSRunning guid="41693E27B5123A56B946B3DAA7153246" xsi:type="coll:com.collation.platform.model.topology.sys.linux.Linux">
<OSConfidence>100</OSConfidence>
<OSName>Linux</OSName>
<OSVersion>Red Hat Enterprise Linux Server release 5.2 (Tikanga)</OSVersion>
<OSMode>64-bit</OSMode>
</OSRunning>
<ipInterfaces array="1"
guid="BD81B78B00F431F28E45B9903C673FE4"
lastModified="1270881834871"
parent="6E4C78F0B9463420ADBC21A2658AA22A" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="A5B55BF06F4F3568B0A3A08566776E34" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="18F19B1E5BCF33D8B294658B89623E3A" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>127.0.0.1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="2"
guid="361035ED31F73386A96E01DB59CF2377"
lastModified="1270881834761"
parent="6E4C78F0B9463420ADBC21A2658AA22A" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="D4B04242C8063DD0A15FC4FA539C2886" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="C729C2ED74793124B410B3E08FC4F366" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="F9307994411B350DBCA8C2BD4C983BC8" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>9.184.64.244</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="3"
guid="618CE77DCA1630728FE9F975F5D92E34"
lastModified="1270881834839"
parent="6E4C78F0B9463420ADBC21A2658AA22A" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="BBF92BDB2A9333B999AA5D1F3D2D7DB2" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="18F19B1E5BCF33D8B294658B89623E3A" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>0:0:0:0:0:0:0:1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="4"
guid="D0C5FD62F70D39D79517C5957A08C012"
lastModified="1270881835058"
parent="6E4C78F0B9463420ADBC21A2658AA22A" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="D4E59986D65530F49E2882A857002FF3" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="F9307994411B350DBCA8C2BD4C983BC8" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>fe80:0:0:0:250:56ff:feac:255f</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
</ComputerSystem>
<ComputerSystem array="5" guid="9AB5DEF9F5FD3DADA2616230B605A250" xsi:type="coll:com.collation.platform.model.topology.sys.linux.LinuxUnitaryComputerSystem">
<fqdn>rt3.in.ibm.com</fqdn>
<type>ComputerSystem</type>
<OSRunning guid="C75FD5FBA18D31C0ADD033BB84254600" xsi:type="coll:com.collation.platform.model.topology.sys.linux.Linux">
<OSConfidence>100</OSConfidence>
<OSName>Linux</OSName>
<OSVersion>Red Hat Enterprise Linux Server release 5.2 (Tikanga)</OSVersion>
<OSMode>64-bit</OSMode>
</OSRunning>
<ipInterfaces array="1"
guid="006D494967D035D4BE14AB9BA9B35535"
lastModified="1270881877402"
parent="9AB5DEF9F5FD3DADA2616230B605A250" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="EDC5FDD18141344E8C38D0634DB3384E" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="F739F58377043960813E3F1DFFEF9F79" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>fe80:0:0:0:250:56ff:feac:3d65</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="2"
guid="934DDB05B9873AE696C77F8AFE6E52A7"
lastModified="1270881877668"
parent="9AB5DEF9F5FD3DADA2616230B605A250" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="BBF92BDB2A9333B999AA5D1F3D2D7DB2" xsi:type="coll:com.collation.platform.model.topology.net.IpV6Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="693C859D351830E1AE777C9025B500A6" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>0:0:0:0:0:0:0:1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="3"
guid="7A0CAE72A3663716AB1232D870D80EDE"
lastModified="1270881877589"
parent="9AB5DEF9F5FD3DADA2616230B605A250" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="A5B55BF06F4F3568B0A3A08566776E34" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="91E4DC01B2B93F1C9733720535C3250A" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="693C859D351830E1AE777C9025B500A6" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>127.0.0.1</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
<ipInterfaces array="4"
guid="91CD76C8B641385B97EFA94772ABB624"
lastModified="1270881877652"
parent="9AB5DEF9F5FD3DADA2616230B605A250" xsi:type="coll:com.collation.platform.model.topology.net.IpInterface">
<ipAddress guid="5F42ACC1D9363EB6920C240A4FC1ACE2" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Address"/>
<ipNetwork guid="C729C2ED74793124B410B3E08FC4F366" xsi:type="coll:com.collation.platform.model.topology.net.IpV4Network"/>
<l2Interface guid="F739F58377043960813E3F1DFFEF9F79" xsi:type="coll:com.collation.platform.model.topology.net.L2Interface"/>
<displayName>9.184.64.243</displayName>
<bidiFlag>3</bidiFlag>
</ipInterfaces>
</ComputerSystem>
</results>

The documentation provided will help in writing binding.xml file for your requirement. see below binding.xml for the above sample.xml. If at all we have xsd file as well it would be easy to write the binding.xml. And we can understand the ways of writing this binding.xml by looking at most possible examples explained in jibx site.
<mapping name="results" class="com.ibm.xmlbind.Results">
<collection field="computerSystems"
item-type="com.ibm.xmlbind.ComputerSystem" />
</mapping>
<mapping name="ComputerSystem"
class="com.ibm.xmlbind.ComputerSystem">
<value name="fqdn" field="fqdn" />
<value name="type" field="type" />
<value name="guid" style="attribute" field="guid" />
<structure name="OSRunning" field="osRunning" usage="optional">
<value name="OSConfidence" field="osConfidence" usage="optional"/>
<value name="OSName" field="osName" usage="optional"/>
<value name="OSVersion" field="osVersion" usage="optional"/>
<value name="OSMode" field="osMode" usage="optional"/>
</structure>
<collection field="ipInterfaces"
item-type="com.ibm.xmlbind.IPInterfaces" />
</mapping>
<mapping name="ipInterfaces" class="com.ibm.xmlbind.IPInterfaces">
<value name="ipAddress" field="ipAddress" usage="optional"/>
<value name="ipNetwork" field="ipNetwork" usage="optional"/>
<value name="l2Interface" field="l2Interface" usage="optional"/>
<value name="displayName" field="displayName" usage="optional"/>
<value name="bidiFlag" field="bidiFlag" usage="optional"/>
</mapping>
</binding>

See the classes identified for the above sample.xml below ...
ComputerSystems.java :
import java.util.ArrayList;
public class ComputerSystem {
private String fqdn;
private String type;
private String guid;
private OSRunning osRunning;
private ArrayList ipInterfaces;
public String getFqdn() {
return fqdn;
}
public void setFqdn(String fqdn) {
this.fqdn = fqdn;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public OSRunning getOsRunning() {
return osRunning;
}
public void setOsRunning(OSRunning osRunning) {
this.osRunning = osRunning;
}
public ArrayList getIpInterfaces() {
return ipInterfaces;
}
public void setIpInterfaces(ArrayList ipInterfaces) {
this.ipInterfaces = ipInterfaces;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
}
public class IPInterfaces {
private String ipAddress;
private String ipNetwork;
private String l2Interface;
private String displayName;
private String bidiFlag;
public String getBidiFlag() {
return bidiFlag;
}
public void setBidiFlag(String bidiFlag) {
this.bidiFlag = bidiFlag;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getL2Interface() {
return l2Interface;
}
public void setL2Interface(String interface1) {
l2Interface = interface1;
}
public String getIpNetwork() {
return ipNetwork;
}
public void setIpNetwork(String ipNetwork) {
this.ipNetwork = ipNetwork;
}
}
public class OSRunning {
private String osConfidence;
private String osName;
private String osVersion;
private String osMode;
public String getOsMode() {
return osMode;
}
public void setOsMode(String osMode) {
this.osMode = osMode;
}
public String getOsConfidence() {
return osConfidence;
}
public void setOsConfidence(String osConfidence) {
this.osConfidence = osConfidence;
}
public String getOsName() {
return osName;
}
public void setOsName(String osName) {
this.osName = osName;
}
public String getOsVersion() {
return osVersion;
}
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
@Override
public String toString() {
return "OSConfidence : " + osConfidence + " -- " +
"OSName : " + osName + " -- " +
"OSVersion : " + osVersion + " -- " +
"OSMode : " + osMode;
}
}
import java.util.ArrayList;
public class Results {
private ArrayList computerSystems;
public ArrayList getComputerSystems() {
return computerSystems;
}
public void setComputerSystems(ArrayList computerSystems) {
this.computerSystems = computerSystems;
}
}
For compiling this we can use the sample build.xml shown below.
build.xml :
<project name="xmlbind" default="compile" basedir="..">
<property name="root-dir" value="${basedir}/Build" />
<property name="lib" value="${root-dir}/lib" />
<property name="binding-file" value="${basedir}/binding.xml" />
<target name="setclasspath">
<path id="bindpath">
<pathelement location="${root-dir}" />
<pathelement location="${basedir}/bin" />
<pathelement location="${lib}/jibx-bind.jar" />
<pathelement location="${lib}/bcel.jar" />
<pathelement location="${basedir}/lib/jibx-run.jar" />
<pathelement location="${basedir}/lib/xpp3.jar" />
</path>
</target>
<!-- Delete class files for a single example -->
<target name="clean">
<delete quiet="true">
<fileset dir="${basedir}/bin" includes="**/JiBX_*.class" />
</delete>
</target>
<!-- Create Binding classes -->
<target name="compile" depends="clean,setclasspath">
<java classname="org.jibx.binding.Compile" fork="yes" dir="${root-dir}" failonerror="true">
<classpath refid="bindpath" />
<arg value="${binding-file}" />
</java>
</target>
<!-- Generate classes and binding.xml for given xsd file -->
<target name="run-bind" depends="setclasspath">
<java classname="" fork="yes" dir="${root-dir}" failonerror="true">
<classpath refid="bindpath" />
<arg value="${binding-file}" />
</java>
</target>
</project>

import java.io.FileInputStream;
import org.jibx.runtime.*;
import com.ibm.util.Utils;
import com.ibm.xmlbind.*;
public class BindTest {
public static void main(String[] args) throws Exception {
IBindingFactory bfact = BindingDirectory.getFactory(Results.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Results obj = (Results) uctx.unmarshalDocument(new FileInputStream(
Utils.removeXMLNamespaces("sample.xml")), null);
for (int i = 0; i < obj.getComputerSystems().size(); i++) {
System.out.println("ComputerSystem : " + (i+1));
System.out.println("--------------------------------------------");
print((ComputerSystem) obj.getComputerSystems().get(i));
}
}
private static void print(ComputerSystem sys) {
System.out.println(" GUID of this Computer system: " + sys.getGuid());
System.out.println(" fqdn : " + sys.getFqdn());
System.out.println(" type : " + sys.getFqdn());
System.out.println(" OSRunning : " + sys.getOsRunning());
}
}
There are some important attributes in HTML 4 and are divided into
core attributes,
internationalization attributes,
and scripting events.
ID
The ID attribute uniquely identifies an element within a document. No two elements can have the same ID value in a single document. The attribute's value must begin with a letter in the range A-Z or a-z and may be followed by letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). The value is case-sensitive.
CLASS
The CLASS attribute specifies the element to be a member of one or more classes. Classes allow authors to define specific kinds of a given element. For example, an author could use when giving Java code and when giving Perl code.
Unlike with the ID attribute, any number of elements can share the same class. An element may also belong to multiple classes; the CLASS attribute value is a space-separated list of class names. The value is case-sensitive.
Note that some older browsers do not support multiple classes. Such browsers typically ignore a CLASS attribute that specifies multiple classes.
The CLASS attribute is particularly useful when combined with style sheets.
STYLE
The STYLE attribute allows authors to specify style rules inline for a single occurrence of an element. An example follows:
A popular font for on-screen reading is Verdana.
When the STYLE attribute is used, a default style sheet language must be specified for the document by setting the Content-Style-Type HTTP header to the media type of the style sheet language. The previous example could use the following META element in the document's HEAD:
In most cases, use of the CLASS or ID attributes is a better choice than using STYLE since ID and CLASS can be selectively applied to different media and since they provide a separation of content and presentation that often simplifies maintenance.
TITLE
The TITLE attribute provides a title for an element and is commonly implemented as a "tooltip" on visual browsers. The attribute is most useful with A, AREA, LINK, and IMG elements, where it provides a title for the linked or embedded resource.
TITLE is also helpful with the ABBR and ACRONYM elements to provide the long form of the abbreviation.
LANG
The LANG attribute specifies the language of an element's attribute values and its content, including all contained elements that do not specify their own LANG attribute. While the LANG attribute is not widely supported, its use may help search engines index a document by its language while allowing speech synthesizers to use language-dependent pronunciation rules. As well, visual browsers can use the language's proper quotation marks when rendering the Q element.
The attribute value is case-insensitive, and should be specified according to RFC 1766; examples include en for English, en-US for American English, and ja for Japanese. Whitespace is not allowed in the language code.
Use of the LANG attribute also allows authors to easily change the style of text depending on the language. For example, a bilingual document may have one language in italics if rendered visually or a different voice if rendered aurally.
A document's primary language may be set using the LANG attribute on the HTML element, or, alternatively, by using the Content-Language HTTP header.
DIR
The DIR attribute specifies the directionality of text--left-to-right (DIR=ltr, the default) or right-to-left (DIR=rtl). Characters in Unicode are assigned a directionality, left-to-right or right-to-left, to allow the text to be rendered properly. For example, while English characters are presented left-to-right, Hebrew characters are presented right-to-left.
Unicode defines a bidirectional algorithm that must be applied whenever a document contains right-to-left characters. While this algorithm usually gives the proper presentation, some situations leave directionally neutral text and require the DIR attribute to specify the base directionality.
Text is often directionally neutral when there are multiple embeddings of content with a different directionality. For example, an English sentence that contains a Hebrew phrase that contains an English quotation would require the DIR attribute to define the directionality of the Hebrew phrase. The Hebrew phrase, including the English quotation, should be contained within a SPAN element with DIR=rtl.
Common Scripting Events
A number of attributes that define client-side scripting events are common to most elements. The attribute value is a script--typically a function call or a few short statements--that is executed when the event occurs. The value may contain entities (e.g., ").
The following example features JavaScript code to handle two events of a submit button, giving the user a reminder in the status bar when the mouse moves over the button and clearing the status bar when the mouse moves away. Note that the attribute values are delimited by single quotes since double quotes are used within them.
When an event attribute is used, a default scripting language must be specified for the document by setting the Content-Script-Type HTTP header to the media type of the scripting language. The previous example could use the following META element in the document's HEAD:
The common event attributes are device-dependent and largely tailored for the graphical user interface. The available events are as follows:
* ONCLICK, when the mouse button is clicked on an element;
* ONDBLCLICK, when the mouse button is double-clicked on an element;
* ONMOUSEDOWN, when the mouse button is pressed over an element;
* ONMOUSEUP, when the mouse button is released over an element;
* ONMOUSEOVER, when the mouse is moved onto an element;
* ONMOUSEMOVE, when the mouse is moved while over an element;
* ONMOUSEOUT, when the mouse is moved away from an element;
* ONKEYPRESS, when a key is pressed and released over an element;
* ONKEYDOWN, when a key is pressed down over an element;
* ONKEYUP, when a key is released over an element.
Index of Attributes
It only helps people who use Remedy Software in their workplaces for the bug tracking.
In Remedy when ever you want to fill the Dairy field while raising a new Bug, You need to clearly and describe the behavior of bug with many inputs to the developer.
In that situation there are chances that we may forget some important things need to be mentioned about the bug.
So the following light wait HTML + Java Script page serves your need by allowing u to fill all the required things
Download NBS Dairy maker
It interests the people who are more into shares trading and online watch about market.
It’s not really a great tool …but sure it helps you to see instantly the share value for a particular company . Usage is so simple, This tool contains a Text box where you will enter the symbol (ex: TCS) or code of the NSE or BSE stock which you are interested, Just pressing enter will give you the stock details.
Note : Tool uses ICICI web site as reference so please use symbols or codes as suggested in ICICI website.
Download the "Market today"
When ever I want to convert big numbers representing memory of Computer memory, hard disk, and data I usually use this tool to know the exact conversion easily …and quick.
If u want to download a light wait tool please download it from here …
MemoryCaliculator.htm_Download
If u want go for online tool it is here
Online tool
I love things learning on my own, I love to do some creative and smart things on web, It is really fun doing always for me,Playing with images , making more stylish pages visiting all possible Google links, this is how i usually pass my time in front of my lappy.When I started learning about web pages building and its development techniques and tips most of the time very basic level introductions and explanations about use of tags or etc were given extraordinarily in w3schools site.
So I love to use this for most of my doubts.
I am sure one who is beginner will love to njoy this ...
So have a look at my favorite Web building Tips in CSS and other in the following links.
1.w3schools
2.CSS Introductions
3.CSS More
4.CSS Guide
5.CSS Tutorials
6.CSS Tutor
When ever i need to work with different color combinations while working with HTML design of the pages i usually follow the following rules and links.
Find Color of the Hexadecimal number
Find ur Fav color
Color Values
Colors are defined using a hexadecimal notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one light source is 0 (hex #00). The highest value is 255 (hex #FF).
Color Values
HTML colors are defined using a hexadecimal notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one of the light sources is 0 (hex #00). The highest value is 255 (hex #FF).
HTML Color Names
The table below provides a list of color names.
These days I am working on HTML files and developing websites ...so many times I got a situation to optimize the existing HTML code or to Validate an existing one.Generally I used to check the code using Dream weaver software to find whether W3C standards are fulfilled or not.
And i got one light weight GUI tool to do the same so those who are looking for small project validations can use this tool.
Its name is Tidy.HTML Validator
Tidy can be embedded as extra plug in in Firefox and you can just view the source to get the validation done immediately and quickly.
Fire fox plugin for tidy
Of course one can do online validation for a particular live site giving the url in some of the sites like below.
Give ur web site URL here to get it validated
Versions of HTML
HTML 1.0 -->> HTML 2.0-->>HTML 3.0 -->> HTML 3.2 -->> HTML 4.0 -->>HTML 4.01-->>XHTML 1.0
What is DTD ?
A DTD in an XML or HTML document provides a list of the elements, attributes, comments, notes, and entities contained in the document. It also indicates their relationship to one another within the document. In other words, a DTD is the grammar of an XML or HTML document.
Purpose of a DTD
When using a DTD for an XML document (including XHTML), the DTD is there to provide structure for your documents. It is easy to write an XML document, but without the DTD, it has no syntactic meaning to the computer. For example, if you come across this portion of an XML document:
"<"address">"
"<"street">"123 Any Street"<"/street">"
"<"city">"Giridar"<"/city">" "<"state">"AP"<"/state">"
"<"/address">"
While you would know it was an address, you wouldn't know whether it was an address the computer was supposed to create from a database table, if that address was for mailing, and other things. The computer, on the other hand, wouldn't see this as anything more than a string of text. If you viewed it in an XML browser, you might not get any errors, but you also wouldn't get a very interesting or useful page.
In other articles, we'll explore the inner workings of a DTD, and examine the elements that make up a DTD. You'll learn what an element, attribute, entity, and notation is and how to use them within your own DTDs. Plus, you'll learn how to read other DTDs so that you can use them in your own XML documents.
Using DIV Tag
"<"div">" Description:
The "<"div">" element defines logical divisions within the document. This means that when you use a "<"div">" element, you are indicating that the enclosed content is a specific section of the page. The "<"div">" element is typically used in XHTML+CSS documents to position portions of the page.
The "<"div">" tag is a block-level element.
"<"div">" Web Browser Support:
• Netscape 2, 3, 4, 6, 7
• Mozilla 1
• Firefox 1
• Internet Explorer 3, 4, 5, 6
• Opera 3, 4, 5, 6, 7, 8
• Safari 1
• WebTV/MSN TV
• AvantGo Palm OS
• AvantGo Windows CE
• HTML 4.0
• XHTML 1.0: XHTML Text Module
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
Latest Post on ETV D3 Old Post on ETV D1 D2 link ETV Dhee 3 - D3 - Enjoy maadi ETV Dhee feedback link - Direct ETV site use this...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
