XPath Elements lower than a certain number [closed] - xpath

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I'm trying to apply a XPath to my XML, in order to find the items that cost less than 1.00 from a certain category.
Here is a sample of my XML:
<Shop>
<Category name="Fish">
<Article id="1" nome="Tuna">
<Price>0.90</Price>
<stock>100</stock>
</Article>
<Article id="2" name="Sword Fish">
<Price>1.50</Price>
<stock>100</stock>
</Article>
</Category>
</Shop>
And I have this XPath:
Shop/Category[name="Fish"]/Article[Price<=1.00]
I want to find all price that cost less than 1.00 from the category Fish.. The error here exists in Category[name="Fish"] (and I need to apply that filter) cause if I execute this XPath:
Shop/Category/Article[Price<=1.00]
The correct list of nodes is returned successfully.

You need to use an # when targetting the name attribute:
Shop/Category[#name="Fish"]/Article[Price<=1.00]

Related

Accented characters in Sphinx headings [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I want to include accented characters in a Sphinx heading such that I will see the following result:
Finalé
I have tried the following strategies:
Use the unicode character directly such as:
Finalé
======
but the character is considered invalid by Docutils.
Also, I have tried using the strip_html specification in conf.py along with the following text:
Finalé
==============
But the text is left unchanged and the HTML entity is passed through.
Can anyone suggest a way of handling accented characters in Sphinx that will work in all situations and where the final output may be HTML or Latex?

Visualize an OWL file with Gruff [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I load an OWL file in Gruff? It's not clear in the tutorials. I have a file, camera.owl. I need to display this in Gruff and view a graph of it.
I found the answer to this question myself. You need to look under the file menu. File > Load Triples > RDF/XML > File .... Thank you.

Prawn: how to remove all borders from a table? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm working with Prawn gem and creating a table. I want to remove all its borders. I can't find this facility in the documentation.
How do I do that?
Here is the documentation for the prawn gem tables.
According to the "Constructor Details" section, you can pass a variety of :border_<x> options to the constructor... I'd suggest trying to pass a value of :border_width => 0 to your table constructor. (note: not tested - try it yourself and see what happens)

Links contains #, would it affect SEO? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
If i have such links in my site (i am using mvcsitemap):
http://mysite.com/coollink
http://mysite.com/coollink#contanttab1
http://mysite.com/coollink#contenttab2
If i want to submit site map to google for example, should i use the links with # in mysite XML sitemap? or better not to use them in sitemap XML?
Because in such case there would be 3 links to the same resource as i understand and it is not so good for SEO? could some one correct me if i am wrong.
As far as I know so far, hashes will be ignored by most of the search engines and they have no use for SEO. It is user more for internal page navigation or some sort of JavaScript actions.

Xpath query to select node when attribute does not exist? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 14 years ago.
Improve this question
I want to select nodes for which a specific attribute does not exist. I've tried the Not() function, but it doesn't work. Is there a way for this?
Example:
The following Xpath query:
group/msg[not(#owner)]
Should retrieve the first node but not the 2nd one. However, both SketchPath (tool to test Xpath queries) and my C# code consider that the 2 nodes are ok.
<group>
<msg id="EVENTDATA_CCFLOADED_XMLCONTEXT" numericId="14026" translate="False" topicId="302" status="translated" >
<text>Context</text>
<comment></comment>
</msg>
<msg id="EVENTDATA_CCFLOADED_XMLCONTEXT_HELP" numericId="14027" translate="False" topicId="302" status="translated" owner="EVENTDATA_CCFLOADED_XMLCONTEXT" >
<text>Provides the new data displayed in the Object.</text>
<comment></comment>
</msg>
</group>
In fact the Not() function works correctly, it's just that I had other conditions and parentheses weren't set correctly. errare humanum est.
In some old and not very standard XPath engine I had to use string-length(#attr)=0 for the same reason.
Works for me when testing with XPath Explorer (based on Jaxen library).
So I guess it is indeed depending on the XPath implementation.

Resources