Click here to Skip to main content
11,496,146 members (1,360 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: XML Blackberry
<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 14-Mar-13 21:26pm
Comments
ravi1989h at 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)

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 RyanDev 230
2 CHill60 208
3 Sascha Lefèvre 195
4 Sergey Alexandrovich Kryukov 124
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 15 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100