[erlang-bugs] FW: Scalar expressions problem in xmerl - xpath:scan

John Watson <>
Fri Jul 11 17:35:49 CEST 2008


Dear Erlang bug support,

 

I seem to be having problems using scalar expressions that include
functions within XPath in xmerl (1.1.9).  I am using R12B-3 on Windows.
The following XPath queries are legal, as far as I can tell, but xmerl
doesn't accept them. I'd be grateful if you could tell me if this really
is a problem and provide a fix if possible.  

 

Problem is in: 

 

xmerl_xpath:string(Pattern,Xml)

 

where Xml is a parsed reprsentation of Xml = "<code cd1= 'AA' cd2 = 'BB'
/>"

 

when Pattern is concat(/code/@cd1, /code/@cd2) it produces:

 

** exception error: no function clause matching

                    xmerl_xpath:match_expr({function_call,concat,

                                            [{path,abs,

                                              {refine,

                                               {step,

                                                {child,

 
{name,{code,[],"code"}},

                                                 []}},

                                               {step,

                                                {attribute,

                                                 {name,{cd1,[],"cd1"}},

                                                 []}}}},

                                             {path,abs,

                                              {refine,

                                               {step,

                                                {child,

 
{name,{code,[],"code"}},

                                                 []}},

                                               {step,

                                                {attribute,

                                                 {name,{cd2,[],"cd2"}},

                                                 []}}}}]},

                                           {state,

                                            {xmlContext,forward,

                                             {xmlNode,element,

                                              {xmlElement,code,code,[],

                                               {xmlNamespace,[],[]},

                                               [],1,

 
[{xmlAttribute,cd1,[],[],[],

                                                 [],1,[],"AA",false},

 
{xmlAttribute,cd2,[],[],[],

                                                 [],2,[],

                                                 [...],...}],

 
[],[],"C:/mycode/erlang/xml",

                                               undeclared},

                                              [],1},

                                             1,[],[],[],[],

                                             {xmlNode,root_node,

                                              {xmlDocument,

                                               {xmlElement,code,code,[],

                                                {xmlNamespace,[],[]},

                                                [],1,

                                                [{xmlAttribute,cd1,...},

                                                 {xmlAttribute,...}],

                                                [],[],

                                                [...],...}},

                                              [],1}},

                                            []})

     in function  xmerl_xpath:string/5

 

 

When Pattern is string-length(/code/@cd1) it produces:

 

** exception error: no function clause matching

 
xmerl_xpath:match_expr({function_call,'string-length',

                                            [{path,abs,

                                              {refine,

                                               {step,

                                                {child.......

 

     in function  xmerl_xpath:string/5

 

Yours sincerely

 

John Watson


*************************************************************
Satellite Information Services Limited Registered Office: 
17 Corsham Street London N1 6DR, Company No. 4243307

The information in this e-mail (which includes any files
transmitted with it) is confidential and is intended for the
addressee only. Unauthorised recipients are required to
maintain confidentiality.  If you have received this e-mail
in error please notify the sender immediately, destroy any
copies and delete it from your computer system. 
*************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080711/0d839b53/attachment.html>


More information about the erlang-bugs mailing list