Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Monday, November 16, 2009

Why does XML not allow nested comments?

I hate the fact that XML doesn't allow nested comments! Since I have comments in almost every source file I write, and since I frequently want to disable portions of my code, I hit this problem a lot

I finally found out why they don't allow nested comments, or any "--" inside: the original SGML has some complicated rules about double-dashes and how they change the parsing inside a comment, and the XML spec mandates that XML docs are valid SGML, so it is more restrictive and says that XML cannot contain any double-dashes.

So, basically, I want to throttle whoever came up with this complication in SGML. Maybe the person to blame actually introduced this in a previous spec... but anyone who puts this kind of trickiness into a standard should be blacklisted from IT work permanently. Argh!

Tuesday, May 12, 2009

logging the XML payload with Axis, XFire

When using Axis to send data to a web service, you can set the logger level on org.apache.axis.transport.http.HTTPSender to DEBUG to see what's going out.

When using Xfire to receive data, you can set the logger level on org.apache.axis.transport.http.HTTPSender to DEBUG to see what's coming in.

Here's a sample in log4j.properties:


log4j.logger.org.apache.axis.transport.http.HTTPSender=DEBUG
log4j.logger.org.codehaus.xfire = DEBUG