0

I have huge xml and need xpath query to "ПланыСтроки" and other similar elements

I open xml in firefox and copy xpath of node:

/Документ/diffgr:diffgram/dsMMISDB/ПланыСтроки[1]

and it does not work (i tested in https://codebeautify.org/Xpath-Tester, but and in python-lxml (when I need run that code) some results).

The query runs well before the node

/Документ/diffgr:diffgram

and after that nothing match...

XML: https://drive.google.com/file/d/19VQA-PpslQmcwdz-40MQ7cysDTvO7p_r/view?usp=sharing

PaiNt
  • 133
  • 6

1 Answers1

0

The dsMMISDB element is in a namespace. Search for "XSLT default namespace" (there are about 700 hits, because so many people hit this problem) for a solution.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • Thanks. I find soluten on https://stackoverflow.com/questions/6920073/how-to-use-xpath-from-lxml-on-null-namespaced-nodes – PaiNt Jul 18 '19 at 00:58
  • I create this "virtual namespace" for XSLT default namespace in and use xpath like this "//*/virtual_NS:ПланыСтроки" – PaiNt Jul 18 '19 at 01:00