Using parentheses in XML Node Attributes

I was having problems with left and right parentheses being inserted into my XML Attributes directly from the database. I found that I could solve the problem by substituting the appropriate XML entities, as follows:

LEFT PAREN <- &#040;
RIGHT PAREN <- &#041;

It was causing this error in my XSLT engine:

XSLT Error (javax.xml.transform.TransformerException): The reference to entity “P” must end with the ‘;’ delimiter.

fun.

Update

The above error was not caused by the parentheses, but rather by the ‘&P’ in the attribute. Changing it to ‘&P’ will fix the problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">