Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 17 Jun 2008 11:36:41 -0700 (PDT),    group: microsoft.public.xsl        back       


confused by XSL   
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="1.0"?>
<?xml-stylesheet type="text/xsl" href="rowset2shipconf.xsl"?>
<xsql:query connection="ofgproducts"
           bind-params="order"
              tag-case="lower"
            xmlns:xsql="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     = c.order_no()
    and h.order_suffix = c.order_suffix()
    and h.tenant_id    = c.ff_schema()
    and h.src_doc_id = ?

  <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="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

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

 <xsl:template match="//row" xml:space="preserve">
  <item>
   <xsl:for-each select="*">
    <xsl:copy-of select="."/>
   </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.
---------------------------------------------------------------------------­-----
Invalid at the top level of the document.

<?xml version = '1.0'?>
date: Tue, 17 Jun 2008 11:36:41 -0700 (PDT)   author:   hmmmmm

Re: confused by XSL   
I found my problem.

I needed to have: tag-case="lower" in the no-rows-query as well.
date: Tue, 17 Jun 2008 13:08:08 -0700 (PDT)   author:   hmmmmm

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us