Pass thru the Tamino Filter without transformation

Hi,

I used Pass thru Servlet version 4.1.1.1.

And I have a collection which stores “DataFromVendor” XML documents. The Tamino Schema is attached in this message.

I want to transform the “DataFromVendor” objects into some HTML formats using an XSL document which is also attached in this message.

When I tried to type the URL like this one:
http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql=/DataFromVendor&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl

The result is that it just displays the titles of the HTML table without any values from the XML objects…(This is NOT my willing.)

And the log in Tomcat is:
Servlet Info:
Method :GET
Pathinfo :/tamino/governmentJobDB/dataFromVendor_collection
QueryString:_xql=/DataFromVendor&_xslsrc=http://localhost/server1/hr_xml/temp/ap
plicantSummary.xsl
Server name:localhost:80
xmlSrc :null
Headers :
connection:Keep-Alive
accept-encoding:gzip, deflate
accept:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicat
ion/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, /
content-length:0
accept-language:en-us
user-agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)
host:localhost
Start with xslstr: http://localhost/server1/hr_xml/temp/applicantSummary.xsl
Start with xmlstr: HTTP://localhost:80/tamino/governmentJobDB/dataFromVendor_col
lection?_xql=%2FDataFromVendor
Getting stylesheet from cache: http://localhost/server1/hr_xml/temp/applicantSum
mary.xsl
Transformation completed OK



Then, I tried to type the following URL:
http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql=/DataFromVendor[@ino:id=1]&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl

The result is that it only displays the XML document without any transformation…

And the log in the Tomcat is:
Servlet Info:
Method :GET
Pathinfo :/tamino/governmentJobDB/dataFromVendor_collection
QueryString:_xql=/DataFromVendor[@ino:id=1]&_xslsrc=http://localhost/server1/hr_
xml/temp/applicantSummary.xsl
Server name:localhost:80
xmlSrc :null
Headers :
connection:Keep-Alive
accept-encoding:gzip, deflate
accept:image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicat
ion/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, /
content-length:0
accept-language:en-us
user-agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0)
host:localhost
Pass thru the Tamino Filter without transformation



Can anyone tell me how I can tranform the XML document into my desired format described in the XSL attached?

Thanks a lot.

Andy Ho
reference.zip (4.76 KB)

Hi,

The passthru servlet works by running a query and passing the entire query result to the stylesheet processor. So the root element of the xml is not your document root, but ino:response, and inside that ino:message and xql:result.

So you should include in your stylesheet something like this:

<xsl:template match="/">
  <xsl:apply-templates select="ino:response/xql:result"/>
</xsl:template>

<xsl:template match="DataFromVendor">
....



HTH

…and here’s a small cut-down example that works for me. I forgot to mention that you need to define the namespaces ino: and xql: in your stylesheet before you can refer to them, but the example also shows you how…

HTH
applicantSummary.xsl (1.02 KB)

Hi, Bill

I tried out your suggested solution and I successfully got the transformation.

However, it only works for a list of XML instances. For example, when I type the following URL:

http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql=/DataFromVendor&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl&xslt_HKID=A123456(7)

The pass thru Servlet transformed the list of XML instances “DataFromVendor” into HTML tables. And when it exactly matches with the HKID parameter, the specified “Applicant” will be also displayed in the HTML table.


But what exactly I wanted is to only show out one instance of “DataFromVendor” in the desired HTML tables… just like this URL:

<A HREF=“http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql=/DataFromVendor[@ino:id=“1”]&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl&xslt_HKID=A123456[7” TARGET=_blank>http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql=/DataFromVendor[@ino:id=“1”]&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl&xslt_HKID=A123456(7</A>)

Unfortunately, the pass thru Servlet just gave out the XML document without any transformation…

Can you give me some solutions? Thanks a lot. I attached the Tamino Schema and the modified XSL in this message.

Best Regards,
Andy Ho
ref2.zip (5.01 KB)

Hi Andy,

I think this is the same problem that Stuart reported here.

I’m not sure if Stuart found a reason, but I can reproduce the problem and the bypass seems to be to escape the “=” sign in the expression “_XQL=” with %3D.

So if you change your URL to
<A HREF=“http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql%3D/DataFromVendor[@ino:id=“1”]&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl&xslt_HKID=A123456[7” TARGET=_blank>http://localhost/examples/servlet/transform/tamino/governmentJobDB/dataFromVendor_collection?_xql%3D/DataFromVendor[@ino:id=“1”]&_xslsrc=http://localhost/server1/hr_xml/temp/applicantSummary.xsl&xslt_HKID=A123456(7</A>)

…does it work?

Surely it’s the “=” within the query predicate that should be escaped, not the one immediately after _xql?

The rules for URLs suggest that any “=” sign within a query parameter should be escaped as %3D. However, some products seem to be more tolerant than others, some will happily accept a URL query parameter of the form a=b=c as meaning that parameter “a” has the value “b=c”, but others throw it out or process it incorrectly. I haven’t got to the bottom of this, but it is clear that officially (according to RFC2396) special characters such as “=” (and “[” and “]”, for that matter) should be escaped, and if you get away without escaping it, then the web server is just being kind to you.

Michael Kay

You’re right, so a more correct recommendation might be to code %5B%40ino%3Aid%3D1%5D
instead of [@ino:id=1]

Thanks.

[This message was edited by Bill Leeney on 13 Dec 2002 at 14:24.]

I noticed the exact same problem using Xalan and Xerces with JDK 1.3.1.
Replacing = signs in URL solved the issue indeed.

Interesting thing is that problem does NOT occur using same config with jdk1.4 (seems 1.4 has Xalan included)

Hi List,

I think the “root” problem is this:

inside TaminoFilter.doGet() method an encodeURL invoketion is needed before processing and all problems are solved.

This problem doesn’t arise in old passthru servlet.

:cool:

tnx
Michelangelo


Michelangelo Serpico
Software AG

+39 02950011.1
+39 3488205068
michelangelo.serpico@softwareag.com