Wednesday, April 29, 2009

Extra Characters in Concatenated XML String

I was attempting to concatenate two strings to form a new string. For some reason when I viewed the concatenated string there were extra characters between the concatenated values. The characters were tabs, carriage returns and spaces.

The value for the second part of the concatenated string was passed from a parent stylesheet to child template and then from child template to another child template. I am not quite sure why but some extra tabs and spaces got appended to the value as it was passed around. My xml file did not have any spaces or tabs around the value. I tried removing all the spaces and tabs around the with-param values and that didn't solve the problem either.

Well however those spaces got there I just wanted them to be gone so used the normalize-space XSL function which removed all the extraneous characters.

<xsl:value-of select="normalize-space(/little/suh-m/suh-m)"/>

Friday, April 24, 2009

Text Box With No Value in XSL

If you're trying to display a text box with no value using XSL and the text box is collapsing, causing your HTML to be parsed incorrectly by a browser, set your HTML output method in your XSL file to HTML as explained here:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

...

</xsl:stylesheet>

Comments in XSL to Show up in HTML

XSL tag to make XSL comments show up in HTML:

<xsl:comment>This is a comment</xsl:comment>

You may have to set output method = html in your xml file as well:

Output method = html

Tuesday, April 07, 2009

Login to CVS Remote via SSH

Login to CVS using SSH:

>set CVSROOT=:ssh:[user_name_here]@[server_here]:/[cvs_root_dir_here]
>cvs login
>CVS password:[enter password at the prompt]

Replace the items in brackets above with the appropriate information for your CVS server.

Thursday, April 02, 2009

java.net.BindException: Address already in use: JVM_Bind

After setting up SSL on a web server not running on a standard port I had to remind myself what was going on when I got this error:

java.net.BindException: Address already in use: JVM_Bind

Obviously two things were running on the same port. What I forgot was the default port was set to run on the same port I had set up SSL to run on. I commented out the default port in the configuration and now the web server only accepts SSL connections. (Which is what I wanted - I could have also set it up to accept http requests on one port and https requests on a different port).

This same error also happens when you have two applications configured to listen on the same port. For instance when running Tomcat, Apache and/or IIS on the same machine. They are HTTP web severs so typically all run on port 80 so have to configure them to run on different ports.

IE8 Change causes Form Element References to break

I had a problem with some web pages on a particular application after upgrading to IE 8. Referencing forms like this stopped working (but continued to work in Firefox).

document.forms[0].field_name
document.forms["formname"].field_name

After exploring what I thought was an IE 8 bug further I found that my HTML code was missing a "td" tag in one place. Apparently because the HTML code was not well-formed somehow that affected the JavaScript code and was not executed properly.

Most of my HTML code is well-formed due to use of my web publishing engine (BMetrix.com) which forces a certain level of compliance but this was a custom component designed outside of the system which ended up having this particular issue.