What is the way of extracting values from xml document using XPath?

clisdidgisity

New Member
I'm currently working on extracting data from a form. I'm able to extract the rpm-type and attributes like ccoid_key, ccoid_version but I'm unable to extract the "190".I'm using the folowing syntax '//form///rpm-type/.' and tested it on http://www.xpathtester.com/test which seems to return want I want...\[code\]<form xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:exforms="http://www.exforms.org/exf/1-0" xmlns:fr="http://orbeon.org/oxf/xml/form- runner" xmlns:ns2="http://db.rpm" xmlns:ns3="http://wscommon.rpm" xmlns:ns4="http://form.rpm" xmlns:ns5="http://form.rpm" xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary" xmlns:saxon="http://saxon.sf.net/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sql="http://orbeon.org/oxf/xml/sql" xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"><section-data><date>2012-06-12Z</date><author-name>admin admin</author-name><note>note</note></section-data><section-2><control-4><rpm-type ccoid_key="K000001" ccoid_version="1" type="rpm-weight"> <rpm-value ccoid_key="K000002" type="rpm-weight-kg">190</rpm-value></rpm-type> </control-4><control-5><rpm-type ccoid_key="K000001" ccoid_version="1" type="rpm-weight"> <rpm-value ccoid_key="K000002" type="rpm-weight-lbs">222</rpm-value> <rpm-value ccoid_key="K000003" type="rpm-weight-oz">21</rpm-value></rpm-type></control-5></section-2></form>\[/code\]I'm using node.getNodeValue() but I get a null...From the logs, I can see I was able to extract many of the attributes and their values,but when trying to get the value of the childNode, I get null :2012-06-12 14:17:49,028 [http-thread-pool-1234(2)] DEBUG [FormSrvcImpl:944] Path :[//form///rpm-type/.]2012-06-12 14:17:49,039 [http-thread-pool-1234(2)] DEBUG [FormSrvcImpl:1007] node value found : null2012-06-12 14:17:49,040 [http-thread-pool-1234(2)] DEBUG [FormSrvcImpl:1054] Clinical Unit to add :ClinicalUnit [idCcUnit=, idCc=0, ccoidUnitKey=K000002, ccoidUnitVersion=0]2012-06-12 14:17:49,041 [http-thread-pool-1234(2)] DEBUG [FormSrvcImpl:1055] Clinical Type to add :ClinicalType [idCcClinicalType=, idCc=0, ccoidClinicalTypeKey=rpm-weight, ccoidClinicalTypeVersion=1, valueType=null, units=null]2012-06-12 14:17:49,041 [http-thread-pool-1234(2)] DEBUG [FormSrvcImpl:1056] Clinical Value to add :ClinicalValue [id_clinical_value=http://stackoverflow.com/questions/11000328/0, clinicalType=ClinicalType [idCcClinicalType=, idCc=0, ccoidClinicalTypeKey=rpm-weight, ccoidClinicalTypeVersion=1, valueType=null, units=null], clinicalValue=null, valueDate=null, status=ACTIVE, sourceType=ORBEON_FORM, idSource=18585, idPatient=219, clinicalUnit=null]
 
Back
Top