On May 25, 2005, at 3:32 PM, Jochen Wiedmann wrote:
String Larson wrote:
<line1>Copyright © 2005 Foo</line>
That line is okay, as it is. However, the question is, whether it looks
the same internally. You provide too less information for a guess. For
example, it is unclear, what you are parsing: An input stream, a
reader,
a file, whatever. If it is an input stream: What is the character
encoding, and all the like.
Here is a fragment of the XML string I am passing as a parameter to the
RPC call
<template clientId="1">
<borderElement>
<copyright line1="Copyright &#169; 2005" line2="Images provided
by someone."/>
</borderElement>
</template>
This String was encoded using the following:
public String toXMLString() {
TransformerFactory tranFactory = TransformerFactory.newInstance();
Transformer aTransformer = null;
try {
aTransformer = tranFactory.newTransformer();
} catch (TransformerConfigurationException e) {
e.printStackTrace();
}
Source src = new DOMSource(getDoc());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Result dest = new StreamResult(baos);
try {
aTransformer.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
aTransformer.transform(src, dest);
} catch (TransformerException e1) {
e1.printStackTrace();
}
return baos.toString();
}
The String is added as a parameter to an XmlRpcClient.execute() call.
eg.
Vector params = new Vector();
params.add(ptd.toXMLString());
XmlRpcClient c = new XmlRpcClient();
c.execute("http://...", params);
This works fine in Win32 land, and is picked up fine by my XMLRPC
server running on OSX 10.3.9.
However, when the client is running on Linux, I get the invalid
character data exception.
Thanks.