Originally posted by Carl Parrish:
Can anyone tell me how to print the '&' (or & on a JSP page from a XML stream? Sorry I don't have access to the code right now but what I think they did was pull the string as text then marked it up in XML then used xslt to transform it on the JSP page and display it to print. Everything looks okay except they couldn't come up with a way to escape the '&' char. I've been looking on xml sites but can't seem to find this.
Unless I'm misunderstanding, you can 'escape' & as &. If you're printing out XML from a JSP page, you can use the <c ut> and <x ut> tags of JSTL (the JSP Standard Tag Library), which by default automatically escape XML metacharacters like '&' for you.