xpath-1.0

Trying to select link text within a table cell if the desired text is also within the cell

荒凉一梦 提交于 2020-01-05 13:08:28
问题 So I have a table cell that contains both text and a link. Now every row in this table has the same text link hyperlink title "[Details]" but the location changes on where it takes you based on which row you are in. For example the cell will look like this: "Text I Want" [Details] I want to be able to go to the correct link based on what text is also within that cell, but am having some issues figuring out how to code that in Python. Once a row in this table is clicked it moves it location in

Trying to select link text within a table cell if the desired text is also within the cell

冷暖自知 提交于 2020-01-05 13:07:59
问题 So I have a table cell that contains both text and a link. Now every row in this table has the same text link hyperlink title "[Details]" but the location changes on where it takes you based on which row you are in. For example the cell will look like this: "Text I Want" [Details] I want to be able to go to the correct link based on what text is also within that cell, but am having some issues figuring out how to code that in Python. Once a row in this table is clicked it moves it location in

XPath 1.0: Use the attribute value of the current node's parent to find another matching node

我的未来我决定 提交于 2020-01-04 06:33:29
问题 I have found many similar posts to this question, but nothing that answers this specific question. I must use XPath 1.0. I do not have XSLT (or XQuery or anything else) available to me, and I cannot use XPath 2.0. I am executing this XPath from inside a piece of software (Arbortext Styler), in which I can use XPath 1.0 to select content from other nodes, but XSLT is not available in this context. Also, I have no control over the structure of the source XML. When I am in the context of <step>

XPath 1.0 COUNT - Unique values

纵然是瞬间 提交于 2019-12-25 03:54:20
问题 I've got this test XML: <test> <x a="1"> <x a="2"> <x> <y>y31</y> <y>y32</y> </x> </x> </x> <x a="1"> <x a="2"> <y>y31</y> <y>y32</y> </x> </x> <x a="1"> <y>y11</y> <y>y12</y> </x> <x> <y>y11</y> <y>y11</y> </x> </test> How can I query: 1 - All values for y y32, y32, y11, y12 2 - Number of values for y I'm trying to use COUNT but I can't count the number of UNIQUE values y has, for example if I run query against sample XML described before I need the result to be 4 . 回答1: If all you've got to

Creating a JSON from xml with date and time logic templates

天大地大妈咪最大 提交于 2019-12-25 01:14:11
问题 I'm trying to create a JSON from a XML which has messages and each message has its date/time. Below is the XML <message> <messageText heading="Temporary Maintenance Message 1">test message1</messageText> <displayScheduleContainer> <startDate>22/05/2019</startDate> <startTimeHrs>12</startTimeHrs> <startTimeMins>45</startTimeMins> <noEndDate>true</noEndDate> </displayScheduleContainer> </message> <message> <messageText heading="Temporary Maintenance Message 1">test message2</messageText>

How to translate a flat XML structure into hierarchical XML using XSLT 1.0?

怎甘沉沦 提交于 2019-12-24 23:54:28
问题 Starting from an exemplary, ungainly formatted XML structure: <list> <topic> <title> Paragraph 1 </title> </topic> <topic> <main> Content 1 </main> </topic> <topic> <main> Content 2 </main> </topic> <!-- ... --> <topic> <main> Content n </main> </topic> <topic> <title> Paragraph 2 </title> </topic> <topic> <main> Content 1 </main> </topic> <!-- ... --> <topic> <main> Content n </main> </topic> </list> The contents of "title" and "main" are merely placeholders. The content of "title" is

Vba selenium code to get data from Li class

耗尽温柔 提交于 2019-12-24 09:17:52
问题 I am trying to get data from li having same Class below is the code which i have tried but did not received any output. Please correct me where i am wrong. My VBA code: Sub Class_Initialize() Set driver = CreateObject("Selenium.FirefoxDriver") driver.get "url" driver.Window.Maximize Dim dd As Variant dd = driver.findElementsByClass("oas_columns ng-binding")(2).Text Range("A" & Rows.Count).End(xlUp).Offset(1) = dd 'In column A i require output Abhay 28566207 dd = driver.findElementsByClass(

XPath 1.0 select distinct attribute of siblings

你说的曾经没有我的故事 提交于 2019-12-24 03:24:24
问题 I have hunted around, but haven't been able to get any of the ideas I've found to work. These are a couple of nodes I have in an xml file (that is generated from a db) <PANELS> <PANEL ATTR1="7" ATTR2="37" ATTR3="31"/> <PANEL ATTR1="8" ATTR2="37" ATTR3="31"/> <PANEL ATTR1="8A" ATTR2="37" ATTR3="31"/> </PANELS> <ZONES> <ZONE ATTR1="7" ATTR2="37" ATTR3="31" /> <ZONE ATTR1="8" ATTR2="37" ATTR3="31" /> <ZONE ATTR1="8A" ATTR2="37" ATTR3="31" /> </ZONES> I want to be able to select the distinct

XPath “in” operator

China☆狼群 提交于 2019-12-19 17:30:09
问题 Is there is an operator in XPath 1.0 that acts as "in" operator in SQL? select * from tbl_students where id in (1,2,3) 回答1: The = operator of XPath 1.0 works that way, though XPath 1.0 doesn't provide syntax for writing sequences. So if you have an XML document of the form <doc> <value>1</value> <value>2</value> <value>3</value> </doc> then an expression like //doc[value = 2] will return that doc element. In XPath 2.0, the syntax (1, 2, 3) will create a sequence of three integers, and you can

How to use starts-with() , contains() and ends-with() in XPath to find the xml node innertext? in XPATH 1.0

情到浓时终转凉″ 提交于 2019-12-17 09:48:05
问题 <ArticleBackmatter> <Heading>Ethical standards and patient consent</Heading> <Heading>Ethical standards and patient</Heading> <Heading>standards and patient consent</Heading> </ArticleBackmatter> I want to get the inner text with start from "Ethical" , contains "and " and end with "consent" in the Heading node. 回答1: One possible way: //Heading[starts-with(., 'Ethical') and ends-with(., 'consent')] The ends-with() function is XPath 2.0. In XPath 1.0, it can be replaced using substring() and