Having a decorative element between links but still contained within a list? - html-lists

So I was thinking of putting a decorative element between links such as // for example.
So it would be LINK1 // LINK2 // LINK3 // LINK4 // LINK5 but ONLY between the links for decoration purposes such as
EXAMPLE of coding
Is there a way to do the same with a html list or in a more cleaner or technically correct format? Or would this be the way to code something like that since I keep reading that lists are a better way of formatting a links menu. Thanks for all the help!

The easiest method is how you do it (that's the way I do it also :)But yes, using an HTML list is the more technically correct method. Especially for non-CSS devices, the links will be a decent-looking bullet list, rather than a long string of links (which may not look good without CSS).

Related

algorithm to find 'article' in webpage?

some browser plugin, like readability can extract the 'article' from a webpage. Does anyone has idea about how to do it? What's the difference between the real articles and ads or comments?
Well, it depends how you want to define "real articles"...
Taking HTML5 into consideration, a webpage is constructed of semantic tags. Pages no longer have to be built with elements like <div> that have exactly no semantic meaning. In HTML5 you may use <section>, <article>, <header> and so on. Those elements can give an application pretty good sense of what is the main content of a webpage (e.g. print <article>s and skip <nav>s...)
Of course, not many pages use those tags yet. Furthermore, the tags might get abused and lose their meaning. In that case I'd stick to some statistics, e.g. selecting the largest elements in a HTML document. Moreover, if you have to scrape a webpage, you could use a modification of some pattern-matching algorithm, DIPRE for instance.

CEWP to show images (HTML) works until I use grouping. Then I see the DIV tag

I'm fairly new to Share Point so forgive me if this is to easy for you guys, but I could not seem to find the answer anywhere and I am rather stumped.
I am currently trying to make a website to track if particular tasks go over their due date. I have a calculated column that leaves a DIV tag to the image of a red/yellow/green circle which is displayed by the javascript for a Content Editor Web Part (CEWP) made by Christophe on his site here:
http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/
I was able to put his code into the CEWP and everything looks great when it is in a standard list.
But I want a web part version of this on the homepage for easy view. When I make the web part (of a view grouping by the image tag) and place on the main site all I see is the DIV tag! I made sure to put an identical CEWP on the homepage as well but i get as grouping:
+[columnName] : DIV>img title=blahblahblah>/DIV> (2)
Needles to say when I expand this it stays the same for all entries below
Any Ideas?
Thanks for your time :D
Nobody has responded, but I found the answer so hopefully this will save someone the hours of grief I had. This will seem ridiculous but just go with it.
In the calculated column instead of returning the type as text, return it as a currency. Sounds ridiculous BUT IT WORKS!!

WP7 Changing 1 layout element based on another

Having no luck here trying to find a solution to this.
I've set up a looping selector based on this guide. (I also used the ListLoopingDataSource class in Part 2 in order to have strings in my looping list).
What I want to be able to do is then change another element (an image box/placeholder) on my layout, based on what is currently selected in the looping selector.
No real idea how to do this, the onSelectionChanged event is kind of abstracted and not really useful? I'm not sure how to programmatically change images either, it doesn't look like I can access a resource from the code base, only from the xaml.
Any help/suggestions would be greatly appreciated.
I found that I could do this by using binding.

extract xpath

I want to retrieve the xpath of an attribute (example "brand" of a product from a retailer website).
One way of doing it is using addons like xpather or xpath checker to firefox, opening up the website using firefox and right clicking the desired attrbute I am interested in. This is ok. But I want to capture this information for many attributes and right clicking each and every attribute maybe time consuming. Also, the other problem I have is that attributes I maybe interested in will be there for one product. The other attributes maybe for some other product. So, I will have to go that product & then do it manually again.
Is there an automated or programatic way of retrieving the xpath of the desired attributes from a website rather than having to do this manually?
You must notice that not all websites use valid XML that you can use xpath on...
That said, you should check out some HTML parsers that will allow you to use xpath on HTML even if it is not a valid XML.
Since you did not specify the technology you are working with - I'll suggest the .NET HTML Agility Pack, if you need others, search for questions dealing with this here on SO.
The solution I use for this kind of thing is to write an xpath something like this:
//*[text()="Brand"]/following-sibling::*
//*[text()="Color"]/following-sibling::*
//*[text()="Size"]/following-sibling::*
//*[text()="Material"]/following-sibling::*
It works by finding all elements (labels) with the text you want and then looking to the next sibling in the HTML. Without a specific URL to see I can't help any further.
This is a generalised version you can make more specific versions by replacing the asterisks is tag types, and you can navigate differently by replacing the axis following sibling with something else.
I use xPaths in import.io to make APIs for this kind of thing all the time, It's just a matter of finding a xPath that's generic enough to find the HTML no matter where it is on the page, but being specific enough to get the right data.

What algorithms could I use to identify content on a web page

I have a web page loaded up in the browser (i.e. its DOM and element positioning are both accessible to me) and I want to find the block element (or a sorted list of these elements), which likely contains the most content (as in a continuous block of text). The goal is to exclude things like menus, headers, footers and such.
This is my personal favorite: VIPS: a Vision-based Page Segmentation Algorithm
First, if you need to parse a web page, I would use HTMLAgilityPack to transform it to an XML. It will speed everything and will enable you, using a simple XPath to go directly to the BODY.
After that, you have to run on all the divs (You can get all the DIV elements in a list from the agility pack), and get whatever you want.
There's a simple technique to do this,based on analysing how "noisy" HTML is, i.e., what is the ratio of markup to displayed text through an html page. The Easy Way to Extract Useful Text from Arbitrary HTML describes this tex, giving some python code to illustrate.
Cf. also the HTML::ContentExtractor Perl module, which implements this idea. It would make sense to clean the html first, if you wanted to use this, using beautifulsoup.
I would recommend Vit Baisa's thesis on Web Content Cleaning, I think he has some code too, but I can't find a link for it. There is also a discussion of the very same problem on the natural language processing LingPipe blog.

Resources