Skip to main content

Posts

Showing posts from September, 2007

Test for spaces in text

When it comes to XSL you have to pay particular attention to the schema of the XML you are trying to make use of.  There are certain cases when you do not have control over the XML being produced that your XSL needs to be generic.

I am currently updating a Community Portal, which I developed in the past for my current company and have just discovered a silly human error.  Yes. I made a bad mistake.  The coding for this system assumed that there would be no spaces in a post code when trying to build a list of links.

The block was along the lines of:

<a target="_blank">
  <xsl:attribute name="href">
    <xsl:value-of select="@theLink" />
    <!-- Check length of string and attach post code with a space -->
  </xsl:attribute>
  <xsl:attribute name="title">
    <!-- Attach the title of the link for accessibility-->
  </xsl:attribute>
  <xsl:value-of select="@linkText" />
</a>

The block to atta…

ASP Reverse For Loop

It's kind of interesting of how reverse linking does not seem so obvious in classic ASP.  You would think that it would be along the lines of:

dim i
for i = 30 to 2
  'code comes here
next

but it's not.  To have a reverse For loop it's:

dim i
for i = 30 to 2 Step-1
  'code comes here
next

That's right that small bit (Step-1) makes all the difference.  I stumbled upon this by chance and thought that someone would benefit from this.

Happy coding.Blogged with Flock

Free Microsoft Development Tools

OK, it may not be Open Source.  But, as a follow up to Microsoft's success in providing Free .Net development tools for the Windows operating system, they are gearing up for the next version. Visual Studio 2008 Express Editions Beta 2.

This Beta release really wows you with the future of the development tools, which lets you develop for Windows, the Web, Games, Hardware and Databases.

Check it out at: http://msdn2.microsoft.com/express/future/
Blogged with Flock

CSS Horizontal Navigation

I know that I once stated that using UL to build a list of links was not desirable, but there are times when you have no choice.

It is fairly straightforward and you do not need any JavaScript to ruin your code.  So let's get started an define the menu and wrap it inside a DIV:

<divid="hovermenu">
<ul>
<li><ahref="#" href="Link Number 1">Link #1</a></li>
<li><ahref="#" href="Link Number 2">Link #2</a></li>
<li><ahref="#" href="Link Number 3">Link #3</a></li>
</ul>
</div>

Now for the CSS:

.hovermenu ul{
  font: bold 13px arial;
  padding-left: 0;
  margin-left: 0;
  height: 40px;
}

.hovermenu ul li{
  list-style: none;
  display: inline;
}

.hovermenu ul li a{
  padding: 2px 0.5em;
  padding:7px;
  text-decoration: none;
  float: left;
  color: black;
  background-color: #92b9ee;
  border: 2px solid #FFF2BF;
  height:40px; /* Make this match the U…

Liquid resizing page elements

Many times I am told that using tables to layout a web page is a sin.  But, when I try to resize a DIV, it's hard to get it to resize when the window has been resized.  Setting 100% does not seem to work.

So far we have the 3 column liquid layout, but it is not enough when the web pages (or applications for that matter) are more complicated.  When searching on the Internet to resize a DIV in response to a window resize, I am mostly presented with JavaScript solutions. Yeuch.

This is not very accessible for users of other browsers. Luckily, there is an undocumented feature of CSS that helps with this: table layout.

Firstly, create the element in the HTML:

<divid="pageBlock">Content comes in here...</div>

And then in the CSS we set our display:

#pageBlock {
display: table;
height:100%;
width: 100%;
table-layout: fixed;
}

Although this works with Firefox, it still likes to show a scrollbar for some reason, so you add the following to your CSS, to hide it:

body{
overflow: h…