Storing and querying XML document

Hello!

I have two questions:

1. I have loaded an existing well-formed XML document without any schema through the Tamino Interactive Interface and apparently the load was successful. Then when I try to view that database in a browser, I don’t see any data…I get a blank page. Does that mean there is no data in the database? The follow-up question would be…how would you store these documents in Tamino?

2. After loading the document, I tried to query the database…again, I did it through the Tamino Interactive Interface…the root element of the document is ‘CodesDocument’, so I do a query of that element but it gives me the following error:

<?xml version="1.0" encoding="windows-1252" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“http://metalab.unc.edu/xql/”>
xql:query//CodesDocument</xql:query>
- <ino:message ino:returnvalue=“8811”>
<ino:messagetext ino:code=“INOXRE8811”>Collection name not found</ino:messagetext>
ino:messagelineCollection name = Ex1</ino:messageline>
</ino:message>
</ino:response>

Could someone please help me out with this?

Thank you very much in advance!

Syed

Hi,

quote:

1. I have loaded an existing well-formed XML document without any schema through the Tamino Interactive Interface and apparently the load was successful.

Documents without schema information are accepted by Tamino and stored in a special, always existant collection named ino:etc. So, queries for such stored documents have to be addressed similiar to this:

http://dbserver/tamino/dbname/ino:etc?_xql=rootelementname or in your case:

http://dbserver/tamino/dbname/ino:etc?_xql=CodesDocument

Of course you can apply all XPath / XQuery expressions to such documents.

quote:

Then when I try to view that database in a browser, I don’t see any data…I get a blank page.

What exactly do you mean by “view the database in a browser”? Are you doing this: http://dbserver/tamino/dbname ? This isn’t supposed to work, also I must say it would be the natural starting point for any DB brwoser functionality. Nice idea!

Best regards, Andreas

If you store an XML document with document element name CodesDocument in tamino without a schema then it goes into a collection called ino:etc in doctype CodesDocument which is created dynamically if it doesn’t exist already.

To find it you have to address the collection

http://yourhost/tamino/yourdb/ino:etc
with the query “CodesDocument” - then you should see it. You can do this with the interactive interface or just with IE5 like this

http://yourhost/tamino/yourdb/ino:etc?_xql=CodesDocument

A Tamino TSD2 schema specifies a collection name and a doctype, in this case “CodesDocument”.

My advice if you want to work with XML documents and don’t want to declare a schema for them, and there are a relatively small number of document types - declare a MINIMAL schema for each one using the same collection name. A minimal schema
declares the documentElement tag and the document can have any attributes or elements.

The easiest way to do this at the moment is to use the Tamino Dashboard that you can find to download in the JavaScript Discussion group.
You first create a new collection then add a minimal doctype.

Or create a document like this - which defines a collection “mycollection” and a doctype “CodesDocument” specifing any content and text indexes the entire document.
and use the TII to define the doctype.

<ino:collection xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” ino:name=“mycollection” ino:key=“id0000007383”>
- <ino:doctype ino:name=“CodesDocument” ino:key=“ID_CodesDocument” ino:options=“READ INSERT UPDATE DELETE” ino:structure-index=“CONDENSED”>
<ino:node ino:name=“CodesDocument” ino:key=“id0000007384” ino:obj-type=“ANY” ino:parent=“ID_CodesDocument” ino:search-type=“text” ino:map-type=“InfoField” ino:data-type=“WCHAR” />
</ino:doctype>
</ino:collection>

There is probably a way to do a minimal schema with the Tamino Schema Editor but I am not very familiar with it.

Thank you very much for the replies.

I have another question…have you tried bringing up Tamino Schema Editor and then setting a DB URL…when I try to do that, it says that the connection failed…any ideas as to what I may be doing wrong?

Thank you again in advance. I really appreciate it!

Syed

  1. Is the Database Started?
    2. Does the database exist?
    3. Did you use the correct format for the url ie http://hostname/tamino/dbname - where hostname is the name of the computer where Tamino is installed and dbname is the name of the database you are trying to connect to.

    Regards

    Daniel

Hello!

Thank you very much for the response.

The database was started and it does exist. And the URL seems correct too:

http://localhost/tamino/Statutes.

When I bring up the following URL in a browser:
http://localhost/tamino/Statutes?_diagnose=ping

I get an XML page saying the database is alive!

Any ideas why its not working through the Tamino Schema Editor???

Thank you very much again in advance!

Syed