Jmeter script response not tally with RESTClient response - jmeter
I am using JMeter to test the performance of rest API.
The problem is when I check the response of an API in the JMeter with the response of the rest client the response code doesn't look similar .
Jmeter response code contains null values for some key value pairs
Below is my JMeter response code for a rest API
{"isListException":false,"listMessage":null,"listSize":11,"page":1,"pageSize":0,"totalPages":4,"totalRecords":36,"users":[{"active":0,"address":null,"addressSize":0,"age":20,"analysisMessage":false,"androidVersion":null,"anniversayDate":null,"billingAddress":{"addId":0,"address1":"#908, gurunagar 4th block,mangalore","address2":null,"city":null,"country":null,"postBox":null,"state":null,"street":null,"zipCode":0},"callType":0,"SubScriptionId":0,"customerId":0,"customerUpdatedDate":null,"dateOfBirth":null,"deviceToken":null,"downloadDate":null,"downloadedDate":null,"emailId":null,"emailIdValid":false,"firstName":"manoj","fromDate":null,"gender":true,"generalMessage":false,"id":0,"iMEI":null,"iMEIValid":false,"internationalNumber":false,"isException":false,"knownBy":null,"lastName":null,"lastUpdatedDate":null,"loginId":null,"mainUser":true,"message":null,"mobile":null,"mobileOSPlatform":null,"osVersion":null,"password":null,"permissionString":null,"phoneNoValid":false,"primary":0,"productName":null,"randomImeiNumber":null,"randomSimSerialNumber":null,"reference":null,"serviceSubScriptionId":0,"simSerialNumber":null,"subuserId":0,"toDate":null,"uniquePhoneId":null,"userAddressList":[],"userCategory":0,"userCustomerId":0,"userGroup":0,"userId":3,"userType":null,"uuidStatus":false,"version":0,"viewsCount":0},{"active":0,"address":null,"addressSize":0,"age":22,"analysisMessage":false,"androidVersion":null,"anniversayDate":null,"billingAddress":{"addId":0,"address1":"nagar","address2":null,"city":null,"country":null,"postBox":null,"state":null,"street":null,"zipCode":0},"callType":0,"SubScriptionId":0,"customerId":0,"customerUpdatedDate":null,"dateOfBirth":null,"deviceToken":null,"downloadDate":null,"downloadedDate":null,"emailId":null,"emailIdValid":false,"firstName":"lakshmi","fromDate":null,"gender":false,"generalMessage":false,"id":0,"iMEI":null,"iMEIValid":false,"internationalNumber":false,"isException":false,"knownBy":null,"lastName":null,"lastUpdatedDate":null,"loginId":null,"mainUser":false,"message":null,"mobile":null,"mobileOSPlatform":null,"osVersion":null,"password":null,"permissionString":null,"phoneNoValid":false,"primary":0,"productName":null,"randomImeiNumber":null,"randomSimSerialNumber":null,"reference":null,"serviceRequestSubScriptionId":0,"simSerialNumber":null,"subuserId":1042,"toDate":null,"uniquePhoneId":null,"userAddressList":[],"userCategory":0,"userCustomerId":0,"userGroup":0,"userId":3,"userType":null,"uuidStatus":false,"version":0,"viewsCount":0},{"active":0,"address":null,"addressSize":0,"age":576,"analysisMessage":false,"androidVersion":null,"anniversayDate":null,"billingAddress":{"addId":0,"address1":"hhj","address2":null,"city":null,"country":null,"postBox":null,"state":null,"street":null,"zipCode":0},"callType":0,"SubScriptionId":0,"customerId":0,"customerUpdatedDate":null,"dateOfBirth":null,"deviceToken":null,"downloadDate":null,"downloadedDate":null,"emailId":null,"emailIdValid":false,"firstName":"eertr","fromDate":null,"gender":true,"generalMessage":false,"id":0,"iMEI":null,"iMEIValid":false,"internationalNumber":false,"isException":false,"knownBy":null,"lastName":null,"lastUpdatedDate":null,"loginId":null,"mainUser":false,"message":null,"mobile":null,"mobileOSPlatform":null,"osVersion":null,"password":null,"permissionString":null,"phoneNoValid":false,"primary":0,"productName":null,"randomImeiNumber":null,"randomSimSerialNumber":null,"reference":null,"serviceRequestSubScriptionId":0,"simSerialNumber":null,"subuserId":1036,"toDate":null,"uniquePhoneId":null,"userAddressList":[],"userCategory":0,"userCustomerId":0,"userGroup":0,"userId":3,"userType":null,"uuidStatus":false,"version":0,"viewsCount":0},{"active":0,"address":null,"addressSize":0,"age":232,"analysisMessage":false,"androidVersion":null,"anniversayDate":null,{"addId":0,"address1":"rajajinagar ","address2":null,"city":null,"country":null,"postBox":null,"state":null,"street":null,"zipCode":0},"callType":0,"SubScriptionId":0,"customerId":0,"customerUpdatedDate":null,"dateOfBirth":null,"deviceToken":null,"downloadDate":null,"downloadedDate":null,"emailId":null,"emailIdValid":false,"firstName":"Sam","fromDate":null,"gender":false,"generalMessage":false,"id":0,"iMEI":null,"iMEIValid":false,"internationalNumber":false,"isException":false,"knownBy":null,"lastName":null,"lastUpdatedDate":null,"loginId":null,"mainUser":false,"message":null,"mobile":null,"mobileOSPlatform":null,"osVersion":null,"password":null,"permissionString":null,"phoneNoValid":false,"primary":0,"productName":null,"randomImeiNumber":null,"randomSimSerialNumber":null,"reference":null,"serviceRequestSubScriptionId":0,"simSerialNumber":null,"subuserId":1021,"toDate":null,"uniquePhoneId":null,"userAddressList":[],"userCategory":0,"userCustomerId":0,"userGroup":0,"userId":3,"userType":null,"uuidStatus":false,"version":0,"viewsCount":0}]}
Below is response in RESTClient
<userList>
<isListException>false</isListException>
<listSize>11</listSize>
<page>1</page>
<pageSize>0</pageSize>
<totalPages>4</totalPages>
<totalRecords>36</totalRecords>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>20</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>#908, gurunagar 4th block,mangalore</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>manoj</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>true</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>0</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>22</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>jayanagar</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>lakshmi</firstName>
<gender>false</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1042</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>576</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>hhj</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>eertr</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1036</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>232</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>vdfgfg</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>bbbbb</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1035</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>243</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>asdf</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>ccc</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1034</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>334</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>fgtgfgf</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>rthttx</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1033</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>121</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>jayanagar</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>bvbi</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1030</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>445</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>wefrftghyu</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>name</firstName>
<gender>true</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1028</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>24</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>bum</address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>kishore </firstName>
<gender>false</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1023</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>28</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>Jayanagar </address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>Mithun</firstName>
<gender>false</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1022</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
<users>
<id>0</id>
<isException>false</isException>
<active>0</active>
<addressSize>0</addressSize>
<age>23</age>
<analysisMessage>false</analysisMessage>
<billingAddress>
<addId>0</addId>
<address1>rajajinagar </address1>
<zipCode>0</zipCode>
</billingAddress>
<callType>0</callType>
<SubScriptionId>0</SubScriptionId>
<customerId>0</customerId>
<emailIdValid>false</emailIdValid>
<firstName>Sam</firstName>
<gender>false</gender>
<generalMessage>false</generalMessage>
<IMEIValid>false</IMEIValid>
<internationalNumber>false</internationalNumber>
<mainUser>false</mainUser>
<phoneNoValid>false</phoneNoValid>
<primary>0</primary>
<serviceRequestSubScriptionId>0</serviceRequestSubScriptionId>
<subuserId>1021</subuserId>
<userCategory>0</userCategory>
<userCustomerId>0</userCustomerId>
<userGroup>0</userGroup>
<userId>3</userId>
<uuidStatus>false</uuidStatus>
<version>0</version>
<viewsCount>0</viewsCount>
</users>
</userList>
Related
FHIR contained practionner in generalPractitioner
In the (last) FHIR specification (v1.8.0), it's mentioned that a contained resource can be embedded in a Reference (documentation), when no reference exists. But, by looking at the XSD, I can't figure out how to validate the XML against the patient.xsd with such a mechanism. Here is my attempt <?xml version="1.0" encoding="UTF-8"?> <Patient xmlns="http://hl7.org/fhir"> <identifier> <system value="urn:oid:1.2.250.1.311.1.1"/> <value value="2000100439"/> <assigner> <display value="ap-hm"/> </assigner> </identifier> <name> <use value="official"/> <family value="COPTER"/> <given value="ELI"/> </name> <gender value="male"/> <birthDate value="1954-08-14"/> <deceasedBoolean value="false"/> <address> <use value="home"/> <line value="45 boulevard des cigales"/> <city value="MARSEILLE 10"/> <postalCode value="13010"/> </address> <maritalStatus> <coding> <system value="http://hl7.org/fhir/v3/MaritalStatus"/> <code value="U"/> </coding> </maritalStatus> <generalPractitioner> <contained> <Practitioner> <id value="p1"/> <name> <family value="PASTEUR"/> <given value="LOUIS"/> </name> <address> <city>MARSEILLE</city> <postalCode>13005</postalCode> </address> <gender value="male"/> </Practitioner> </contained> </generalPractitioner> </Patient> What is the correct way to have a contained reference ?
All contained resources are sent near the top using the "contained" element. They are then referenced as a local reference. So your example would look as follows: <?xml version="1.0" encoding="UTF-8"?> <Patient xmlns="http://hl7.org/fhir"> <contained> <Practitioner> <id value="p1"/> <name> <family value="PASTEUR"/> <given value="LOUIS"/> </name> <address> <city>MARSEILLE</city> <postalCode>13005</postalCode> </address> <gender value="male"/> </Practitioner> </contained> <identifier> <system value="urn:oid:1.2.250.1.311.1.1"/> <value value="2000100439"/> <assigner> <display value="ap-hm"/> </assigner> </identifier> <name> <use value="official"/> <family value="COPTER"/> <given value="ELI"/> </name> <gender value="male"/> <birthDate value="1954-08-14"/> <deceasedBoolean value="false"/> <address> <use value="home"/> <line value="45 boulevard des cigales"/> <city value="MARSEILLE 10"/> <postalCode value="13010"/> </address> <maritalStatus> <coding> <system value="http://hl7.org/fhir/v3/MaritalStatus"/> <code value="U"/> </coding> </maritalStatus> <generalPractitioner> <reference value="#p1"/> </generalPractitioner> </Patient>
KVM idle VM CPU 100% usage with ehci
My idle KVM Windows VM used 100% CPU. It went from 100% host CPU down to 3% host CPU after I disabled ehci(Standard Enhanced PCI to USB Host Controller) in Device Manager. Device Magener Picture Vm run normally at the beginning. It went up to 100% after a long timer(may be one night long). Why the cpu usage reduced when I disabled the ehci? Is there any other way to reduce the cpu usage? Here is my libvirt.xml <domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> <name>i-win2003/name> <os> <type>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> </features> <clock offset="localtime"/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <vcpu current="1">1</vcpu> <memory>2097152</memory> <currentMemory>2097152</currentMemory> <devices> <disk device="disk" type="file"> <driver name="qemu" type="qcow2"/> <source file="/root/i-win2003/snap.qcow2"/> <target bus="virtio" dev="vda"/> </disk> <disk type='file' device='cdrom'> <source dev=''/> <target dev='hdc' bus='ide'/> </disk> <serial type="pty"> <source path="/dev/pts/1"/> <target port="0"/> </serial> <interface type='bridge'> <mac address='fa:16:3e:81:68:b4'/> <source bridge='eucabr'/> <model type='virtio'/> <driver name='qemu'/> <alias name='net0'/> </interface> <channel type='unix'> <source mode='bind'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> <controller type="usb" index="0" model="ich9-ehci1"/> <controller type="usb" index="0" model="ich9-uhci1"/> <controller type="usb" index="0" model="ich9-uhci2"/> <controller type="usb" index="0" model="ich9-uhci3"/> <input type="tablet" bus="usb"/> <input type="mouse" bus="ps2"/> <graphics type="vnc" port="-1" autoport="yes" keymap="en-us" listen="0.0.0.0"/> </devices> <qemu:commandline> </qemu:commandline> </domain>
JBoss7 remote MDB connection to JMS queue -Connection failure has been detected
I am trying to develop an MDB for listening to remote queue in JBoss7, I Didn't receive messages from the queue. I got warnings in the server log: 11:32:41,882 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /137.72.223.212:50835. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3] 11:32:41,882 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Client connection failed, clearing up resources for session a79ee8f8-6a4e-11e4-b696-d65d20524153 11:32:41,882 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Cleared up resources for session a79ee8f8-6a4e-11e4-b696-d65d20524153 11:32:41,882 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /137.72.223.212:50834. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3] 11:32:41,897 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Client connection failed, clearing up resources for session a797bd07-6a4e-11e4-b696-d65d20524153 11:32:41,897 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Cleared up resources for session a797bd07-6a4e-11e4-b696-d65d20524153 11:32:41,897 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /137.72.223.212:50833. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3] 11:32:41,913 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Client connection failed, clearing up resources for session a7930216-6a4e-11e4-b696-d65d20524153 11:32:41,913 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Cleared up resources for session a7930216-6a4e-11e4-b696-d65d20524153 11:32:41,913 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /137.72.223.212:50836. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3] My MDB configuration: #MessageDriven(activationConfig = { #ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Queue"), #ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/queue/MyQueue") , #ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "RemoteConnectionFactory"), #ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"), #ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=vm-thi-blg-qa2;port=5445"), #ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), }) The JBoss standalone.xml: <?xml version='1.0' encoding='UTF-8'?> <server xmlns="urn:jboss:domain:1.2"> <extensions> <extension module="org.jboss.as.clustering.infinispan"/> <extension module="org.jboss.as.cmp"/> <extension module="org.jboss.as.configadmin"/> <extension module="org.jboss.as.connector"/> <extension module="org.jboss.as.deployment-scanner"/> <extension module="org.jboss.as.ee"/> <extension module="org.jboss.as.ejb3"/> <extension module="org.jboss.as.jacorb"/> <extension module="org.jboss.as.jaxr"/> <extension module="org.jboss.as.jaxrs"/> <extension module="org.jboss.as.jdr"/> <extension module="org.jboss.as.jmx"/> <extension module="org.jboss.as.jpa"/> <extension module="org.jboss.as.jsr77"/> <extension module="org.jboss.as.logging"/> <extension module="org.jboss.as.mail"/> <extension module="org.jboss.as.messaging"/> <extension module="org.jboss.as.naming"/> <extension module="org.jboss.as.osgi"/> <extension module="org.jboss.as.pojo"/> <extension module="org.jboss.as.remoting"/> <extension module="org.jboss.as.sar"/> <extension module="org.jboss.as.security"/> <extension module="org.jboss.as.threads"/> <extension module="org.jboss.as.transactions"/> <extension module="org.jboss.as.web"/> <extension module="org.jboss.as.webservices"/> <extension module="org.jboss.as.weld"/> </extensions> <management> <security-realms> <security-realm name="ManagementRealm"> <authentication> <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/> </authentication> </security-realm> <security-realm name="ApplicationRealm"> <authentication> <properties path="application-users.properties" relative-to="jboss.server.config.dir"/> </authentication> </security-realm> </security-realms> <management-interfaces> <native-interface security-realm="ManagementRealm"> <socket-binding native="management-native"/> </native-interface> <http-interface security-realm="ManagementRealm"> <socket-binding http="management-http"/> </http-interface> </management-interfaces> </management> <profile> <subsystem xmlns="urn:jboss:domain:logging:1.1"> <console-handler name="CONSOLE"> <level name="INFO"/> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> </console-handler> <periodic-rotating-file-handler name="FILE"> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler> <logger category="com.arjuna"> <level name="WARN"/> </logger> <logger category="org.apache.tomcat.util.modeler"> <level name="WARN"/> </logger> <logger category="sun.rmi"> <level name="WARN"/> </logger> <logger category="jacorb"> <level name="WARN"/> </logger> <logger category="jacorb.config"> <level name="ERROR"/> </logger> <root-logger> <level name="INFO"/> <handlers> <handler name="CONSOLE"/> <handler name="FILE"/> </handlers> </root-logger> </subsystem> <subsystem xmlns="urn:jboss:domain:cmp:1.0"/> <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/> <subsystem xmlns="urn:jboss:domain:datasources:1.0"> <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> <driver>h2</driver> <security> <user-name>jala1</user-name> <password>jala</password> </security> </datasource> <drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers> </datasources> </subsystem> <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1"> <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/> </subsystem> <subsystem xmlns="urn:jboss:domain:ee:1.0"/> <subsystem xmlns="urn:jboss:domain:ejb3:1.2"> <session-bean> <stateless> <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/> </stateless> <stateful default-access-timeout="5000" cache-ref="simple"/> <singleton default-access-timeout="5000"/> </session-bean> <mdb> <resource-adapter-ref resource-adapter-name="hornetq-ra"/> <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/> </mdb> <pools> <bean-instance-pools> <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> </bean-instance-pools> </pools> <caches> <cache name="simple" aliases="NoPassivationCache"/> <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/> </caches> <passivation-stores> <file-passivation-store name="file"/> </passivation-stores> <async thread-pool-name="default"/> <timer-service thread-pool-name="default"> <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/> </timer-service> <remote connector-ref="remoting-connector" thread-pool-name="default"/> <thread-pools> <thread-pool name="default"> <max-threads count="10"/> <keepalive-time time="100" unit="milliseconds"/> </thread-pool> </thread-pools> <iiop enable-by-default="false" use-qualified-name="false"/> </subsystem> <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate"> <cache-container name="hibernate" default-cache="local-query"> <local-cache name="entity"> <transaction mode="NON_XA"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/> </local-cache> <local-cache name="local-query"> <transaction mode="NONE"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/> </local-cache> <local-cache name="timestamps"> <transaction mode="NONE"/> <eviction strategy="NONE"/> </local-cache> </cache-container> </subsystem> <subsystem xmlns="urn:jboss:domain:jacorb:1.1"> <orb> <initializers security="on" transactions="spec"/> </orb> </subsystem> <subsystem xmlns="urn:jboss:domain:jaxr:1.1"> <connection-factory jndi-name="java:jboss/jaxr/ConnectionFactory"/> <properties/> </subsystem> <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/> <subsystem xmlns="urn:jboss:domain:jca:1.1"> <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/> <bean-validation enabled="true"/> <default-workmanager> <short-running-threads> <core-threads count="50"/> <queue-length count="50"/> <max-threads count="50"/> <keepalive-time time="10" unit="seconds"/> </short-running-threads> <long-running-threads> <core-threads count="50"/> <queue-length count="50"/> <max-threads count="50"/> <keepalive-time time="10" unit="seconds"/> </long-running-threads> </default-workmanager> <cached-connection-manager/> </subsystem> <subsystem xmlns="urn:jboss:domain:jdr:1.0"/> <subsystem xmlns="urn:jboss:domain:jmx:1.1"> <show-model value="true"/> <remoting-connector/> </subsystem> <subsystem xmlns="urn:jboss:domain:jpa:1.0"> <jpa default-datasource=""/> </subsystem> <subsystem xmlns="urn:jboss:domain:jsr77:1.0"/> <subsystem xmlns="urn:jboss:domain:mail:1.0"> <mail-session jndi-name="java:jboss/mail/Default"> <smtp-server outbound-socket-binding-ref="mail-smtp"/> </mail-session> </subsystem> <subsystem xmlns="urn:jboss:domain:messaging:1.1"> <hornetq-server> <persistence-enabled>true</persistence-enabled> <journal-file-size>102400</journal-file-size> <journal-min-files>2</journal-min-files> <connectors> <netty-connector name="netty" socket-binding="messaging"/> <netty-connector name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> </netty-connector> <in-vm-connector name="in-vm" server-id="0"/> </connectors> <acceptors> <netty-acceptor name="netty" socket-binding="messaging"/> <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </netty-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> </acceptors> <security-settings> <security-setting match="#"> <permission type="send" roles="guest"/> <permission type="consume" roles="guest"/> <permission type="createNonDurableQueue" roles="guest"/> <permission type="deleteNonDurableQueue" roles="guest"/> </security-setting> </security-settings> <address-settings> <address-setting match="#"> <dead-letter-address>jms.queue.DLQ</dead-letter-address> <expiry-address>jms.queue.ExpiryQueue</expiry-address> <redelivery-delay>0</redelivery-delay> <max-size-bytes>10485760</max-size-bytes> <address-full-policy>BLOCK</address-full-policy> <message-counter-history-day-limit>10</message-counter-history-day-limit> </address-setting> </address-settings> <jms-connection-factories> <connection-factory name="InVmConnectionFactory"> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/ConnectionFactory"/> </entries> </connection-factory> <connection-factory name="RemoteConnectionFactory"> <connectors> <connector-ref connector-name="netty"/> </connectors> <entries> <entry name="RemoteConnectionFactory"/> <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> </entries> </connection-factory> <pooled-connection-factory name="hornetq-ra"> <transaction mode="xa"/> <connectors> <connector-ref connector-name="in-vm"/> </connectors> <entries> <entry name="java:/JmsXA"/> </entries> </pooled-connection-factory> </jms-connection-factories> <jms-destinations> <jms-queue name="testQueue"> <entry name="queue/test"/> <entry name="java:jboss/exported/jms/queue/test"/> </jms-queue> <jms-queue name="MyQueue"> <entry name="java:/jms/MyQueue"/> <durable>false</durable> </jms-queue> <jms-queue name="q"> <entry name="java:/queue/MyQueue"/> <durable>true</durable> </jms-queue> <jms-topic name="testTopic"> <entry name="topic/test"/> <entry name="java:jboss/exported/jms/topic/test"/> </jms-topic> </jms-destinations> </hornetq-server> </subsystem> <subsystem xmlns="urn:jboss:domain:naming:1.1"/> <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy"> <properties> <property name="org.osgi.framework.startlevel.beginning"> 1 </property> </properties> <capabilities> <capability name="javax.servlet.api:v25"/> <capability name="javax.transaction.api"/> <capability name="org.apache.felix.log" startlevel="1"/> <capability name="org.jboss.osgi.logging" startlevel="1"/> <capability name="org.apache.felix.configadmin" startlevel="1"/> <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/> </capabilities> </subsystem> <subsystem xmlns="urn:jboss:domain:pojo:1.0"/> <subsystem xmlns="urn:jboss:domain:remoting:1.1"> <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/> </subsystem> <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/> <subsystem xmlns="urn:jboss:domain:sar:1.0"/> <subsystem xmlns="urn:jboss:domain:security:1.1"> <security-domains> <security-domain name="other" cache-type="default"> <authentication> <login-module code="Remoting" flag="optional"> <module-option name="password-stacking" value="useFirstPass"/> </login-module> <login-module code="RealmUsersRoles" flag="required"> <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/> <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/> <module-option name="realm" value="ApplicationRealm"/> <module-option name="password-stacking" value="useFirstPass"/> <module-option name="unauthenticatedIdentity" value="guest"/> </login-module> </authentication> </security-domain> <security-domain name="jboss-web-policy" cache-type="default"> <authorization> <policy-module code="Delegating" flag="required"/> </authorization> </security-domain> <security-domain name="jboss-ejb-policy" cache-type="default"> <authorization> <policy-module code="Delegating" flag="required"/> </authorization> </security-domain> </security-domains> </subsystem> <subsystem xmlns="urn:jboss:domain:threads:1.1"/> <subsystem xmlns="urn:jboss:domain:transactions:1.1"> <core-environment> <process-id> <uuid/> </process-id> </core-environment> <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/> <coordinator-environment default-timeout="300"/> </subsystem> <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem> <subsystem xmlns="urn:jboss:domain:webservices:1.1"> <modify-wsdl-address>true</modify-wsdl-address> <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host> <endpoint-config name="Standard-Endpoint-Config"/> <endpoint-config name="Recording-Endpoint-Config"> <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"> <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/> </pre-handler-chain> </endpoint-config> </subsystem> <subsystem xmlns="urn:jboss:domain:weld:1.0"/> </profile> <interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:127.0.0.1}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/> </interface> </interfaces> <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/> <socket-binding name="ajp" port="8009"/> <socket-binding name="http" port="8080"/> <socket-binding name="https" port="8443"/> <socket-binding name="jacorb" interface="unsecure" port="3528"/> <socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/> <socket-binding name="messaging" port="5445"/> <socket-binding name="messaging-throughput" port="5455"/> <socket-binding name="osgi-http" interface="management" port="8090"/> <socket-binding name="remoting" port="4447"/> <socket-binding name="txn-recovery-environment" port="4712"/> <socket-binding name="txn-status-manager" port="4713"/> <outbound-socket-binding name="mail-smtp"> <remote-destination host="localhost" port="25"/> </outbound-socket-binding> </socket-binding-group> <deployments> <deployment name="loadSimulator.war" runtime-name="loadSimulator.war"> <content sha1="ad5c4080accb0e644bcb0bf2842f8f230fbe8e75"/> </deployment> <deployment name="Hops.war" runtime-name="Hops.war" enabled="false"> <content sha1="ba2746c8e115729b37343704b2540d258f0ec614"/> </deployment> <deployment name="Agent_Footprint.war" runtime-name="Agent_Footprint.war"> <content sha1="9d9893741e9f24d609c3d39eb9b1bd5ec08d7556"/> </deployment> </deployments> </server>
If the server doesn't receive the ping in a certain time then it closes the connection, in this instance it is an invm connection from the MDB. The usual causes for this are the server or client becoming unresponsive because of overload, memory issues etc. For that, you must to add the following elements to connection-factory in standalone.xml. <connection-ttl>-1</connection-ttl> <client-failure-check-period>-1</client-failure-check-period> A value of -1 for ConnectionTTL means the server will never time out the connection on the server side.
Oracle xmltype column, create xmlindex with include below path
I need to create an xmlindex on and xmltype column, the system is Oracle 11g. The code I am using is: CREATE INDEX "TS"."XMLINDEX_NBXML" ON "TS"."NETBOTZ" V (NBXML) INDEXTYPE IS XDB.XMLINDEX PARAMETERS('PATH TABLE NETBOTZ_PATH_TABLE( TABLESPACE USERS) PATHS (/variable-set/variable[#class="nbTempSensor"]/double-val )') The error received is: SQL Error Failed to commit: ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine ORA-30968: invalid XPATH or NAMESPACE option for XML Index The XML file is below. I tried "/variable-set/variable[#class="nbTempSensor"]/double-val" as the path parameter since we used this successfully within a view to retrieve the nbTempSensor value. Can you tell what the correct syntax is for the path? Thank you in advance for your help. <?xml version="1.0" ?> - <variable-set timestamp="1351899921109" time="2012-11-02 16:45:21" now="1351899921118"> - <variable varid="nbBaseEnclosure" guid="B035DF7_nbBaseEnclosure" class="nbEnclosure" classpath="/nbEnclosure"> <u32-val>2</u32-val> - <metadata slotid="nbEncMenuIcons"> - <string-list-val> <string-val>menu_link_wall_unplug.gif</string-val> <string-val>menu_link_wall_error.gif</string-val> <string-val>menu_link_wall.gif</string-val> </string-list-val> </metadata> - <metadata slotid="nbProductData"> - <struct-val> + <struct-element fieldid="vendor"> <string-val>NetBotz, Inc.</string-val> </struct-element> - <struct-element fieldid="type"> <string-val>Wall</string-val> </struct-element> - <struct-element fieldid="model"> <string-val>420</string-val> </struct-element> - <struct-element fieldid="fullmodel"> <string-val>NetBotz 420</string-val> </struct-element> - <struct-element fieldid="submodel"> <string-val>420 Wall</string-val> </struct-element> - <struct-element fieldid="serial_num"> <string-val>00:02:D3:03:5D:F7</string-val> </struct-element> - <struct-element fieldid="manufacturer"> <string-val>NetBotz, Inc.</string-val> </struct-element> - <struct-element fieldid="revision"> <string-val>A00</string-val> </struct-element> - <struct-element fieldid="board_id"> <string-val>0000</string-val> </struct-element> - <struct-element fieldid="osversion"> <string-val>V2_6_2_20071031_1658</string-val> </struct-element> - <struct-element fieldid="appversion"> <string-val>V2_6_2_20071031_1658</string-val> </struct-element> - <struct-element fieldid="apcappversion"> <string-val>apc_bw02_bw_262.bin</string-val> </struct-element> - <struct-element fieldid="mac_addr"> <string-val>00:02:D3:03:5D:F7</string-val> </struct-element> - <struct-element fieldid="manuf_date"> <utc-val>1232625600</utc-val> </struct-element> - <struct-element fieldid="svc_date"> <utc-val>1251417512</utc-val> </struct-element> - <struct-element fieldid="bootversion"> <string-val>V2_6_2_20071031_1658</string-val> </struct-element> - <struct-element fieldid="apcaosversion"> <string-val>apc_bw02_aos_262.bin</string-val> </struct-element> </struct-val> </metadata> - <metadata slotid="nbLocationData" isclassdef="yes"> <struct-val /> </metadata> - <metadata slotid="nbSerialNum"> <string-val>00:02:D3:03:5D:F7</string-val> </metadata> - <metadata slotid="nbEncNBCIcon"> <string-val>wall420_all.png</string-val> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="NetBotz 420">NetBotz 420</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Disconnected%}">Disconnected</nls-string-val> <nls-string-val raw="%{nbMsg|Error%}">Error</nls-string-val> <nls-string-val raw="%{nbMsg|Normal%}">Normal</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbHawkEnc_0" guid="B035DF7_nbHawkEnc_0" class="nbHawkEnc" classpath="/nbEnclosure/nbUSBEnclosure/nbHawkEnc"> <u32-val>2</u32-val> - <metadata slotid="nbDockedToEncID"> <varid-val>nbBaseEnclosure</varid-val> </metadata> - <metadata slotid="nbEncMenuIcons" isclassdef="yes"> - <string-list-val> <string-val>menu_link_pod_unplug.gif</string-val> <string-val>menu_link_pod_error.gif</string-val> <string-val>menu_link_pod.gif</string-val> </string-list-val> </metadata> - <metadata slotid="nbLocationData" isclassdef="yes"> <struct-val /> </metadata> - <metadata slotid="nbSerialNum"> <string-val>SENSOR_00:02:D3:03:5D:F7</string-val> </metadata> - <metadata slotid="nbEncNBCIcon" isclassdef="yes"> <string-val>sensor_pod.png</string-val> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="%{|Sensor Pod%}">Sensor Pod</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Disconnected%}">Disconnected</nls-string-val> <nls-string-val raw="%{nbMsg|Error%}">Error</nls-string-val> <nls-string-val raw="%{nbMsg|Normal%}">Normal</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbEyeEnc_0" guid="B035DF7_nbEyeEnc_0" class="nbEyeEnc" classpath="/nbEnclosure/nbUSBEnclosure/nbEyeEnc"> <u32-val>2</u32-val> - <metadata slotid="nbDockedToEncID"> <varid-val>nbBaseEnclosure</varid-val> </metadata> - <metadata slotid="nbEncMenuIcons" isclassdef="yes"> - <string-list-val> <string-val>menu_link_camera_unplug.gif</string-val> <string-val>menu_link_camera_error.gif</string-val> <string-val>menu_link_camera.gif</string-val> </string-list-val> </metadata> - <metadata slotid="nbLocationData" isclassdef="yes"> <struct-val /> </metadata> - <metadata slotid="nbSerialNum"> <string-val>CAMERA_00:02:D3:03:5D:F7</string-val> </metadata> - <metadata slotid="nbEncNBCIcon" isclassdef="yes"> <string-val>camera_pod.png</string-val> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="%{nbMsg|Camera|%}">Camera</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Disconnected%}">Disconnected</nls-string-val> <nls-string-val raw="%{nbMsg|Error%}">Error</nls-string-val> <nls-string-val raw="%{nbMsg|Normal%}">Normal</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbIPInterface_eth0_status" guid="B035DF7_nbIPInterface_eth0_status" class="nbIPInterfaceStatus" classpath="/nbIPInterfaceStatus"> - <struct-val> - <struct-element fieldid="enable"> <bool-val val="false" /> </struct-element> - <struct-element fieldid="hostname"> <string-val /> </struct-element> - <struct-element fieldid="ip"> <string-val /> </struct-element> - <struct-element fieldid="subnet"> <string-val /> </struct-element> - <struct-element fieldid="gateway"> <string-val /> </struct-element> + <struct-element fieldid="usedhcp"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="linkisup"> <bool-val val="false" /> </struct-element> </struct-val> </variable> - <variable varid="nbWirelessIPInterface_wlan0_status" guid="B035DF7_nbWirelessIPInterface_wlan0_status" class="nbIPInterfaceStatus" classpath="/nbIPInterfaceStatus"> - <struct-val> - <struct-element fieldid="enable"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="hostname"> <string-val>thm-netbotz</string-val> </struct-element> - <struct-element fieldid="ip"> <string-val>10.0.1.7</string-val> </struct-element> - <struct-element fieldid="subnet"> <string-val>255.255.255.128</string-val> </struct-element> - <struct-element fieldid="gateway"> <string-val>10.0.1.8</string-val> </struct-element> - <struct-element fieldid="usedhcp"> <bool-val val="false" /> </struct-element> - <struct-element fieldid="leapsupport"> <bool-val val="false" /> </struct-element> - <struct-element fieldid="authsupport"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="linkisup"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="essid"> <string-val>Sparta</string-val> </struct-element> - <struct-element fieldid="mode"> <u32-val>2</u32-val> </struct-element> - <struct-element fieldid="channel"> <u32-val>6</u32-val> </struct-element> - <struct-element fieldid="frequency"> <u32-val>2437000</u32-val> </struct-element> - <struct-element fieldid="bit_rate"> <u32-val>11000000</u32-val> </struct-element> - <struct-element fieldid="link_stats_percent"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="link_quality"> <u32-val>91</u32-val> </struct-element> - <struct-element fieldid="link_level"> <i32-val>39</i32-val> </struct-element> - <struct-element fieldid="link_rating"> <u32-val>3</u32-val> </struct-element> - <struct-element fieldid="access_point"> <octet-val>00259CAD7579</octet-val> </struct-element> </struct-val> </variable> - <variable varid="nbConfigUpdTime" guid="B035DF7_nbConfigUpdTime" class="nbConfigUpdTimeCls" classpath="/nbConfigUpdTimeCls"> <utc-val>1351782846</utc-val> </variable> - <variable varid="nbPeriodicHTTP" class="nbPeriodicReportHTTP" classpath="/nbPeriodicReport/nbPeriodicReportHTTP"> - <struct-val> - <struct-element fieldid="enable"> <bool-val val="true" /> </struct-element> - <struct-element fieldid="url_0"> <string-val>https://tsdevel.therascan.net/scan/main/netbotz.php</string-val> </struct-element> - <struct-element fieldid="userid_0"> <string-val>amcare</string-val> </struct-element> - <struct-element fieldid="password_0"> <password-val /> </struct-element> - <struct-element fieldid="url_1"> <string-val>http://</string-val> </struct-element> - <struct-element fieldid="userid_1"> <string-val /> </struct-element> - <struct-element fieldid="password_1"> <password-val /> </struct-element> - <struct-element fieldid="secopt"> <u32-val>0</u32-val> </struct-element> - <struct-element fieldid="schedule"> <string-val>0 0 0 0 0 0 0</string-val> </struct-element> - <struct-element fieldid="interval"> <u32-val>900</u32-val> </struct-element> - <struct-element fieldid="incpix"> <bool-val val="false" /> </struct-element> - <struct-element fieldid="sensorprio"> <i32-val>30</i32-val> </struct-element> </struct-val> - <metadata slotid="nbLastReportSuccessful"> <bool-val val="true" /> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="Periodic HTTP Report">Periodic HTTP Report</nls-string-val> </metadata> </variable> - <variable varid="nbLinkStatus_eth0" guid="B035DF7_nbLinkStatus_eth0" class="nbLinkStatusSnr" classpath="/nbSensor/nbStateSensor/nbBoolSensor/nbLinkStatusSnr"> <u32-val>0</u32-val> - <metadata slotid="nbEncID"> <varid-val>nbBaseEnclosure</varid-val> </metadata> - <metadata slotid="nbLocationData" isclassdef="yes"> <struct-val /> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="%{|Ethernet Link Status%}">Ethernet Link Status</nls-string- val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Down%}">Down</nls-string-val> <nls-string-val raw="%{nbMsg|Up%}">Up</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbLinkStatus_wlan0" guid="B035DF7_nbLinkStatus_wlan0" class="nbLinkStatusSnr" classpath="/nbSensor/nbStateSensor/nbBoolSensor/nbLinkStatusSnr"> <u32-val>1</u32-val> - <metadata slotid="nbEncID"> <varid-val>nbBaseEnclosure</varid-val> </metadata> - <metadata slotid="nbLocationData" isclassdef="yes"> <struct-val /> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="%{|Wireless Link Status %s|wlan0%}">Wireless Link Status wlan0</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Down%}">Down</nls-string-val> <nls-string-val raw="%{nbMsg|Up%}">Up</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbEyeEnc_0_CMOT" guid="B035DF7_nbEyeEnc_0_CMOT" class="nbCamMotSnr" classpath="/nbSensor/nbStateSensor/nbBoolSensor/nbCamMotSnr"> <u32-val>0</u32-val> - <metadata slotid="nbEncID"> <varid-val>nbEyeEnc_0</varid-val> </metadata> - <metadata slotid="nbLocationData"> <struct-val /> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Camera Motion%}">Camera Motion</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|No Motion%}">No Motion</nls-string-val> <nls-string-val raw="%{nbMsg|Motion Detected%}">Motion Detected</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbEyeEnc_0_DOOR" guid="B035DF7_nbEyeEnc_0_DOOR" class="nbDoorSensor" classpath="/nbSensor/nbStateSensor/nbBoolSensor/nbDoorSensor"> <u32-val isnull="yes" /> - <metadata slotid="nbEncID"> <varid-val>nbEyeEnc_0</varid-val> </metadata> - <metadata slotid="nbLocationData"> <struct-val /> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Door Switch%}">Door Switch</nls-string-val> </metadata> - <metadata slotid="nbEnum" isclassdef="yes"> - <nls-string-list-val> <nls-string-val raw="%{nbMsg|Open%}">Open</nls-string-val> <nls-string-val raw="%{nbMsg|Closed%}">Closed</nls-string-val> </nls-string-list-val> </metadata> </variable> - <variable varid="nbHawkEnc_0_DEW" guid="B035DF7_nbHawkEnc_0_DEW" class="nbDewPointSensor" classpath="/nbSensor/nbNumSensor/nbDewPointSensor"> <double-val>11.300000</double-val> - <metadata slotid="nbUnitsID" isclassdef="yes"> <varid-val>nbUnits_DegC</varid-val> </metadata> - <metadata slotid="nbEncID"> <varid-val>nbHawkEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Dew Point%}">Dew Point</nls-string-val> </metadata> </variable> - <variable varid="nbHawkEnc_0_AUDI" guid="B035DF7_nbHawkEnc_0_AUDI" class="nbAudioSensor" classpath="/nbSensor/nbNumSensor/nbAudioSensor"> <double-val>2.000000</double-val> - <metadata slotid="nbEncID"> <varid-val>nbHawkEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Audio%}">Audio</nls-string-val> </metadata> </variable> - <variable varid="nbHawkEnc_0_AFLW" guid="B035DF7_nbHawkEnc_0_AFLW" class="nbAirflowSensor" classpath="/nbSensor/nbNumSensor/nbAirflowSensor"> <double-val>22.859994</double-val> - <metadata slotid="nbUnitsID" isclassdef="yes"> <varid-val>nbUnits_MetersPerMinute</varid-val> </metadata> - <metadata slotid="nbEncID"> <varid-val>nbHawkEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Air Flow%}">Air Flow</nls-string-val> </metadata> </variable> - <variable varid="nbHawkEnc_0_HUMI" guid="B035DF7_nbHawkEnc_0_HUMI" class="nbHumidSensor" classpath="/nbSensor/nbNumSensor/nbHumidSensor"> <double-val>39.000000</double-val> - <metadata slotid="nbUnitsID" isclassdef="yes"> <varid-val>nbUnits_PctRH</varid-val> </metadata> - <metadata slotid="nbEncID"> <varid-val>nbHawkEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Humidity%}">Humidity</nls-string-val> </metadata> </variable> - <variable varid="nbHawkEnc_0_TEMP" guid="B035DF7_nbHawkEnc_0_TEMP" class="nbTempSensor" classpath="/nbSensor/nbNumSensor/nbTempSensor"> <double-val>26.400000</double-val> - <metadata slotid="nbUnitsID" isclassdef="yes"> <varid-val>nbUnits_DegC</varid-val> </metadata> - <metadata slotid="nbEncID"> <varid-val>nbHawkEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel" isclassdef="yes"> <nls-string-val raw="%{nbMsg|Temperature%}">Temperature</nls-string-val> </metadata> </variable> - <variable varid="nbEyeEnc_0_CAMERA" guid="B035DF7_nbEyeEnc_0_CAMERA" class="nbEyeCamera" classpath="/nbCamera/nbEyeCamera"> - <struct-val> - <struct-element fieldid="motion"> <u32-val>0</u32-val> </struct-element> </struct-val> - <metadata slotid="nbEncID"> <varid-val>nbEyeEnc_0</varid-val> </metadata> - <metadata slotid="nbLabel"> <nls-string-val raw="" /> </metadata> </variable> </variable-set>
you cannot do this. the XMLINDEX document states this is not allowed: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_indexing.htm#ADXDB4385 The paths must reference only child and descendant axes, and they must test only element and attribute nodes or their names (possibly using wildcards). In particular, the paths must not involve predicates. as the value you're interested in occurs once in the xml document, you can create a regular index on it. otherwise you have to index all "variable" paths. SQL> create index foo on netbotz(to_number(extractvalue(nbxml,'/variable-set/variable[#class="nbTempSensor"]/double-val'))); Index created. SQL> explain plan for select * from netbotz where to_number(extractvalue(nbxml,'/variable-set/variable[#class="nbTempSensor"]/double-val')) between 1 and 4; Explained. SQL> select * From table(dbms_xplan.display); Plan hash value: 992868181 --------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 2002 | 0 (0)| 00:00:01 | | 1 | TABLE ACCESS BY INDEX ROWID| NETBOTZ | 1 | 2002 | 0 (0)| 00:00:01 | |* 2 | INDEX RANGE SCAN | FOO | 1 | | 0 (0)| 00:00:01 | ---------------------------------------------------------------------------------------
XPath query to find an attribute of a node based on an attribute of another node in a different part of the file
I have an xml file generated by Open Street Map. In it are "node" nodes and "way" nodes. The "node" nodes are at the top of the file, and the "way" nodes further down. The "node" nodes contain latitude and longitude (as attributes) information for a point. The "way" nodes contain a list of "nd" nodes that make up the way. The #ref attribute of each "nd" node matches the #id attribute of a "node". I need to parse the xml for each /way/nd/#ref and get #latitude and #longitude from the corresponding "node" Essentially I want to have a list of ways with latitude and longitude values for each node in the way. If anyone can help it would be greatly appreciated. Ive tried dozens of combinations of xpath queries to try to make it work but can't seem to pin it down. Example xml follows, If anyone is interested, I'm doing this to import the "ways" into a drupal site to plot the "ways" on an openlayers map. <?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="Overpass API"> <note>The data included in this document is from www.openstreetmap.org. It has there been collected by a large group of contributors. For individual attribution of each item please refer to http://www.openstreetmap.org/api/0.6/[node|way|relation]/#id/history </note> <meta osm_base="2012-09-12T07:00:02Z"/> <node id="291435953" lat="50.7468739" lon="7.1563067" version="4" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <node id="291435954" lat="50.7464770" lon="7.1561995" version="2" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <node id="291435955" lat="50.7461387" lon="7.1558430" version="2" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"> <tag k="highway" v="turning_circle"/> </node> <node id="291435956" lat="50.7472300" lon="7.1555832" version="3" timestamp="2012-02-25T15:00:32Z" changeset="10788449" uid="49785" user="mike67"/> <node id="291435957" lat="50.7462073" lon="7.1544363" version="1" timestamp="2008-08-26T21:58:25Z" changeset="418638" uid="36773" user="bernd1606"> <tag k="created_by" v="JOSM"/> </node> <node id="291438870" lat="50.7479387" lon="7.1562447" version="4" timestamp="2012-02-25T15:00:31Z" changeset="10788449" uid="49785" user="mike67"> <tag k="highway" v="turning_circle"/> </node> <node id="291438872" lat="50.7476693" lon="7.1540409" version="1" timestamp="2008-08-26T22:05:07Z" changeset="418638" uid="36773" user="bernd1606"> <tag k="created_by" v="JOSM"/> </node> <node id="470930364" lat="50.7466304" lon="7.1550088" version="1" timestamp="2009-08-19T10:27:27Z" changeset="2198882" uid="49785" user="mike67"/> <node id="1212226020" lat="50.7462970" lon="7.1551053" version="1" timestamp="2011-03-21T18:14:35Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226026" lat="50.7461263" lon="7.1552748" version="1" timestamp="2011-03-21T18:14:35Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226027" lat="50.7460993" lon="7.1549555" version="1" timestamp="2011-03-21T18:14:35Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226028" lat="50.7463885" lon="7.1540406" version="1" timestamp="2011-03-21T18:14:35Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226035" lat="50.7460590" lon="7.1549115" version="1" timestamp="2011-03-21T18:14:36Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226040" lat="50.7460307" lon="7.1549335" version="1" timestamp="2011-03-21T18:14:37Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226041" lat="50.7461886" lon="7.1551879" version="1" timestamp="2011-03-21T18:14:37Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226043" lat="50.7460489" lon="7.1552923" version="1" timestamp="2011-03-21T18:14:37Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226044" lat="50.7465142" lon="7.1543804" version="1" timestamp="2011-03-21T18:14:37Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226049" lat="50.7461296" lon="7.1549315" version="1" timestamp="2011-03-21T18:14:38Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226065" lat="50.7461674" lon="7.1552133" version="1" timestamp="2011-03-21T18:14:39Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226068" lat="50.7460541" lon="7.1546925" version="1" timestamp="2011-03-21T18:14:39Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226069" lat="50.7462755" lon="7.1542526" version="1" timestamp="2011-03-21T18:14:39Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226071" lat="50.7461058" lon="7.1548565" version="1" timestamp="2011-03-21T18:14:39Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226087" lat="50.7462284" lon="7.1551919" version="1" timestamp="2011-03-21T18:14:40Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226090" lat="50.7461464" lon="7.1550496" version="1" timestamp="2011-03-21T18:14:40Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226091" lat="50.7465509" lon="7.1541410" version="1" timestamp="2011-03-21T18:14:40Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226104" lat="50.7460048" lon="7.1551556" version="1" timestamp="2011-03-21T18:14:41Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226127" lat="50.7462070" lon="7.1544275" version="1" timestamp="2011-03-21T18:14:43Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226133" lat="50.7461004" lon="7.1550786" version="1" timestamp="2011-03-21T18:14:43Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226142" lat="50.7460609" lon="7.1548346" version="1" timestamp="2011-03-21T18:14:44Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226144" lat="50.7461532" lon="7.1553573" version="1" timestamp="2011-03-21T18:14:44Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226149" lat="50.7460912" lon="7.1548105" version="1" timestamp="2011-03-21T18:14:44Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226165" lat="50.7461320" lon="7.1546332" version="1" timestamp="2011-03-21T18:14:45Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226171" lat="50.7462548" lon="7.1549671" version="1" timestamp="2011-03-21T18:14:45Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226180" lat="50.7460253" lon="7.1549160" version="1" timestamp="2011-03-21T18:14:46Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226184" lat="50.7462552" lon="7.1552743" version="1" timestamp="2011-03-21T18:14:46Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226192" lat="50.7461445" lon="7.1552153" version="1" timestamp="2011-03-21T18:14:47Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226196" lat="50.7460206" lon="7.1547882" version="1" timestamp="2011-03-21T18:14:47Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226197" lat="50.7461830" lon="7.1548005" version="1" timestamp="2011-03-21T18:14:47Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1212226208" lat="50.7465204" lon="7.1542470" version="1" timestamp="2011-03-21T18:14:48Z" changeset="7630016" uid="49785" user="mike67"/> <node id="1558201806" lat="50.7465619" lon="7.1543799" version="1" timestamp="2011-12-22T14:11:53Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201807" lat="50.7465706" lon="7.1545076" version="1" timestamp="2011-12-22T14:11:53Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201808" lat="50.7465787" lon="7.1542431" version="1" timestamp="2011-12-22T14:11:53Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201809" lat="50.7465945" lon="7.1546459" version="1" timestamp="2011-12-22T14:11:53Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201810" lat="50.7466379" lon="7.1540966" version="1" timestamp="2011-12-22T14:11:53Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201813" lat="50.7468171" lon="7.1569205" version="1" timestamp="2011-12-22T14:11:54Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1558201814" lat="50.7469049" lon="7.1557857" version="2" timestamp="2012-02-25T15:00:33Z" changeset="10788449" uid="49785" user="mike67"/> <node id="1558201822" lat="50.7472431" lon="7.1542901" version="2" timestamp="2012-02-25T15:00:31Z" changeset="10788449" uid="49785" user="mike67"/> <node id="1558201829" lat="50.7478716" lon="7.1567219" version="1" timestamp="2011-12-22T14:11:54Z" changeset="10179910" uid="116044" user="berndw"/> <node id="1579451712" lat="50.7475476" lon="7.1550423" version="2" timestamp="2012-02-25T15:00:32Z" changeset="10788449" uid="49785" user="mike67"/> <node id="1647096049" lat="50.7477273" lon="7.1555526" version="1" timestamp="2012-02-25T15:00:31Z" changeset="10788449" uid="49785" user="mike67"/> <node id="1647096076" lat="50.7468682" lon="7.1556378" version="1" timestamp="2012-02-25T15:00:32Z" changeset="10788449" uid="49785" user="mike67"/> <node id="1647096079" lat="50.7469025" lon="7.1560030" version="2" timestamp="2012-05-13T23:29:39Z" changeset="11591622" uid="49785" user="mike67"/> <node id="1751820951" lat="50.7469115" lon="7.1558916" version="1" timestamp="2012-05-13T23:29:39Z" changeset="11591622" uid="49785" user="mike67"/> <node id="1751820952" lat="50.7465981" lon="7.1562371" version="1" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <node id="1751820953" lat="50.7463604" lon="7.1561245" version="1" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <node id="1751820954" lat="50.7462630" lon="7.1560233" version="1" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <node id="1751820955" lat="50.7461938" lon="7.1559261" version="1" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"/> <way id="26577114" version="3" timestamp="2012-05-13T23:29:40Z" changeset="11591622" uid="49785" user="mike67"> <nd ref="291435953"/> <nd ref="1751820952"/> <nd ref="291435954"/> <nd ref="1751820953"/> <nd ref="1751820954"/> <nd ref="1751820955"/> <nd ref="291435955"/> <tag k="highway" v="residential"/> <tag k="lit" v="yes"/> <tag k="name" v="Rhedenstraße"/> </way> <way id="26577115" version="2" timestamp="2011-12-22T14:12:55Z" changeset="10179910" uid="116044" user="berndw"> <nd ref="1558201814"/> <nd ref="291435956"/> <tag k="highway" v="residential"/> <tag k="name" v="Von-Ketteler-Straße"/> </way> <way id="26577275" version="4" timestamp="2012-02-25T15:00:32Z" changeset="10788449" uid="49785" user="mike67"> <nd ref="291438870"/> <nd ref="1647096049"/> <nd ref="1579451712"/> <nd ref="1558201822"/> <nd ref="1558201815"/> <tag k="highway" v="residential"/> <tag k="name" v="Mutter-Barat-Straße"/> </way> <way id="26577276" version="3" timestamp="2012-02-25T15:00:30Z" changeset="10788449" uid="49785" user="mike67"> <nd ref="291438871"/> <nd ref="291438872"/> <nd ref="1647095991"/> <nd ref="1647095994"/> <nd ref="291438873"/> <tag k="highway" v="residential"/> <tag k="lit" v="yes"/> <tag k="name" v="Stegerwaldstraße"/> </way> <way id="31347483" version="6" timestamp="2012-02-25T14:04:08Z" changeset="10787922" uid="49785" user="mike67"> <nd ref="1558201825"/> <nd ref="96133774"/> <nd ref="1647008854"/> <nd ref="1558201826"/> <nd ref="1558201827"/> <nd ref="96133775"/> <nd ref="1558201829"/> <nd ref="1558201831"/> <nd ref="96133776"/> <nd ref="1558201832"/> <nd ref="291438874"/> <nd ref="1558201836"/> <nd ref="96133777"/> <nd ref="291089398"/> <nd ref="96133778"/> <nd ref="32346787"/> <nd ref="291089396"/> <nd ref="291092263"/> <nd ref="33078442"/> <tag k="highway" v="residential"/> <tag k="lit" v="yes"/> <tag k="name" v="Alte Schulstraße"/> </way> <way id="39300712" version="3" timestamp="2011-10-30T13:18:29Z" changeset="9693579" uid="239847" user="theophrastus"> <nd ref="470930364"/> <nd ref="1212226113"/> <nd ref="470930365"/> <tag k="name" v="Alaunbach"/> <tag k="waterway" v="stream"/> </way> <way id="105196611" version="2" timestamp="2011-05-26T14:50:40Z" changeset="8254295" uid="49785" user="mike67"> <nd ref="1212226149"/> <nd ref="1212226142"/> <nd ref="1212226027"/> <nd ref="1212226049"/> <nd ref="1212226071"/> <nd ref="1212226149"/> <tag k="building" v="garages"/> </way> <way id="105196614" version="1" timestamp="2011-03-21T18:14:50Z" changeset="7630016" uid="49785" user="mike67"> <nd ref="1212226065"/> <nd ref="1212226220"/> <tag k="highway" v="service"/> </way> <way id="105196615" version="2" timestamp="2011-03-21T18:21:18Z" changeset="7630100" uid="49785" user="mike67"> <nd ref="1212226068"/> <nd ref="1212226149"/> <nd ref="1212226071"/> <nd ref="1212226197"/> <nd ref="1212226165"/> <nd ref="1212226068"/> <tag k="addr:city" v="Bonn"/> <tag k="addr:country" v="DE"/> <tag k="addr:housenumber" v="21a"/> <tag k="addr:postcode" v="53229"/> <tag k="addr:street" v="Von-Ketteler-Straße"/> <tag k="building" v="yes"/> </way> <way id="105196617" version="2" timestamp="2011-03-21T18:21:18Z" changeset="7630100" uid="49785" user="mike67"> <nd ref="1212226067"/> <nd ref="1212226047"/> <nd ref="1212226166"/> <nd ref="1212226180"/> <nd ref="1212226130"/> <nd ref="1212226067"/> <tag k="addr:city" v="Bonn"/> <tag k="addr:country" v="DE"/> <tag k="addr:housenumber" v="23"/> <tag k="addr:postcode" v="53229"/> <tag k="addr:street" v="Von-Ketteler-Straße"/> <tag k="building" v="yes"/> </way> <way id="105196618" version="2" timestamp="2011-03-21T20:19:24Z" changeset="7631407" uid="49785" user="mike67"> <nd ref="1212226110"/> <nd ref="1212226181"/> <nd ref="1212226107"/> <nd ref="1212226030"/> <nd ref="1212226125"/> <nd ref="1212226091"/> <nd ref="1212226208"/> <nd ref="1212226044"/> <nd ref="1212226127"/> <nd ref="1212226203"/> <nd ref="1212226085"/> <nd ref="1212226052"/> <nd ref="1212226042"/> <nd ref="1212226061"/> <nd ref="1212226038"/> <nd ref="1212226190"/> <nd ref="1212226139"/> <nd ref="1212226110"/> <tag k="amenity" v="school"/> <tag k="name" v="Marktschule"/> </way> <way id="105196620" version="2" timestamp="2011-05-26T14:50:40Z" changeset="8254295" uid="49785" user="mike67"> <nd ref="1212226196"/> <nd ref="1212226130"/> <nd ref="1212226180"/> <nd ref="1212226040"/> <nd ref="1212226035"/> <nd ref="1212226196"/> <tag k="building" v="garages"/> </way> <way id="105196621" version="2" timestamp="2011-03-21T18:21:17Z" changeset="7630100" uid="49785" user="mike67"> <nd ref="1212226041"/> <nd ref="1212226090"/> <nd ref="1212226171"/> <nd ref="1212226020"/> <nd ref="1212226041"/> <tag k="addr:city" v="Bonn"/> <tag k="addr:country" v="DE"/> <tag k="addr:housenumber" v="23a"/> <tag k="addr:postcode" v="53229"/> <tag k="addr:street" v="Von-Ketteler-Straße"/> <tag k="building" v="yes"/> </way> <way id="105196625" version="2" timestamp="2011-03-21T18:21:18Z" changeset="7630100" uid="49785" user="mike67"> <nd ref="1212226133"/> <nd ref="1212226104"/> <nd ref="1212226043"/> <nd ref="1212226192"/> <nd ref="1212226133"/> <tag k="addr:city" v="Bonn"/> <tag k="addr:country" v="DE"/> <tag k="addr:housenumber" v="23b"/> <tag k="addr:postcode" v="53229"/> <tag k="addr:street" v="Von-Ketteler-Straße"/> <tag k="building" v="yes"/> </way> <way id="105196626" version="1" timestamp="2011-03-21T18:14:54Z" changeset="7630016" uid="49785" user="mike67"> <nd ref="1212226028"/> <nd ref="1212226024"/> <nd ref="1212226031"/> <nd ref="1212226159"/> <nd ref="1212226131"/> <nd ref="1212226069"/> <nd ref="1212226028"/> <tag k="building" v="yes"/> <tag k="leisure" v="sports_centre"/> <tag k="sport" v="multi"/> </way> <way id="105196629" version="2" timestamp="2011-05-26T14:50:40Z" changeset="8254295" uid="49785" user="mike67"> <nd ref="1212226087"/> <nd ref="1212226026"/> <nd ref="1212226144"/> <nd ref="1212226184"/> <nd ref="1212226087"/> <tag k="building" v="garages"/> </way> <way id="142380554" version="1" timestamp="2011-12-22T14:11:57Z" changeset="10179910" uid="116044" user="berndw"> <nd ref="1558201831"/> <nd ref="291438870"/> <tag k="highway" v="footway"/> <tag k="name" v="Mutter-Barat-Straße"/> </way> <way id="142380557" version="3" timestamp="2012-05-13T23:29:39Z" changeset="11591622" uid="49785" user="mike67"> <nd ref="1558201823"/> <nd ref="1558201815"/> <nd ref="1558201810"/> <nd ref="1558201808"/> <nd ref="1558201806"/> <nd ref="1558201807"/> <nd ref="1558201809"/> <nd ref="1647096076"/> <nd ref="1558201814"/> <nd ref="1751820951"/> <nd ref="1647096079"/> <nd ref="291435953"/> <nd ref="1558201813"/> <nd ref="1558201812"/> <tag k="highway" v="residential"/> <tag k="lit" v="yes"/> <tag k="name" v="Von-Ketteler-Straße"/> </way> <way id="142380558" version="1" timestamp="2011-12-22T14:11:58Z" changeset="10179910" uid="116044" user="berndw"> <nd ref="1558201806"/> <nd ref="291435957"/> <nd ref="1212226220"/> <nd ref="291435958"/> <nd ref="291435959"/> <nd ref="1212226021"/> <tag k="bicycle" v="yes"/> <tag k="foot" v="yes"/> <tag k="highway" v="service"/> <tag k="motorcar" v="private"/> <tag k="motorcycle" v="private"/> <tag k="name" v="Von-Ketteler-Straße"/> </way> </osm>
The best way to handle this depends a bit on what context you're working in. In general, you're presumably going to have some code iterating over the way elements, and within that some other code iterating over nd elements. Fetch the #ref value from there and assign it to a variable, then write an XPath expression to find the node with that ID and return its #lat and #lon attributes. In XQuery, for example, the following query returns the set of way elements with each nd child augmented with lat/lon information. let $in := doc('/Users/cmsmcq/2012/misc/SO2/user1671.xml') for $w in $in//way return element {"way"} { for $a in $w/#* return $a, for $n in $w/nd let $id := $n/#ref, $node := $in//node[#id=$id], $lat := $node/#lat, $lon := $node/#lon return <nd ref="{$id}" lat="{$lat}" lon="{$lon}"/> } This is presumably not what you want (it drops the tag elements), but it may help you see the pattern you need. It's very difficult (I think it's impossible, but I don't have a proof of that proposition) to do this in XPath by itself, because XPath has no way to refer, from within a predicate, to the node which was the context node before the left-bracket of the predicate reset the context node. (That's what the XSLT current() function is for, and that's one of the things variable bindings are good for.)
Overpass API provides a new mode out geom; which embeds all ways' node lat/lon details right underneath the way element. Hence this rather complicated way of collecting node lat/lon details is no longer needed. Check the Overpass Query Language documentation on wiki.openstreetmap.org for further details. For illustration, this is the result you would get for query way(26577114);out geom; <?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="Overpass API"> <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note> <meta osm_base="2014-10-13T19:08:02Z"/> <way id="26577114"> <bounds minlat="50.7461387" minlon="7.1558430" maxlat="50.7468739" maxlon="7.1563067"/> <nd ref="291435953" lat="50.7468739" lon="7.1563067"/> <nd ref="1751820952" lat="50.7465981" lon="7.1562371"/> <nd ref="291435954" lat="50.7464770" lon="7.1561995"/> <nd ref="1751820953" lat="50.7463604" lon="7.1561245"/> <nd ref="1751820954" lat="50.7462630" lon="7.1560233"/> <nd ref="1751820955" lat="50.7461938" lon="7.1559261"/> <nd ref="291435955" lat="50.7461387" lon="7.1558430"/> <tag k="highway" v="residential"/> <tag k="lit" v="yes"/> <tag k="name" v="Rhedenstraße"/> </way> </osm>