Loop by XSQL/XSL

Hello.
I got a problem in select from DB table.
Table format:
TYPE BOOKNAME
TypeThriller Vbm
TypeThriller Dhr
TypeThriller Abc
TypeThriller Cgf
TypeFantastic All
TypeFantastic Cdd
etc.
I need to create XML file like:
<Object>
<BookObject>
<BookType>TypeThriller</BookType>
<BookName>Vbm</BookName>
<BookName>Dhr</BookName>
<BookName>Abc</BookName>
<BookName>Cgf</BookName>
</BookObject>
<BookObject>
<BookType>TypeFantastic</BookTupe>
<BookName>All</BookName>
<BookName>Cdd</BookName>
</BookObject>
etc.
</Object>
The question is: is it possible to create by
combination XSQL/XSL?
If yes, did somebody can give me some example.
Thank's.

The last try!!!
I will really appreciate if somebody
can help me with my problem!
Thank's.
A.Z.

Similar Messages

  • Deploy JSP, XSQL-XSL Application on OC4J or Apache?

    I have an application having JSPs and XSQL-XSL pages (not EJBs)
    for the internet.
    Which is the best deployment type?
    - Running both on OC4J (after installing XSQL),
    - Running both on Apache,
    - Running one on Apache and other on OC4J?
    What about using Apache as a proxy sending requests to OC4J?
    Thanks.

    I deployed both on Apache (JSP,XSQL) and I have another PC with Apache as Proxy.
    It works fine. I dont know the performance when many users try to connect.

  • XSQL/XSL deployment on Tomcat question

    I have been running my XSQL pages within the default Oracle/Apache/JServ environment. This is where I 'install' my source xsql/xsl files in the htdocs directory of Apache.
    I have now recently upgraded my environment so that it now consists of Tomcat 4.x and Apache.
    My question is, what deployment strategies are available to me? For example, do I have package my xsql/xsl files into a .war package or can I simply move my xsql/xsl source files into a certain directory very similar to how I use to do before.
    Any help greatly appreciated.

    I deployed both on Apache (JSP,XSQL) and I have another PC with Apache as Proxy.
    It works fine. I dont know the performance when many users try to connect.

  • Generate XSQL from XSQL/XSL

    Hi all,
    is it possible to generate dynamically a temporary XSQL (many querys) with XSQL/XSL and ececute this immediately.
    Thanks for any help !!
    Achim

    No, but you can simplify your problem by doing the following:
    <!-- Base stylesheet base.xsl -->
    <xsl:stylesheet ...>
    <!-- All your templates go in here -->
    <xsl:template ...>
    </xsl:template>
    </xsl:stylesheet>
    <!-- Base with ISO-XXXX encoding -->
    <xsl:stylesheet ...>
    <!-- This imports the base -->
    <xsl:import href="base.xsl"/>
    <!-- And changes the output encoding to ISO-XXXX -->
    <xsl:output encoding="ISO-XXXX"/>
    </xsl:stylesheet>
    Repeat to handle other encodings.
    You still have multiple stylesheets,
    but only one place to worry about
    managing your templates.

  • How to import an XML element into a loop parameter is XSL

    Hi,
    We are using XSL template to generate output in a pdf format. The input in an XML file. In the XSL we have a loop. Currently the initial and final value of the loop counter is hardcoded in the xsl file.
    <xsl:call-template name="forloop">
         <xsl:with-param name="i">1</xsl:with-param>
         <xsl:with-param name="count">6</xsl:with-param>
    </xsl:call-template>
    Down below we are using
         <xsl:template name="forloop">
              <xsl:param name="i"/>
              <xsl:param name="count"/>
              <xsl:if test="$i &lt;=$count">
                   <fo:table-row>
                   <xsl:call-template name="forloop">
                        <xsl:with-param name="i">
                             <xsl:value-of select="$i + 1"/>
                        </xsl:with-param>
    etc, etc.
    Query :
    Currently the final value of the loop is hardcoded to 6. I want to set its value based of an element BAR_CODE_PRINT_NUM value (which can be either 0 or 6) of the XML File.
    <LIST_G_BAR_CODE_PRINT>
    <G_BAR_CODE_PRINT>
    <BAR_CODE_PRINT>Y</BAR_CODE_PRINT>
    <BAR_CODE_PRINT_NUM>6</BAR_CODE_PRINT_NUM>
    </G_BAR_CODE_PRINT>
    </LIST_G_BAR_CODE_PRINT>
    Can anyone please tell me how this is to be done. I have tried the following but it did not work.
    Approach 1 :
    <xsl:if test="LIST_G_BAR_CODE_PRINT/G_BAR_CODE_PRINT/BAR_CODE_PRINT_NUM &gt; 3">
         <xsl:with-param name="count">6</xsl:with-param>
    </xsl:if>
    <xsl:if test="LIST_G_BAR_CODE_PRINT/G_BAR_CODE_PRINT/BAR_CODE_PRINT_NUM &lt; 3">
         <xsl:with-param name="count">0</xsl:with-param>
    </xsl:if>
    Approach 2 :
    <xsl:with-param name="count"><xsl:value-of disable-output-escaping="no" select="LIST_G_BAR_CODE_PRINT/G_BAR_CODE_PRINT/BAR_CODE_PRINT_NUM"/>
    </xsl:with-param>
    Thanks

    I have managed to resolve it. It was a problem with the nesting of the attribute. The following worked
    <xsl:with-param name="count"><xsl:value-of disable-output-escaping="no" select="/NUMNEWJOBCARD/LIST_G_BAR_CODE_PRINT/G_BAR_CODE_PRINT/BAR_CODE_PRINT_NUM"/></xsl:with-param>
    Thanks

  • How does XSQL xsl namespace resolution work

    I don't believe I'm getting correct results
    from the xsql helloworld.xsql demo
    I get a result but it is not formatted.
    I think it has to do with:
    <xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql">
    Where does the URN get resolved and what does it resolve to? MS IE5 just shows a bunch of XML rather than a nicely formatted:
    "Hello World"
    which makes me believe that the XSL transform is not happening.

    Oh, so it is appropriate behavior... Thanks Steve
    I still need to better understand xmlns and what the
    xmlns:xsl="urn:oracle-xsql"
    does and how I can examine it and other namespaces (ie look at the source) and understand how to apply it and create my own URN (do I need to do this?). I'm not finding any real clear documentation on xmlns that serves as a tutorial (e.g. this urn "source" looks like this, and these statements do that, and when you specify this namespace, these things happen).
    Specifically, where does urn:oracle-xsql point? To a network resource? To a local file? To a resource that is "embedded" in XSLT? How do I examine and interpret that resource?

  • XSQL/XSL help (iPlanet): Error processing XSLT stylesheet

    hello-
    i am running XSQL and XSL pages on an iPlanet web server and i am receiving the following error:
    XSQL-011: Error processing XSLT stylesheet: /xslt/page/xsl_page.xsl
    XSL-1002: Error while processing include XSL file (\xslt\util\other_xsl.xsl (The system cannot find the path specified)).
    here's the deal: other_xsl.xsl (the one it says it can't find) is there in the right place, but the web server is not looking from the document root (which IS set correctly on the web server). it is looking for the file starting at the current directory.
    for example, the server is processing /xslt/page/xsl_page.xsl. it is then looking for the include file using this path: /xslt/page/XSLT/UTIL/other_xsl.xsl --- instead of the correct /xslt/util/other_xsl.xsl.
    the include statement uses the full path starting from the web root (<xsl:include href="/xslt/util/other_xsl.xsl"/>)
    any help would be appreciated.

    thanks for the response. the /xslt/util directory is browsable by the web server, and using relative paths does work (that is one of the ways i discovered what was going on in the first place), but i am rebuilding a machine and redeploying an exisiting application-- the intention is to not re-write any code.
    the part that is most confusing is that the current code/directory structure works on the current box, but not on my rebuilt box. i have gone through every config file with a fine tooth comb. it appears that the current box and my build are set up exactly the same-- but, like i said, on one it reads the include-path from the document root, on the other from the current directory.
    so confusing.

  • Can the return from xsql:ref-cursor-function be saved & looped through XSQL?

    If <xsql:ref-cursor-function> returns one field for a number of rows, is there a way to save those values and loop through the data retrieved for other query process within XSQL? Any example?
    Thanks.
    null

    You have a couple of options.
    You can process the XML returned by <Xsql:ref-cursor-function> as the normal part of XSLT processing, or you can write a custom action handler that aggregates the action handler for <xsql:ref-cursor-function> and then uses DOM to operate on the return value.
    Search the Online XSQL Pages Documentation for the term "MyIncludeXSQLHandler" for some sample code that illustrates building a customer action handler that aggregates one of the built-in handlers.

  • Documentation tool for xsql-xsl-xml ??

    Hi,
    can anybody tell me if there is a good tool for documenting XSQL / XML / XSL Projects ?
    Like JavaDoc or any XREF programms?
    Thank you
    Thomas
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Thomas Viohl ([email protected]):
    Hi,
    can anybody tell me if there is a good tool for documenting XSQL / XML / XSL Projects ?
    Like JavaDoc or any XREF programms?
    Thank you
    Thomas<HR></BLOCKQUOTE>
    I recommend you take a look to XML Spy http://www.xmlspy.com
    null

  • User auth. with HTML/XSQL/XSL

    I wonder if it makes sense to implement a login page in HTML and use xsql to verify the username/password pair against a DB and then set a cookie. Are there working examples around of how to pass form parameter into an xsql query ?
    Thanks

    Christian,
    You can get the HTML for the OPTION tag using the following in the XSL:
    <select name="KUNDE">
    <xsl:for-each select="page/ROWSET/ROW">
    <option value="{KND_ID}">
    <xsl:value-of select="KND_BEZ"/>
    </option>
    </xsl:for-each>
    </select>
    There is an XDK sample on using XSQL pages with Oracle9i available at http://otn.oracle.com/tech/xml/xdk_sample/EmployeeInformationSample.html
    If you download the JAR file of the sample you can get the sample XSQL and XSL files which could be of help.
    Hope that helps,
    Srinivas
    OTN Team

  • Bug XSQL  JDeveloper 10.1.3.2.

    A XSQL page does not transform a XSQL page output with an XSL stylesheet in JDeveloper 10.1.3.2.
    The XSQL/XSL transformation in the XSQL/JDeveloper article does not generate the required output.
    http://www.oracle.com/technology/pub/notes/vohra_xsql.html
    The following error gets generated:
    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. Error processing resource 'http://142.179.34.223:8988/XSQL-JWS-XSQL-context-root/...
    Oracle MagazineOracle PublishingNovember-December 2003Servlets and JSP Step UpBudi KurniawanOracle MagazineOracle Publishing...

    Hi,
    the connection is correct as ,if i remove the xsl am getting the valid xml output.It is something to do with href="OracleCatalog.xsl", i think it is not able to find it.If i gave the entire path like href="c:\.............\OracleCatalog.xsl" then it is giving blank page.what may be the reason.
    Thanks

  • 9.0.4: XSQL-003/XSQL-007

    My colleague is creating XSQL/XSL pages to return query results from an XML Schema in the DB. I have some JSPs that provide front-end UIs for these queries. We devoloped this in 9.0.3.3 and it worked fine. She sent the XSQL files and I included them into my project and called them from a JSP. Everything worked fine. I was forced to upgrade to 9.0.4 due to a bug and now when I call her XSQL files I get a connection not found error like follows:
    Oracle XSQL Servlet Page Processor 9.0.3.0.0 (Production)
    XSQL-004: Could not acquire a database connection named: iidev
    XSQL-007: Cannot acquire a database connection to process page.
    The connection iidev exists and I use it in the JSP that calls this xsql. I tried creating a new connection and a basic XSQL page like this:
    <?xml version="1.0" encoding='windows-1252'?>
    <page xmlns:xsql="urn:oracle-xsql" connection="TestConnection">
    </page>
    Which throws the same error.

    If you don't have an XSQLConfig.xml file, then XSQL won't work, so you must have one. :-)
    JDeveloper will include one in your classpath at runtime automatically. It also manages to keep your XSQLConfig.xml up to date with your IDE's connections. However, here's probably what's happening.
    You upgraded from 9.0.3 to 9.0.4
    In 9.0.3, each time you defined a new database connection in the JDeveloper IDE, JDeveloper fixed up your XSQLconfig.xml file to match, so that there was a corresponding entry in the XSQLConfig.xml file for each connection you defined in the IDE.
    When you migrate, even if you migrated all your settings, we don't migrate the XSQLConfig.xml file, so you're basically starting with a "fresh" one, which only has a "demo" connection defined for scott/tiger.
    What I'd recommend is to:
    1. Look at the top of your XSQL pages, and find the connection="XXXX" attribute in the file. It will be on the root element of the document.
    2. You probably have a connection named XXXX under your Jdeveloper connections node.
    3. Delete that "XXXX" connection in JDeveloper, and recreate a new "XXXX" connnection with the same information.
    Doing this, JDeveloper will add the newly created "XXXX" connection to your XSQLConfig.xml file.
    Then, it should work.

  • For-loop in XSLT-Important

    All,
    version:11.1.1.4
    I have a requirement in the for-loop which has to iterate for a fixed loop. For instance: I want the for-loop to iterate only for 5 times, how should I define the for-loop?  Any idea, please share your thoughts.
    <xsl:for-each select="5">
    </xsl:for-each>
    I tried the above code, didn't work!.
    Rgds
    sen

    You can use templates in xslt like one below :-  Assign max - 5 and this will loop for 5 times.
    <xsl:template name="loop">
      <!--recursive loop until done-->
      <xsl:param name="i"/>
      <xsl:param name="max"/>
      <xsl:if test="$i &lt;= $max">
        <!-- Repeated content Here -->
        <!-- use value-of i to get loop index -->
        <xsl:value-of select="$i"/>.<br/>
          <xsl:call-template name="loop">
            <xsl:with-param name="i" select="$i + 1"/>
            <xsl:with-param name="max" select="$max"/>
          </xsl:call-template>
      </xsl:if>
    </xsl:template>
    <xsl:call-template name="loop">
      <xsl:with-param name="i" select="number(1)"/>
      <xsl:with-param name="max" select="number(5)"/>
    </xsl:call-template>
    Or you can also do while loop like one below:-
    <!-- recursive named template -->
    <xsl:template name="while">
    <xsl:variable name="VALUE">
    <!-- your evaluation -->
    </xsl:variable>
    <!-- evaluate and recurse -->
    <xsl:if test="$VALUE=0">
       <xsl:call-template name="while"/>
    </xsl:if>
    </xsl:template>

  • XSQL/FOP to PDF

    I am trying to generate a pdf using FOP within XSQL/XSL. The XSQL runs fine and the stylesheet appears to run fine with the exception that there is no pdf opened or saved (that I can see). Does the pdf get saved somewhere? Or should it open within adobe? Below is my code.
    XSQL page:
    <?xml version="1.0" encoding='windows-1252'?>
    <?xml-stylesheet type="text/xsl" serializer="FOP" href="ExecutiveSummaryReport.xsl" ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="gladwhse">
    <xsql:query tag-case="lower">
    select
    last_name,
    first_name,
    sex_code
    from
    tbl_mpi_269
    where
    med_rec_no = '000002128700'
    </xsql:query>
    </page>
    Stylesheet:
    <?xml version='1.0' ?>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!--defines the layout master-->
    <fo:layout-master-set>
    <fo:simple-page-master master-name="first"
    page-height="29.7cm"
    page-width="21cm"
    margin-top="1cm"
    margin-bottom="2cm"
    margin-left="2.5cm"
    margin-right="2.5cm">
    <fo:region-body margin-top="3cm"/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <!-- Start actual layout-->
    <fo:page-sequence master-name="first">
    <fo:flow flow-name="xsl-region-body">
    <fo:block font-size="24pt" font-family="Garamond" line-height="24pt"
    space-after.optimum="3pt" font-weight="bold" start-indent="15pt">
    Executive Summary - FHA Compliance to 24 hour standard
    </fo:block>
    <!--Table with the section, units and percent-->
    <fo:block border-width="2pt">
    <fo:table>
    <fo:table-column column-width="4cm"/>
    <fo:table-column column-width="4cm"/>
    <fo:table-column column-width="4cm"/>
    <fo:table-body font-size="10pt" font-family="sans-serif">
    <xsl:for-each select="/page/rowset/row">
    <fo:table-row line-height="10pt">
    <fo:table-cell>
    <fo:block><xsl:value-of select="first_name"/></fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block><xsl:value-of select="last_name"/></fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block><xsl:value-of select="sex_code"/></fo:block>
    </fo:table-cell>
    </fo:table-row>
    </xsl:for-each>
    </fo:table-body>
    </fo:table>
    </fo:block>
    </fo:flow>
    </fo:page-sequence>
    </fo:root>

    PDF output from XSQL page is explained in XSQL tutorial.
    Support for Apache FOP 0.20.3
    http://otn.oracle.com/tech/xml/xdk/doc/production10g/doc/java/xsql/xsql_userguide.html

  • How to programm loops using XSLT

    Hi,
    could anybody give me an short example of xslt code for the following problem.
    Now i have something like that in my xslt file:
    <TimeInterval value="{./TIMEMWH1}"/>
    <TimeInterval value="{./TIMEMWH2}"/>
    how can i put this into a loop and change just the sequence in
    {./TIMEMWH...} to repeate the insert e.g. 100 times.
    So, how can i programm loops in xslt and how can i implement a counter.
    Thanks
    Mario

    Here is another example from Doug Tidwell's book "XSLT" from O'REILLY.
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text"/>
    <xsl:variable name="newline">
    <xsl:text>
    </xsl:text>
    </xsl:variable>
    <xsl:template name="for-loop">
    <xsl:param name="i" select="1"/>
    <xsl:param name="increment" select="1"/>
    <xsl:param name="operator" select="="/>
    <xsl:param name="testValue" select="1"/>
    <xsl:param name="iteration" select="1"/>
    <xsl:variable name="testPassed">
    <xsl:choose>
    <xsl:when test="starts-with($operator, '!=')">
    <xsl:if test="$i != $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:when test="starts-with($operator, '&lt;=')">
    <xsl:if test="$i &lt;= $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:when test="starts-with($operator, '&gt;=')">
    <xsl:if test="$i &gt;= $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:when test="starts-with($operator, '=')">
    <xsl:if test="$i = $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:when test="starts-with($operator, '&lt;')">
    <xsl:if test="$i &lt; $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:when test="starts-with($operator, '&gt;')">
    <xsl:if test="$i &gt; $testValue">
    <xsl:text>true</xsl:text>
    </xsl:if>
    </xsl:when>
    <xsl:otherwise>
    <xsl:message terminate="yes">
    <xsl:text>Sorry, the for-loop emulator only </xsl:text>
    <xsl:text>handles six operators </xsl:text>
    <xsl:value-of select="$newline"/>
    <xsl:text>(&lt; | &gt; | = | &lt;= | &gt;= | !=). </xsl:text>
    <xsl:text>The value </xsl:text>
    <xsl:value-of select="$operator"/>
    <xsl:text> is not allowed.</xsl:text>
    <xsl:value-of select="$newline"/>
    </xsl:message>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:if test="$testPassed='true'">
    <!-- Put your logic here, whatever it might be. For the purpose -->
    <!-- of our example, we'll just write some text to the output stream. -->
    <xsl:text>Iteration </xsl:text><xsl:value-of select="$iteration"/>
    <xsl:text>: i=</xsl:text>
    <xsl:value-of select="$i"/><xsl:value-of select="$newline"/>
    <!-- Your logic should end here; don't change the rest of this -->
    <!-- template! -->
    <!-- Now for the important part: we increment the index variable and -->
    <!-- loop. Notice that we're passing the incremented value, not -->
    <!-- changing the variable itself. -->
    <xsl:call-template name="for-loop">
    <xsl:with-param name="i" select="$i + $increment"/>
    <xsl:with-param name="increment" select="$increment"/>
    <xsl:with-param name="operator" select="$operator"/>
    <xsl:with-param name="testValue" select="$testValue"/>
    <xsl:with-param name="iteration" select="$iteration + 1"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    <xsl:template match="/">
    <xsl:call-template name="for-loop">
    <xsl:with-param name="i" select="'10'"/>
    <xsl:with-param name="increment" select="'-2'"/>
    <xsl:with-param name="operator" select="'&gt;'"/>
    <xsl:with-param name="testValue" select="'0'"/>
    </xsl:call-template>
    </xsl:template>
    </xsl:stylesheet>

Maybe you are looking for

  • Calculation using multiple select statements - APEX 4.0

    Hello, I am new to APEX, PL/SQL and have some SQL knowledge, but I pick up things quickly. I want to make a page item equal to the value of a Select statement minus another Select statement. The statements pull from the same tables and only differ sl

  • How to get Object key name

    var obj:Object = {a:"foo", b:"bar"} obj.a // foo keya=a value='foo' obj.b // bar keya=b value="bar" for each (var value:Object in obj){ trace(value); Q: How can I get key from obj liking hash?

  • B&W G3 gets Black Rectangle on Boot - Hangs

    My B&W G3 will not boot OS X 10.4 anymore. It worked fine before. Now when it boots I get the Apple logo then I get a solid black rectangle in the middle of the screen and it hanges. I put the 10.4 DVD in the drive and pressed C on boot. It starts to

  • Bapi BAPI_PO_CREATE1 . Service po upload with contract reference.

    Hi Experts, I created an abap program for uploading service po using BAPI  'BAPI_PO_CREATE1'. Its working fine without Contract reference. But if I include contract reference in the item it will return error 'Service SERVICE 1234: please enter a pric

  • List services as colums

    hi i'm using this code from this forum https://social.technet.microsoft.com/Forums/windowsserver/en-US/75b3dcde-af1e-4d87-9eff-ce923b090ef8/get-services-from-remote-computers $array = @()             foreach($i in (gc c:\computers.txt)) {