RapidMiner xpath text extraction - xpath

In RapidMiner, I'm trying to pull data from div class "description". When I test the syntax using Google XPath import XML, it returns the appropriate data. When I try the following in RapidMiner, I get blank results:
//h:div[#id='description']/text()
This works:
//h:div[#id='description']
but I get all of the HTML markup data with it.
What do I need to add or remove?
On the same document, I was able to get this to return expected results:
//h:label[#id='desc']/text()
XML:
div id="description" class="longdesc" style=" padding-top: 0px; display: block;" xmlns:IDB="urn:ItemDataBinding">Description Text Here./div

Related

Wicked_pdf avoid page-break-inside not working

This is the result when i use Wicked_pdf to convert my html.erb page to pdf.
Problem: Seem table 's tr has been splitted into two pages.
What i tried without success:
Use page-break-inside as described here or here
table, tr, td, th, tbody, thead, tfoot {
page-break-inside: avoid !important; }
putting text within a div, as explained here
here
Another option: place each tr in its own tbody and then apply the
peage break css rules to the tbody. Tables support multiple tbodys.
A bit of extra markup, but works decently for me.
I am using Ruby on Rails 4.2.6, Wicked_pdf latest version, bootstrap.
Relate issue on github
Question: How can i make table 's tr not split into two pages.
well, to solve this you have to user page-break-inside: avoid !important; with the repeated div the results in this overflow.
like if you have:
<div class="main">
<div class="article">
...
</div>
<div class="article">
...
</div>
<div class="article">
...
</div>
...
...
...
</div>
which results in overflow that will make things overlap with the header within the page breaks..
so >> use: page-break-inside: avoid !important; with this class article.
table.report-container div.article {
page-break-inside: avoid;
}
---> here is a full answer to print a page properly using html/css

Scout Eclipse Neon margin on fields

Is it possible to set a margin around fields.
For example in image :
If I want to set lower (separated) checkBox in line with above once, is there a way to do it?
Marko
Start by inspecting the HTML code (with Chrome).
The code corresponding to the Checkbox Field is something like that:
<div class="form-field check-box-field"
data-modelclass="org.eclipse.scout.widgets.client.ui.forms.CheckboxFieldForm$MainBox$ConfigurationBox$CheckboxField"
data-classid="CheckboxField_org.eclipse.scout.widgets.client.ui.forms.CheckboxFieldForm"
id="scout.CheckBoxField[1-49]"
style="left: 0px; top: 14px; width: 1598px; height: 30px;"
>
<div class="field has-inner-alignment halign-left valign-top" style=
"left: 148px; top: 0px; width: 1420px; height: 30px;">
<div class="check-box" tabindex="0"></div>
<div class="label">
Checkbox
</div>
</div>
</div>
With CSS you can do anything possible:
.check-box-field {
background-color: red;
}
Now because you do not want to add some custom CSS style for all CheckBox Fields, you can define a custom Css-Class in your CheckBox:
#Order(4)
public class UnknownCheckBox extends AbstractBooleanField {
#Override
protected String getConfiguredCssClass() {
return "checkbox-under-listbox";
}
// ... Some Code ...
}
And now you add this CSS code:
.checkbox-under-listbox {
margin-left: 20px;
}
I have realized this example with the Widgets Demo Application (org.eclipse.scout.docs repository, releases/5.2.x branch). I added my css code in this file: org.eclipse.scout.widgets.ui.html/src/main/js/widgets/main.css (It is probably not the best approach to have everything in main.css).
You can deduce from this example how you can add an additional CSS/LESS module and macro to your application. This post: Inclusion of additional icons from font-awesome might also be usefull. You will have a main.css instead of a font.css.
WARNING: this is not state of the art.
At the end this is normal HTML development (single page application of course), so you can do what you want...
If you do not want to use the LESS compiler and the File preprocessor, you can simpelly add a normal CSS file in the folder:
<your_project>.ui.html/src/main/resources/WebContent
Let say:
<your_project>.ui.html/src/main/resources/WebContent/my_custom.css
Do not forget to include your CSS File between the <head> and </head> tags in the HTML index file:
<your_project>.ui.html/src/main/resources/WebContent/index.html
Something like:
<head>
<!-- some code -->
<link rel="stylesheet" type="text/css" href="my_custom.css">
<scout:stylesheet src="res/scout-module.css" />
<!-- some code -->
</head>
You can always use custom CSS: Let your field implement IStyleable and use setCssClass() to apply an appropriate CSS class. I'd try to avoid using such pixel pushing approaches as much as possible.

CSS selector for other tags other than div and span?

I have been using css selectors as div and span till now while using Selenium WebDrivers with Ruby for testing.
However I have some dd and xmlns:dd attributes as well. Is it possible to have a css selector for this as well.
Html Code:
<div class="class1 class2 class3 class4" style="padding: 4px;" id="_c04a6325-5316-4177-980f-38484eb27730">
<span class="class5" style="font-weight: bold; text-decoration: underline;">Month</span>
<div class="class6" dd:contenttype="Month" dd:referenceuuid="1446A201-FD91-4A82-B645- 306DC948DC48" id="_3d510b04-8a5a-4bf9-bc7a-8efd55f9ca48">
<div xmlns:dd="Week" class="class7 class8" dd:entityid="1457893" dd:contenttype="Monday" id="_7480bbe4-bbf0-4a54-8994-ae773b418470">
Breakfast
</div>
</div>
</span>
</div>
What I presently do:
$driver.find_elements(:css, 'div.class7.class8')
What I want to do:
Something like this to use the data in dd:contenttype and/or xmlns:dd to find an element
$driver.find_elements(:css, 'div.dd:contenttype="Monday"') OR
$driver.find_elements(:css, 'div.xmlns:dd="Week"')
Is the possible to find and element using dd:contenttype and/or xmlns:dd??
use $driver.find_elements(:css, 'div[dd\\:contenttype="Monday"]')
for more information you can take a look on http://sauceio.com/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/
Try this way:
$driver.find_elements(:xpath, "//div[#class = 'class6 class7' and #dd:contenttype = 'Monday'")
The above should work.

Image Showing Through Hidden DIV?

I am currently working with a page that has a few hidden divs, being called on to be displayed later.
This is the code I have on the page itself causing the problem.
<div align="center" id="check">
Block of plain text right here.<br />
Checking...<br />
<img src="http://sw6.us/template/images/loading.gif" /><br />
<?php
require("databasetest.php");
?>
echo "check_data shown";
</div>
This code here is what I have modifying the "check" div on a style page
.check {
padding-top: 25px;
padding-left: 0px;
color: white;
align: center;
display:none;
}
As you can see the div is instructed to be hidden on page load via the style code. Everything is hidden except for the picture.
I don't believe the PHP is the issue because I included an echo displaying text which is properly hidden along with the HTML before it. I also took out that require command and the image was still not hidden. The image being a .GIF is not the issue either, I have tried using a .png and got the same problem!
Thanks for the help! It is greatly appreciated!

nokogiri with :after css selector

I've the following html:
<li><a href="/stumbler/millisami/tag/company/" class="">
<span class="right">69</span>
company</a>
</li>
and I want to scrap the text after the span tag, i.e. "company"
So, when I tried
doc.at_css("span:after")
the no method error :after is thrown.
How to use pseudo selectors with Nokogiri??
According to the CSS 2.1 standard, the ':before' and ':after' pseudo-elements can be used to insert generated content before or after an element's content, but not to per se select elements.
You can workaround this shortcoming using
doc.at_css("span").next_sibling()

Resources