I plan to use dom4j DOM Document as a static cache in an application where multiples threads can query the document.
Taking into the account that the document itself will never change, is it safe to query it from multiple threads?
I wrote the following code to test it, but I am not sure that it actually does prove that operation is sa...
I have an xml node that looks like <slot highcount="20" lowcount="10" />
I've tried the following xpath expression:
XmlNode node = xdoc.SelectSingleNode("slot[@lowcount>=12] && slot[@highcount <=12]");
but I get an invalid token error and I don't have enough experience with this to know what I'm doing wrong. Any ideas?
...
The title is more complicated than it has to be, here's the problem query.
SELECT *
FROM query.multi
WHERE queries="
SELECT *
FROM html
WHERE url='http://www.stumbleupon.com/url/http://www.guildwars2.com'
AND xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span';
SELECT *
FROM xml
...
General Problem
Though I may be diagnosing the root cause of an event, determining how many users it affected, or distilling timing logs in order to assess the performance and throughput impact of a recent code change, my tools stay the same: grep, awk, sed, tr, uniq, sort, zcat, tail, head, join, and split. To glue them all together, U...
In my case, I have:
<booklist>
<book id="1">
</book>
<book id="2">
</book>
<book id="3">
</book>
......
</booklist>
How can i just return:
<booklist>
<book id="1">
</book>
</booklist>
if I use /booklist/book[@id=1], I can only get
<book id="1">
</book>
But I also need the document element.
Thanks
...
I want to use PHP (possibly with Curl/XPath?) to extract data from Wikipedia pages. What would be the best way to go about this? I'll be using CakePHP for this project, although just need to figure out how to get this working first.
...
Please explain what is the use of @ symbol in XSLT with example.
Cheers!
Lokesh Yadav
...
Hey, I'm very newbie to xPath and time is against me, I don't have the time right now to learn a lot about it, so I hope you guys can help me with this! :)
Here is my xml format:
<Filme>
<Film>
<filmid>13497</filmid>
<originaltitel>Bird</originaltitel>
<originaluntertitel></originaluntertitel>
<titel>Bird (OmU)</titel>
<unte...
hi!
I am new to XPath, and from what I have read in some tutorials about axes, I am still left wondering how to implement them. They aren't quite behaving as I had expected. I am particularly interested in using ancestor and descendant axes.
I have the following XML structure:
<file>
<criteria>
<root>ROOT</root>
<...
I need an XSL solution to replace XML nodes with new nodes.
Say I have the following existing XML structure:
<root>
<criteria>
<criterion>AAA</criterion>
</criteria>
</root>
And I want to replace the one criterion node with:
<criterion>BBB</criterion>
<criterion>CCC</criterion>
<criterion>DDD</criterion>
So that th...
I am testing a calendar component using Selenium. In my test I want to click on the current date. Please help me with the XPath statement for doing that. I am adding the HTML for the calendar component.
<input id="event_date" type="text" on="click then l:show.event.calendar" style="border: 1px solid rgb(187, 187, 187); width: 100px;" f...
I have to implement a search feature which is able to quickly perform arbitrary complex queries to XML-data. If the user makes a query, all XML files must be searched to find possible matches.
The users will have lots of XML-Files (a few 10000 or more) which are typically a few kilobytes in size. All the XML-files have almost the same st...
I want to optimize my javascript but I ran into a bit of trouble. I'm using XSLT transformation and the basic idea is to get a part of the XML and subquery it so the calls are faster and less expensive. This is a part of the XML:
<suite>
<table id="spis" runat="client">
<rows>
<row id="spis_1"> ...
I'm trying to write a utility that automatically sets the ProviderManifestToken attribute in an EDMX document Schema element, but even my basic XPath is not working. What am I doing wrong?
The XML:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<!-- EF R...
Hi all, simple question but I've been dinking around with it for an hour and it's really starting to frustrate me. I have XML that looks like this:
<TimelineInfo>
<PreTrialEd>Not Started</PreTrialEd>
<Ambassador>Problem</Ambassador>
<PsychEval>Completed</PsychEval>
</TimelineInfo>
And all I want to do is use C# to get...
Given the following xml document (assuming more books then actually listed) and using the java implementation of xpath.
What expression would I use to find a unique set of author names?
<inventory>
<book year="2000">
<title>Snow Crash</title>
<author>Neal Stephenson</author>
<publisher>Spectra</publisher>
...
Is it possible with XPath to get a concatenated view of all of the children of a node? I am looking for something like the JQuery .html() method.
For example, if I have the following XML:
<h3 class="title">
<span class="content">this</span>
<span class="content"> is</span>
<span class="content"> some</span>
<span class...
Why does
<xsl:if test="<XPATH to boolean value here>">
...
</xsl:if>
ALWAYS return true?
Since boolean can be 0,1,"false" and "true" by definition, the ONLY way to test for a boolean value is to do string comparison against these. This can't be right.
...
Let's say I have this document.
<a:Root>
<a:A>
<title><a:B/></title>
<a:C>
<item><a:D/></item>
</a:C>
</a:A>
</a:Root>
And I have an XmlNode set to the <a:A> element.
If I say
A.SelectNodes( "//a:*", namespaceManager )
I get B, C, and D. But I don't want D because it's nested in another...
I want a lite-weight C++ XML parser/DOM that:
Can take UTF-8 as input, and parse into UTF-16. Maybe it does this directly (ideal!), or perhaps it provides a hook for the conversion (such as taking a custom stream object that does the conversion before parsing).
Offers some XPath support.
I've been looking at RapidXML, the Kranf xmlP...