Jun 02
Jon Harris using namespaces in xpath [LP8.6]
Jun 02, 2017; 10:21
Jon Harris
using namespaces in xpath [LP8.6]
Hi List
We are trying to extract data from an Excel spreadsheet, exported as XML.
<?LassoScript
var('thefileName') = '/uploads/data/sample.xml' ;
var('thefile') = file_read( var('thefileName') ) ;
var('theXML') = xml(var('thefile')) ;
Var('Namespaces') = $theXML->(Namespaces);
Iterate( $Namespaces, Var('Temp') );
$Temp->First + ' = ' + $Temp->Second "<br />" ;
/Iterate;
var('theRows') = xml_extract(-xml=var('theXML'),-Xpath='//Row[1]/Cell[1]/text()') ;
?>
I can see the namespaces as my code returns:
= urn:schemas-microsoft-com:office:spreadsheet
o = urn:schemas-microsoft-com:office:office
x = urn:schemas-microsoft-com:office:excel
ss = urn:schemas-microsoft-com:office:spreadsheet
But my rows variable is always empty. I have tried lots of variations with the xpath including " //*:Row", but nothing seems to work. The data I want to extract is in the "ss" namespace (urn:schemas-microsoft-com:office:spreadsheet).
I can see that in xmlstream I can specify namespaces, but how do I use them within my xpath?
Any help appreciated.
Jon Harris
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jun 02
Bil Corry Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 10:23
Bil Corry
Re: using namespaces in xpath [LP8.6]
Jun 02
Mason Miller Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 19:08
Mason Miller
Re: using namespaces in xpath [LP8.6]
Jun 02
Mason Miller Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 19:14
Mason Miller
Re: using namespaces in xpath [LP8.6]
Jun 02
Mason Miller Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 19:16
Mason Miller
Re: using namespaces in xpath [LP8.6]
Jun 02
Mason Miller Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 19:19
Mason Miller
Re: using namespaces in xpath [LP8.6]
Jun 02
Mason Miller Re: using namespaces in xpath [LP8.6]
Jun 02, 2017; 19:34
Mason Miller
Re: using namespaces in xpath [LP8.6]
Jun 05
Jon Harris RE: using namespaces in xpath [LP8.6]
Jun 05, 2017; 08:04
Jon Harris
RE: using namespaces in xpath [LP8.6]
Jun 05
Steve Piercy - Website Builder RE: using namespaces in xpath [LP8.6]
Jun 05, 2017; 01:34
Steve Piercy - Website Builder
RE: using namespaces in xpath [LP8.6]
Jun 05
Andreas Steinmann Re: using namespaces in xpath [LP8.6]
Jun 05, 2017; 10:52
Andreas Steinmann
Re: using namespaces in xpath [LP8.6]
Jun 06
Jon Harris RE: using namespaces in xpath [LP8.6]
Jun 06, 2017; 13:08
Jon Harris
RE: using namespaces in xpath [LP8.6]
Jun 06
Jon Harris RE: using namespaces in xpath [LP8.6]
Jun 06, 2017; 13:09
Jon Harris
RE: using namespaces in xpath [LP8.6]
Jun 06
Ke Carlton Re: using namespaces in xpath [LP8.6]
Jun 06, 2017; 22:37
Ke Carlton
Re: using namespaces in xpath [LP8.6]
Jun 12
Jon Harris RE: using namespaces in xpath [LP8.6]
Jun 12, 2017; 10:11
Jon Harris
RE: using namespaces in xpath [LP8.6]