Hi Dominik,
When I use the Tamino Interactive Interface using Internet Explorer and query for document that have the ampersand entity, the results show the & as an ampersand even though the document contains & So IE does convert because it styles the XML document using html.
When you use dbhandler.getDocument() what do you really mean? getDocument() gets the whole Tamino response object (if we are talking about TaminoAPI4J), and this is just a Document object. So my question is how do you know it gets converted, i.e. in what context do you see it converted. I think the conversion is correct. If I query Tamino using Tamino4J and then iterate the result set looking for particular elements (say Title elements), e.g,
TResponse tresp = tacc.query (query) ;
TXMLObjectIterator ti = tresp.getXMLObjectIterator() ;
while (ti.hasNext())
{
Element d = (Element)ti.next().getElement();
NodeList n = d.getElementsByTagName("Title");
for (int i = 0; i < n.getLength(); i++)
System.out.println (n.item(i).getFirstChild().getNodeValue());
}
then the resulting text elements that are printed out using the DOM method getNodeValue() will have the & converted to &. The DOM implementation does this. I must admit I cannot find anything concrete on this subject and no doubt there will be an article somewhere on this subject. But I think this is correct. If you have a string representation of an entity then what is the meaning of retaining the entity? It has no meaning in the context of the string and only has meaning in the context of the entire document.
Maybe one of the W3C experts may be able to give a more precise answer.
Kind regards,
Stuart Fyffe-Collins
Software AG (UK) Ltd.
#API-Management#webMethods#webMethods-Tamino-XML-Server-APIs