How do you define the stylesheet on Tamino to work with xml

Hi

I have installed Xslt server extension and uploaded the sample and it worked - that is after a long strugle - documentation is not always that clear :frowning:

I have existing xsl that I loaded on Tamino , but for some or other reason , they don’t work. I suspect that I am missing
a level in the node tree now.

When I previously did a query to Tamino the output document was like this :

<?xml version="1.0" encoding="iso-8859-1"?>
<ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“http://metalab.unc.edu/xql/”>
xql:query/Policy[PolicyNumber=“0”]</xql:query>
<ino:message ino:returnvalue=“0”>
ino:messagelineXQL Request processing</ino:messageline>
</ino:message>
xql:result

0
String
String


String
String


.
.
.

</xql:result>
<ino:message ino:returnvalue=“0”>
ino:messagelineXQL Request processed</ino:messageline>
</ino:message>
</ino:response>

So my Xsl was designed arround the above output :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform” xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“http://metalab.unc.edu/xql/”>
<xsl:template match="/">
<xsl:for-each select=“ino:response/xql:result”>
<xsl:for-each select=“Policy”>
<xsl:for-each select=“PolicyNumber”>

<xsl:attribute name=“type”>text</xsl:attribute>
<xsl:attribute name=“name”>txtPolicyNo<xsl:value-of select="$PolOcc"/></xsl:attribute>
<xsl:attribute name=“id”>txtPolicyNo<xsl:value-of select="$PolOcc"/></xsl:attribute>
<xsl:attribute name=“value”><xsl:value-of select="."/></xsl:attribute>

.
.
.

And this worked. Know my thinking is that this is wrapped in something different - therefore the reason that I get blank screens back.

My knowledge about xsl is not to great but I think the xml structure that I get back from a call like this :
<A HREF="http://ac5272/tamino/Commsure/Commsure?_xql=XSLT.transformFromCollection[Policy[Insurer=“To” TARGET=_blank>http://ac5272/tamino/Commsure/Commsure?_xql=XSLT.transformFromCollection(Policy[Insurer=“To enter”],‘ino:etc’,‘xsl:stylesheet[@ino:id=2]’)

is different from a call like this :

<A HREF="http://ac5272/tamino/Commsure/Commsure/Policy?_XQL=/Policy[Insurer=“To” TARGET=_blank>http://ac5272/tamino/Commsure/Commsure/Policy?_XQL=/Policy[Insurer=“To enter”]

Maybe I am going the wrong way and approaching this wrongly. The idea is to let Tamino with the stylesheet transform the xml document for me and not the browser on the client’s side. This way I can extract a the fields needed from the xml document via a stylesheet.

Thanks for the help in advance

Miklos Hagymassy

Hi,
I think because you’re in a server extension the xml response is not wrapped yet, so if you remove the…

<xsl:for-each select="ino:response/xql:result">

…section from your stylesheet it should work.

HTH

I did take it out and it is still not working. :eek:

Miklos Hagymassy

I have installed the passthru server and now I can make a call for example : "http://ac5272/examples/servlet/transform/tamino/Commsure/Commsure?_xql=/Policy&_xslsrc=http://Ac5272/tamino/Commsure/stylesheets/xsl:stylesheet/test.xsl"

and it works now. Oh yes to design the xsl for this type of query , your xml document is wrapped in “ino:response/xql:result”.

Thanks :smiley:

Miklos Hagymassy

Sorry - my fault. With the XSLT Server extension, the xml is wrapped as XSLT_input, so if you change your stylesheet like this it will work (I tested it this time!).

<xsl:for-each select="XSLT_input">
<xsl:for-each select="Policy">
<xsl:for-each select="PolicyNumber">
...


HTH

I have to confess that I’ve never used XSLT from server extensions myself, only from the Passthru servlet. But a tip that is generally useful is to start by doing an identity transform, that is:

<xsl:stylesheet …>
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

If this doesn’t work, then you can be pretty sure that it’s a system configuration problem and not a stylesheet problem. Conversely, if it does work, it will show you exactly what the source XML document looks like, so you can write a customised transformation for it.

Michael Kay
Software AG