Problems with Entities in Tamino

Hello,

For a large Project a my university we have to store MathML-formulas in MathML into Tamino.

MathML makes heavy use of entities, and we have to get our MathML-Formulas back for editing afterwards.

Now I read, that Tamino translates entities while storing objects, or before executing queries, to speed up performance. Good thing, this, but I don’t see, how to get my XML-Source back out of the Tamino in iso-8859-1 with unparsed entities!

How can entities be parsed back?
Do I have to do this by Hand??

Btw. I didn’t figure out yet, how to store entities at all. I always get some “Unknown Entitiy” errors, and didn’t figure out, how to add entity information to your Schema-Definitions.

Could you please help me?

greets
Daniel Migowski

If you store a document with entities then those entities must be presented as part of the document so it can be parsed. The only way I know how to do this is with an inline DTD. The problem here is that the inline DTD is not returned when the document is retreived, and entities are not returned as unparsed entities.

hi daniel,

it seems that we bump in the same problem with entities. i have tried all sorts of stuffs (including external unparsed entities) but nothing works.

the fact that inline DTD is wiped out is the big bummer. i am currently trying to create a Java server X-Tension that would append the inline DTD in the beginning of the XML doc returned by Tamino but I am facing tons of problems with this solution.

regards

Please post such a document - if you don’t want to share the documents contents just cut out the text content. I’ll experiment with it and give you the result

I don’t know how you are reading the documents but if you use the getDocument() methods of the Tamino DOM APIs - you should get the document complete with prolog. getDocument() takes a URI as a parameter like this
http://localhost/tamino/mydb/mycoll/mydoctype/@inoid
or type this into the url line in IE5 and you can see the document complete with prolog. If you can’t see it you are not inserting it. :slight_smile:

_XQL requeries only give you node sets back - so the most you get is the document element - the prolog is discarded. The trick is as follows -
If the query for the documents of type is mydoctype is “q” -
query for “q/@ino:docname” instead.
the results looks like this


(the ino:docname is only there if you assigned one)
make up a url like the one above and use getDocument().

To save work if the TaminoClient URI base is the collection URL - which is nearly always the case the relative url “/mydoctype/@inoid” in the Java DOM API will do instead.

In the Jscript API it is “mydoctype/@inoid
I don’t know what the Active X API does.

Here is a sample doc with parsed internal entities:

code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE docTest [


]>

Meeting at &rs_hour;:&rs_minute;



I have successfully inserted it and when I retrieve it using your proposed URL (http://server/tamino/db/col/docTest/@1), I get this:

code:
Reference to undefined entity ‘rs_hour’. Line 2, Position 15

meaning that the DTD section is gone :eek:

NB. This behavior occurs under Tamino 2.2. I have tested the same document under 2.3 and now the entities are resolved (replaced with their values as defined in the DTD), which is unfortunate for the purpose we have.