DTD Definition

Hi! I’m a beginner user of Tamino Mobile DB. I’m trying to define this simple DTD:

<!DOCTYPE customer[


]>

but Tamino Mobile DB is returning this error:

“Internal error”

I’m using this java API sentence:

myBD.importDTD (strFileName);

Does anybody know the reason?

Thanks.

Hi,

the problem is the surrounding “”. This is only used in an implicit DTD directly declared in an XML file.

The DTD should only be




Then importDTD() works fine.

Best regards
Ralf

Thanks. That’s right. Now, my next question is: Which is the correct syntax of the xml files for that DTD?

Is this correct?

Miguel


In that case, why can’t I insert more than one customer?

Thanks.

That would be correct for the DTD. But I guess what you wanna do is something different:



Miguel


Ralf




The usage of Tamino Mobile DB is different from Tamino Server: A Document in Tamino Mobile Db is equivalent to a collection in Tamino Server, means instead of inserting documents in the Mobile DB you have to add a node to the document.

If you work with Tamino Mobile Studio there is a TaminoMobileAdapter which allows an insert the way you want to do it (similar to Tamino Server). Please refer to the documentation of Tamino Mobile Studio.

Best regards
Ralf

Ok, that’s what I’d like to do. But I don’t know how to implement this.

First question: How must I define the DTD document?




or





Second question: How must I write the XML file?


Miguel


or

<customer_list>

Miguel

<customer_list>

Third question: Which is the correct importXML syntax for inserting some xml customer’s files? This one?

BdXMLCursor myCursor = miDB.importXML (strFile, “customer_list”, true);


Thanks for all.

Hi,

1)




2)
<customer_list>

Miguel

<customer_list>

3)
Exactly. By this you create yor customer-list document. To insert customers you must create/append a node using the DOM API.

Best regards
Ralf

So, I can`t execute importXML() for two different xml files. Isn’t it?

For example:

customer1.xml customer2.xml
------------- -------------
<customer_list> <customer_list>

Miguel Paco

<customer_list> <customer_list>

For these files I can’t launch importXML() function twice. Is it Right?

myCursor = myDB.importXML (“customer1.xml”, “customer_list”, true);

myCursor = myDB.importXML (“customer2.xml”, “customer_list”, true);

I should do this by using the DOM API. Is it Right?

Thanks.

Right,

it would be sufficient that your initial document is just an empty customer list:



After that, you just work on the (persistent) DOM tree by inserting/deleting nodes.

Regards
Ralf

Ok. Thanks.