Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


confused by XSL

From: hmmmmm <sdortch@----.--->
To: NULL
Date: 6/17/2008 11:37:00 AM
I have an .xsql page that references an .xsl template.  (both listed
below)  The problem comes when the query in the .xsql page has no
results and uses the no-rows-query.

At this point I get an error message (also listed below).  To me this
error message says there is a problem with the .xsl page.

If I remove the  xml-stylesheet from the XSQL page I get the expected
results for queries have results as well as queries that have no
results.

Any insight would be appreciated!

******************
XSQL page
******************
<?xml version=3D"1.0"?>
<?xml-stylesheet type=3D"text/xsl" href=3D"rowset2shipconf.xsl"?>
<xsql:query connection=3D"ofgproducts"
           bind-params=3D"order"
              tag-case=3D"lower"
            xmlns:xsql=3D"urn:oracle-xsql">

  select h.order_no
       , h.order_suffix
       , h.order_status
       , c.track
       , c.weight
       , c.freight
       , c.trx_date
  from clipper c
      , oehead  h
  where h.order_no     =3D c.order_no(+)
    and h.order_suffix =3D c.order_suffix(+)
    and h.tenant_id    =3D c.ff_schema(+)
    and h.src_doc_id =3D ?

  <xsql:no-rows-query>

    select '0' as order_no
         , '0' as order_suffix
         , 'Unknown' as order_status
         , 'No Information' as track
         , 0 as weight
         , 0 as freight
         , sysdate as trx_date
      from dual

  </xsql:no-rows-query>
</xsql:query>

******************
XSL page
******************
<?xml version=3D"1.0"?>
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
version=3D"1.0">

 <xsl:template match=3D"//rowset" xml:space=3D"preserve">
  <ship_confirmation client_id=3D"OFGPRODUCTS">
   <xsl:apply-templates/>
  </ship_confirmation>
 </xsl:template>

 <xsl:template match=3D"//row" xml:space=3D"preserve">
  <item>
   <xsl:for-each select=3D"*">
    <xsl:copy-of select=3D"."/>
   </xsl:for-each>
  </item>
 </xsl:template>

</xsl:stylesheet>

******************
Error Message
******************
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later.
---------------------------------------------------------------------------=
=AD-----
Invalid at the top level of the document.

<?xml version =3D '1.0'?>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent