We’ve recently noticed that XML in the blog posts has been displayed incorrectly. Specifically this has happened when the XML element contained a hyphon e.g.
<!-- Http Flex Session attribute and binding listener support --> <listener> </listener><listener -class>flex.messaging.HttpFlexSession</listener> <!-- MessageBroker Servlet --> <servlet> </servlet><servlet -name>MessageBrokerServlet</servlet> <display -name>MessageBrokerServlet</display> <servlet -class>flex.messaging.MessageBrokerServlet</servlet> <init -param> <param -name>services.configuration.file</param> <param -value>/WEB-INF/flex/services-config.xml</param> </init> <load -on-startup>1</load> <servlet -mapping> </servlet><servlet -name>MessageBrokerServlet</servlet> <url -pattern>/messagebroker/*</url> <welcome -file-list> </welcome><welcome -file>index.html</welcome> <welcome -file>index.htm</welcome> <welcome -file>index.jsp</welcome>
I first suspected that the problem was with the wp-syntax plugin that we use, or perhaps even with the GeSHi library used by the plugin. However, after reproducing the problem in a test environment, I realised that the issue was with our wordpress configuration. In Settings > Writing we had the “WordPress should correct invalidly nested XHTML automatically” option ticked and this was trying to correct XML that was perfectly balanced. You can see the option highlighted in red in the screenshot below.
I hope this proves useful to anyone else who has this problem in the future. We’ve gone through the old posts and corrected the XML where appropriate.

0 Comments on “Sorry about the XML”
Leave a Comment