Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<re:queryResourceResponse xmlns:me="http://www.ibm.com/xmlns/prod/websphere/fabric/2008/12/telecom/operations/inventory/schema/ResourceConfigurationMessage" xmlns:re="http://www.ibm.com/xmlns/prod/websphere/fabric/2008/12/telecom/operations/inventory/types/schema/QueryResource" xmlns:v20="http://www.ibm.com/telecom/common/schema/mtosi/v2_0">
<header>
<v20:timestamp>2012-10-15T23:42:26.275Z</v20:timestamp>
<v20:activityName>QueryResource</v20:activityName>
<v20:communicationPattern>SimpleResponse</v20:communicationPattern>
<v20:communicationStyle>MSG</v20:communicationStyle>
<v20:msgSpecificProperties>
<v20:property>
<v20:propName>DSLe provisioning_infoPortType.getLineInfo</v20:propName>
<v20:propValue>SUCCESS</v20:propValue>
</v20:property>
<v20:property>
<v20:propName>Name: DSLe pe_dataPortType.getData</v20:propName>
<v20:propValue>SUCCESS</v20:propValue>
</v20:property>
<v20:property>
<v20:propName>Instance: DSLe pe_dataPortType.getData</v20:propName>
<v20:propValue>SUCCESS</v20:propValue>
</v20:property>
</v20:msgSpecificProperties>
</header>
<me:physicalResource>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.UpstreamIsTrellisEnabledCode</Name>
</Characteristic>
<Value>true
</Value>
</CharacteristicValue>


<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.DownstreamPlanRateNumber</Name>
</Characteristic>
<Value>31520</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.UpstreamMinMarginNumber</Name>
</Characteristic>
<Value>0.0</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.DownstreamMaxPowerNumber</Name>
</Characteristic>
<Value>20.4</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.UpstreamMaxPSDNumber</Name>
</Characteristic>
<Value>-38.0</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.DownstreamInterleavingCode</Name>
</Characteristic>
<Value>true</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.UpstreamMaxRateNumber</Name>
</Characteristic>
<Value>3072</Value>
</CharacteristicValue>
<CharacteristicValue>
<Characteristic>
<Name>ResourceFacingServiceInstance.PortProfileInstance.DownstreamTargetMarginNumber</Name>
</Characteristic>
<Value>12.0</Value>
</CharacteristicValue>







<Specification>
<Type>Optimized DSL Port</Type>
<Category>Logical Resource</Category>
</Specification>
</me:physicalResource>
</re:queryResourceResponse>
</soapenv:Body>
</soapenv:Envelope>



**********************
private class Connection extends Thread
{
public Connection(){
super();
}

public void run()
{


try{


DocumentBuilderFactory docBuilderFactory= DocumentBuilderFactory. newInstance();

DocumentBuilder docBuilder= docBuilderFactory.newDocumentBuilder();


FileConnection fc=(FileConnection)Connector.open("file:///SDCard/a.xml");
InputStream is=fc.openInputStream();
doc= docBuilder.parse(is);
System.out.println("*******************************doc****"+doc);
doc.getDocumentElement ().normalize ();
NodeList list=doc.getElementsByTagName("CharacteristicValue");
System.out.println("*******************************list****"+list);
System.out
.println("CharacteristicValue " + list.getLength());

if(list!=null &&list.getLength()>0){
for (int i=0;i<list.getLength();i++){

Node node1 = list.item(i);

System.out.println("* Processing Level 1: item: " + Integer.toString(i));
short node1Type = node1.getNodeType();
if ( node1Type == Node.ELEMENT_NODE ) {
System.out.println("* Element: " + node1.getNodeName() );
}
if ( node1.hasChildNodes() ) {
NodeList level2List = node1.getChildNodes();
System.out.println("*************************level2List******"+level2List.getLength());
if(level2List!=null &&level2List.getLength()>0){
for ( int j = 0; j < level2List.getLength(); j++ ) {
Node node2 = level2List.item(j);
System.out.println("* Processing Level 2: item: " + Integer.toString(i));
short node2Type = node2.getNodeType();
if ( node2Type == Node.ELEMENT_NODE ) {
System.out.println("* Element: " + node2.getNodeName() );

}
if ( node2.hasChildNodes() ) {
NodeList level3List = node2.getChildNodes();
System.out.println("*************************level3List******"+level3List.getLength());
if(level3List!=null &&level3List.getLength()>0){
for ( int k = 0; j < level3List.getLength(); k++ ) {
Node node3 = level2List.item(k);
System.out.println("* Processing Level 3: item: " + Integer.toString(k));
short node3Type = node3.getNodeType();
if ( node3Type == Node.ELEMENT_NODE ) {
System.out.println("* Element: " + node3.getNodeName() );
System.out.println(": "
+ level3List.item(0).getChildNodes().item(0)
.getNodeValue());
}
}
}
}
}
}
}

}
}
}

catch (Exception e){
System.out.println(e.toString());
}
}
}
Posted
Comments
ravi1989h 15-Mar-13 2:27am    
Hello i want to print Name and value but not able to do that ..can you please help me parsing xml

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900