<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I checked FAQ on dom.org -- no good
match.</FONT></DIV>
<DIV><FONT face=Arial size=2>
<P>Now, should I try to translate "&" to "&amp;" when creating the XML
document from SQL?</P></FONT><FONT face=Arial size=2></FONT></DIV>
<DIV><FONT face=Arial size=2>I'm using JDBC to get data from some
database. Often, I get the ampersand character in names from the
resultset and format into XML like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> <cps:RECORD
cps:RECORDCOUNT="1"><BR> <cps:orgnzn_name>B SCOTT
& WHITE TRUST</cps:orgnzn_name><BR>
<cps:cps_id>23087</cps:cps_id><BR>
</cps:RECORD><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>This output is from XMLOutputter </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT color=#000000 size=2>
<P><FONT face="Courier New"> String strText =
null;<BR> try {<BR> XMLOutputter outputter = new
XMLOutputter(" ", true);<BR> StringWriter writer = new
StringWriter();<BR> outputter.output (aDoc,
writer);<BR> <BR> writer.close();<BR> strText
= writer.toString();<BR> <BR> } catch
(java.io.IOException e) {<BR> ...<BR> } catch
(Exception e) {<BR> ...<BR> }<BR> return
strText;<BR></FONT></FONT></P>
<P><FONT face="Courier New"><FONT color=#000000 size=2></FONT></FONT> </P>
<P><FONT color=#000000 size=2>When I try to apply XSL template, I get error
because of the "&" character in <FONT face="Courier New">orgnzn_name in the
XML, actually it doesn't even translate because the engine thinks there's an
invalid whitespace.</FONT></FONT></P>
<P><FONT color=#000000 size=2><FONT face="Courier New">Suggestions
welcome.</FONT></FONT></P>
<P><FONT color=#000000 size=2><FONT
face="Courier New">Thanks!</FONT></P></FONT></DIV></FONT>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT
face=Arial size=2></FONT><BR><FONT face=Arial size=2>---<BR>Rob
Mitchell<BR></FONT><A href="mailto:rjmitchell@mediaone.net"><FONT face=Arial
size=2>rjmitchell@mediaone.net</FONT></A><BR><FONT face=Arial size=2>Base Class
Technologies, Inc.<BR>Designing and developing Java/Oracle solutions for the
Web</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR> </DIV></BODY></HTML>