How to parse XML in Bash?

This is really just an explaination of Yuzem’s answer, but I didn’t feel like this much editing should be done to someone else, and comments don’t allow formatting, so… rdom () { local IFS=\> ; read -d \< E C ;} Let’s call that “read_dom” instead of “rdom”, space it out a bit and use … Read more

Margin on child element moves parent element

Found an alternative at Child elements with margins within DIVs You can also add: .parent { overflow: auto; } or: .parent { overflow: hidden; } This prevents the margins to collapse. Border and padding do the same. Hence, you can also use the following to prevent a top-margin collapse: .parent { padding-top: 1px; margin-top: -1px; … Read more

Why can’t the tag contain a tag inside it?

An authoritative place to look for allowed containment relations is the HTML spec. See, for example, http://www.w3.org/TR/html4/sgml/dtd.html. It specifies which elements are block elements and which are inline. For those lists, search for the section marked “HTML content models”. For the P element, it specifies the following, which indicates that P elements are only allowed … Read more

Redirect from an HTML page

Try using: <meta http-equiv=”refresh” content=”0; url=http://example.com/” /> Note: Place it in the <head> section. Additionally for older browsers if you add a quick link in case it doesn’t refresh correctly: <p><a href=”http://example.com/”>Redirect</a></p> Will appear as Redirect This will still allow you to get to where you’re going with an additional click.

How to include another XHTML in XHTML using JSF 2.0 Facelets?

<ui:include> Most basic way is <ui:include>. The included content must be placed inside <ui:composition>. Kickoff example of the master page /page.xhtml: <!DOCTYPE html> <html lang=”en” xmlns=”http://www.w3.org/1999/xhtml” xmlns:f=”http://xmlns.jcp.org/jsf/core” xmlns:h=”http://xmlns.jcp.org/jsf/html” xmlns:ui=”http://xmlns.jcp.org/jsf/facelets”> <h:head> <title>Include demo</title> </h:head> <h:body> <h1>Master page</h1> <p>Master page blah blah lorem ipsum</p> <ui:include src=”/WEB-INF/include.xhtml” /> </h:body> </html> The include page /WEB-INF/include.xhtml (yes, this is the … Read more