Please help me sort this XPath

I came across this XPath in one of my tutorial codes:

  count($recprv//*[local-name()='provider_email' or local-name()='provider_fax' 
  or local-name()='provider_phone' or local-name()='provider_phone_ext' ])

Now itโ€™s difficult for me to understand what this means, I personally think that he says: "in the xpr recprv file, count the number of any elements that either contain provider_email or contain provider_fax or contain provider_phone or contain provider_phone_ext.

So it will basically go through the xml file recprc and count all the records? A bit confused. Moreover, I would like to know what is EXACTLY counted in the count function. Thanks so much for helping me here!

+1
source share
2 answers
 count($recprv//*
            [local-name()='provider_email'
           or 
            local-name()='provider_fax'  
          or 
            local-name()='provider_phone' 
          or 
            local-name()='provider_phone_ext' 
            ]
       ) 

This means :

, , $recprv, local-name() ( , , ) provider_email, provider_fax, provider_phone provider_phone_ext.

$recprv (node -set), , parent = > children.

+8

$recprv - , XPATH node -set,

local-name() URI , , , <provider_phone />, <xyz:provider_phone />

+2

Source: https://habr.com/ru/post/1778277/


All Articles