getting XML from tamino for transformation

I just tried to get an XML out of tamino in order to later transform it
via XSLT to html. First, to get the XML via query, I tried following

TaminoDataAdapter adapter = new TaminoDataAdapter(this.url, collection);
        adapter.Behavior = TaminoAdapterBehavior.ReadOnly;

TaminoDataAdapter adapter = new TaminoDataAdapter(this.url, collection);
        adapter.Behavior = TaminoAdapterBehavior.ReadOnly;

        DataSet ds = new DataSet();
        TaminoQuery tamQuery = new TaminoQuery("input()" + query);
        int count = adapter.Fill(ds, tamQuery);

        XmlDocument xdoc = new XmlDocument();

This fills a dataadapter, which contens is later returned as an XmlDocument.
So far, this is working. But the problem is, that the Xml-document
is not in its original form, it looks like this:

<Beschreibung>bla bla bla... </Beschreibung>

But, in order to parse it via XSLT, it should look like this:

<?xml version="1.0" encoding="utf-8"?>
<xq:Result .....>
<Beschreibung>bla bla bla... </Beschreibung>

So is there a way to get the XML out of tamino in a way it has the xq:Result tag in it?
I have also tried this:


TaminoQuery query = new TaminoQuery(queryString);
// DB-Verbindung definieren
TaminoConnection con = new TaminoConnection(url);
// Verbindung

Did you have a look at TaminoCommand.QueryReader/QueryStream?

Thanks for the answer, and sorry for my delay, I was a few days off development. Will try now, looks promising and I guess it is going to work!

So far, I’ve been experimenting around quite a bit, and tried to
build myself a method which should return an XpathDocument
for later transformation.

public XPathDocument GetXPathDocFromQuery(string collection, string queryString)
                TaminoQuery query = new TaminoQuery(queryString);
                TaminoConnection con = new TaminoConnection(this.url);
                TaminoCommand cmd = con.CreateCommand(collection);
                XmlReader reader = cmd.QueryReader(query);
                XPathDocument xpathDoc = new XPathDocument(reader);
                return xpathDoc;

And later the following transformation with the xpathDoc I get from the method above.

public string Dom_XSLT(XPathDocument xpathDoc, XslCompiledTransform xslt)
            StringWriter outWriter = new StringWriter();
            xslt.Transform(xpathDoc, null, outWriter);
            string outString = outWriter.ToString();
            return outString;
            // xslTransform.Transform(xpathDoc, null);

The returned string I use to output directly on a webpage. Still, I am
getting my XSLT from a file. Later, I want to store XSLT in Tamino too,
and get these files out there in a similiar way.
Fact is, that if I get BOTH the XML and XSLT from a file this way

string strXMLFile = Server.MapPath(@"XML\taxonomie.xml");
XPathDocument xpTaxonomie = new XPathDocument(strXMLFile);

The transformation works perfectly. It still does not work at all if I try
to get the XPathdocument out of the Database directly.
I still don’t have the slightest idea how to fix this…

I just want to get out parseable XML and XSLT files stored in tamino,
Does anybody who did this before have a clue? :?

It is possible that you may be better off inserting/retrieving complete XML documents. The following link should help with this. It is normally best if you assign a document name for your documents. You will also need to provide schemas for the documents too - unless you use the ino:etc collection (which is only recommended for test purposes).