XSLT Processor Bug? format-number() on large numbers

For numbers 100,000,000.00 and higher, I'm getting extra digits and rounding errors.
How can I use some custom Java code in the XSL stylesheet so the correct value is displayed (i.e. w/o rounding)? I'm getting a value of 100000000.00 and I need to insert the commas. Sometimes the correct value is displayed, other times, additional numbers are appended and the amount is rounded.

The XSLT processor uses java.text.DecimalFormat under the covers as the XSLT 1.0 specification suggests. I would imagine any problems with format-number() actually boil down to problems with java.text.DecimalFormat.
You can use Java Extension functions to perform custom Java in your stylesheet.
See the file .\extfunc.html in the root directory of the XML Parser for Java V2
distribution.

Similar Messages

  • How can I format a cell in Numbers to have leading zeros in a number?

    I imported a spreadsheet from Excel (Office 2014, Win 7) through iCloud and some numbers were formatted to have leading zeros (012358) in the original Excel file but the leading zero format was lost in Numbers.  Is there a way to format cells to have a number displayed with the leading zero in Numbers?  The leading zero is part of an identification and is important to the numbers (0027 is not the same as 27 in these records).
    thanks,
    Bob

    James has the formating part, but if you already did the import you can use the following formula to replace the zeros that were leading if you know it is a four digit reference number....
    =right("000" & A2,4)
    copy those values into your text formatted column from James' answer and you got it.
    Jason

  • Is the XSLT format-number function supported by XMLType.transform()

    I am trying to use the XSLT format-number function in a stylesheet via myXMLType.transform(myXSL) without any luck. For example, <xsl:value-of select="format-number($myNum,'#,###.00')/>. This works ok under the java based XSLT engine.
    Is format-number supported by XML DB?
    I am running 9.2.0.5.
    Cheers
    Anthony

    I have upgraded to 10g and found that this now works.
    Cheers
    Anthony

  • XSLT transformation format-number into strange characters

    Hi, Experts,
        When I excute following code to translate a string number DEBIT TYPE C(60) into xml, the result has strange characters.
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
        If DEBIT is empty, the correct result should be:
    0x3000 0x2E00 (0x3000)*10       = 0.0000000000
        but actually, the result will be following in some cases:
    0x3000 0x2E00 (0x0F77)*10
        in some cases the result will be
    0x3000 0x2E00 (0x2600 0x2300 0x3000 0x3B00)*10
        What I mean in some cases, I ran the same code on different NW system. I also changed the user profile by NW menu System->User Profile->Own Data, the result won't change whether I use American Comma-Dot or European Dot-Comma.
        Can anyone give some advice on the code? Or there is some patch to solve it?
        Thanks and Regards
    Davin
    Edited by: Davin Wang on Jul 17, 2008 3:15 PM

    Hi Davin,
    do chk the condition it is not correct
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
    do chk it
    Thanx
    Sampath

  • One or two XSLT/XPath bugs

    I have an XSLT problem that may actually be two problems. My stylesheet works as expected in MSXML and Xalan but does very weird things in Oracle's XSLT processor. Below is the stylesheet, followed by some test input. It looks like just one bug if you run it on this test input (the "extra rows" generated get numbered 10-14 rather than 20-24, but $count and $remainder seem to have the right values). If you delete all COWS after SEQNUM 13, however, then $count and $remainder are both wrong. So it may be one bug, may be two.
    XSLT:
    ====================================================
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <!-- output a CHICKENROW for each CHICKEN in the source document, and guarantee there's a positive multiple of 8 rows total -->
         <xsl:template match="/">
              <CHICKENROWS>
                   <xsl:for-each select="/COWS/COW[KEY1 = '1']">
                        <CHICKENROW seqnum="{SEQNUM}">
                             <xsl:value-of select="CHICKEN"/>
                        </CHICKENROW>
                   </xsl:for-each>
                   <xsl:variable name="count" select="count(/COWS/COW[KEY1 = '1'])"/>
                   <!-- uncomment this for debugging
                   <count><xsl:value-of select="$count"/></count>
                   -->
                   <xsl:variable name="remainder" select="$count mod 8"/>
                   <!-- uncomment this for debugging
                   <remainder><xsl:value-of select="$remainder"/></remainder>
                   -->
                   <!-- if we have fewer than a positive multiple of 8 rows, add empty rows -->
                   <xsl:if test="$count = 0 or $remainder &gt; 0">
                        <xsl:variable name="startSeqnum">
                             <xsl:choose>
                                  <xsl:when test="/COWS/COW[KEY1 = '1']/SEQNUM">
                                       <xsl:for-each select="/COWS/COW[KEY1 = '1']/SEQNUM">
                                            <xsl:if test="not(/COWS/COW[KEY1 = '1' and SEQNUM &gt; current()])">
                                                 <xsl:value-of select=". + 1"/>
                                            </xsl:if>
                                       </xsl:for-each>
                                  </xsl:when>
                                  <xsl:otherwise>
                                       <xsl:text>1</xsl:text>
                                  </xsl:otherwise>
                             </xsl:choose>
                        </xsl:variable>
                        <!-- insert as many empty rows as necessary to guarantee we have at least 8 rows and the total # of rows is a multiple of 8 -->
                        <xsl:call-template name="emptyRows">
                             <xsl:with-param name="seqnum" select="$startSeqnum"/>
                             <xsl:with-param name="endSeqnum" select="$startSeqnum + (8 - $remainder) - 1"/>
                        </xsl:call-template>
                   </xsl:if>
              </CHICKENROWS>
         </xsl:template>
         <!--
              Recursively insert empty rows with seqnums starting at $seqnum and going to $endSeqnum
         -->
         <xsl:template name="emptyRows">
              <xsl:param name="seqnum"/>
              <xsl:param name="endSeqnum"/>
              <xsl:if test="$seqnum &lt;= $endSeqnum">
                   <CHICKENROW seqnum= "{$seqnum}"></CHICKENROW>
                   <xsl:call-template name="emptyRows">
                        <xsl:with-param name="seqnum" select="$seqnum + 1"/>
                        <xsl:with-param name="endSeqnum" select="$endSeqnum"/>
                   </xsl:call-template>
              </xsl:if>
         </xsl:template>
    </xsl:stylesheet>
    =======================================================
    INPUT XML:
    =======================================================
    <COWS>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>1</SEQNUM>
              <CHICKEN>ACMI2</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>2</SEQNUM>
              <CHICKEN>ALTE</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>3</SEQNUM>
              <CHICKEN>ANRO2</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>4</SEQNUM>
              <CHICKEN>ARCO5</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>5</SEQNUM>
              <CHICKEN>ARFR4</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>6</SEQNUM>
              <CHICKEN>ARTRV</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>7</SEQNUM>
              <CHICKEN>ASMO7</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>8</SEQNUM>
              <CHICKEN>CAGE2</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>9</SEQNUM>
              <CHICKEN>COUM</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>10</SEQNUM>
              <CHICKEN>ERIOG</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>11</SEQNUM>
              <CHICKEN>FEID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>12</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>13</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>14</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>15</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>16</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>17</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>18</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
         <COW>
              <KEY1>1</KEY1>
              <SEQNUM>19</SEQNUM>
              <CHICKEN>LEPID</CHICKEN>
         </COW>
    </COWS>

    ... or maybe they're not bugs at all, but if they're not, they're at least a difference in implementation from MSXML and Xalan. Do I misunderstand the XPath/XSL I'm using here? Is Oracle's interpretation equally valid?

  • ETEXT output truncating/rounding large numbers

    I have an eTEXT template that includes the definition:
    <FORMAT>     <DATA>
    NUMBER BankAccount/BankAccountNumber
    When a large number is encountered the output appears truncated/rounded. For example; the account number 444470301880513641 is output as 444470301880513660.
    Data:
    <BankAccountNumber>444470301880513641</BankAccountNumber>
    Output:
    ...#444470301880513660#....
    Other than convert the FORMAT to an Alpha are there any known tips or tricks to correct this scenario?
    Regards
    Edited by: bdansie on 10-Jan-2012 17:44

    Hi Tom, Thanks for the reply. I am reading a hex value in from a serial port. the number is large and when i format it as hex on one chan it is off by a small amount. there is some rounding in the LSD. i then take another reading later and calculate the delta. since i dont have the right values to begin with my difference calculation is wrong. when i read as bytes through 8 channels, i can see the ascii for each digit and that they are correctly displayed. using a formula module i can convert from ascii to decimal so that i get the decimal equivalent of the hex character then in the next formula i do the math to find the value of each hex digit in place it holds. then using a sum arithmetic module i get the final value of the large number coming in. it is correct all the way upto the aritmetic sum. i tried cutting the large hex number into two parts and then adding up the weighted parts and still have the wrong ans in the display module. i also tried dividing the halves by 1000 prior to adding them so that i was working with smaller numbers in the summation but that didnt help.
    so i did the math directly in the extended portion of the variables. the numbers add up properly there but when i try to bring the correct sum back into the work sheet to display it, it is wrong again. it seems that a value around 04000000 hex is the limit. below that i get the right value displayed that was calculated in the variable field, above it there is some degree of variation. I can set the limit of cycles to a value below where the addition becomes problematic or i can export the hex to a spreadsheet, do the math there and then bring it back in but i will still have the same issue displaying the answer.
    the limitation doesnt seem to be in DASYLab in general but in the Read, Formula, Constant Generator modules that read the variable back into the worksheet. it is displayed properly in the contents window

  • Error adding large numbers

    I am adding large numbers and getting the wrong result. there seems to be some rounding taking place in the sum but i am adding integers. I am using DASYLab 9.02, data is summed in the arithmetic module, example problem 331153408-31570 = 331121838 but the output is 331121824. I tried making the variable where the inputs are stored 20 digit with 10 decimals but that did not help and i also tried dividing first by 1000 and 10000 only to get different answers. is there a setting that needs to be configured differently?

    Hi Tom, Thanks for the reply. I am reading a hex value in from a serial port. the number is large and when i format it as hex on one chan it is off by a small amount. there is some rounding in the LSD. i then take another reading later and calculate the delta. since i dont have the right values to begin with my difference calculation is wrong. when i read as bytes through 8 channels, i can see the ascii for each digit and that they are correctly displayed. using a formula module i can convert from ascii to decimal so that i get the decimal equivalent of the hex character then in the next formula i do the math to find the value of each hex digit in place it holds. then using a sum arithmetic module i get the final value of the large number coming in. it is correct all the way upto the aritmetic sum. i tried cutting the large hex number into two parts and then adding up the weighted parts and still have the wrong ans in the display module. i also tried dividing the halves by 1000 prior to adding them so that i was working with smaller numbers in the summation but that didnt help.
    so i did the math directly in the extended portion of the variables. the numbers add up properly there but when i try to bring the correct sum back into the work sheet to display it, it is wrong again. it seems that a value around 04000000 hex is the limit. below that i get the right value displayed that was calculated in the variable field, above it there is some degree of variation. I can set the limit of cycles to a value below where the addition becomes problematic or i can export the hex to a spreadsheet, do the math there and then bring it back in but i will still have the same issue displaying the answer.
    the limitation doesnt seem to be in DASYLab in general but in the Read, Formula, Constant Generator modules that read the variable back into the worksheet. it is displayed properly in the contents window

  • Large Numbers in Table

    I am doing a project where I have to put large numbers in a table. It keeps putting the numbers into scientific notation. How do I stop this?

    Click in the cells and change the Cell > Data Format > to Number not Scientific or Automatic
    Peter

  • How can I make my XSLT processor accept html code ?

    In my applications the Oracle xslt processor wont accept simple HTML tags within an XML source while transforming the source into HTML. Both processors either will throw parser exceptions or ignore the HTML code in the XML source completely, though output-escaping is explicitly enabled.
    In detail, I want to transform an XML source like this...
    <element>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </element>
    ... with an XSL Stylesheet like this...
    <xsl:stylesheet>
    <xsl:output method=html cdata-sections=element/>
    <xsl:template match=element>
    <html>
    <body>
    <xsl:value-of select=. output-escaping=yes/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    ... which should result in a HTML code like this ...
    <html>
    <body>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </body>
    </html>
    The result, however, is always like this:
    <html>
    <body>
    Hello, this is a XML text source mingled with htmlTM
    </body>
    </html>
    This means that the additional HTML tags inside the XML source have been completely ignored by the XSLT processor though I enabled the output-escaping.
    If anybody should think now that mingling HTML with XML text is stupid because I could also format the result with the XSL Stylesheet itself, he might be right, of course, but: I cant avoid this because in my application the XML source results from a users web form entry. The user working with the form must be able to decide whether he wants to include HTML in his text or not. In any case, any HTML code he enters should just be transported WITHOUT ANY CHANGES to the resulting HTML page, not omitted without comments! It seems quite simple to me, but the XSLT processor doesnt want to agree with me in this point :-(
    So, once again in brief: Is there any possibility to tell my XSLT processor not to parse, transform or manipulate HTML tags, but to transport them unchanged to the output ?
    After weeks of research any helping sign would be a great relief...
    Many thanks in advance.

    I don't understand the answer, can you please expand. I am trying to do a similar thing by creating an output buffer,
    assemble a mix of text and html tags and then output this buffer later. All of the html tags are skipped or re-escaped in the final html:
    In this example I want to print the IPRCROP, then add an html break (<br>).
    Example 1. Use xsl:text with escape = yes
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text disable-output-escaping="yes">&lt;br&gt;&lt;/br&gt;</xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    In this case the <br> and </br> end up re-escaped in the output html as #60 etc. so they appear literally as
    ALFALFA <br> BARLEY <br>
    and in source as: ALFALFA&#60; br &gt; &#60; /br &gt;BARLEY
    Example 2, try as pure text, it just skips the <br></br> altogether
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text><br></br></xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    output = ALFALFABARLEY

  • Large numbers calculation problem (determinant calculation)

    Hello experts,
    I have really interesting problem. I am calculatig determinant in ABAP with a large numbers (in CRM 5.0 system).
    My formula for determinant is :
    FORM calculate_determinant USING    det      TYPE zsppo_determinant
                               CHANGING value    TYPE f .
      value =
        (  1 * det-a11 * det-a22 * det-a33 * det-a44 ) + ( -1 * det-a11 * det-a22 * det-a34 * det-a43 ) +
        ( -1 * det-a11 * det-a23 * det-a32 * det-a44 ) + (  1 * det-a11 * det-a23 * det-a34 * det-a42 ) +
        ( -1 * det-a11 * det-a24 * det-a33 * det-a42 ) + (  1 * det-a11 * det-a24 * det-a32 * det-a43 ) +
        ( -1 * det-a12 * det-a21 * det-a33 * det-a44 ) + (  1 * det-a12 * det-a21 * det-a34 * det-a43 ) +
        (  1 * det-a12 * det-a23 * det-a31 * det-a44 ) + ( -1 * det-a12 * det-a23 * det-a34 * det-a41 ) +
        ( -1 * det-a12 * det-a24 * det-a31 * det-a43 ) + (  1 * det-a12 * det-a24 * det-a33 * det-a41 ) +
        (  1 * det-a13 * det-a21 * det-a32 * det-a44 ) + ( -1 * det-a13 * det-a21 * det-a34 * det-a42 ) +
        ( -1 * det-a13 * det-a22 * det-a31 * det-a44 ) + (  1 * det-a13 * det-a22 * det-a34 * det-a41 ) +
        (  1 * det-a13 * det-a24 * det-a31 * det-a42 ) + ( -1 * det-a13 * det-a24 * det-a32 * det-a41 ) +
        ( -1 * det-a14 * det-a21 * det-a32 * det-a43 ) + (  1 * det-a14 * det-a21 * det-a33 * det-a42 ) +
        (  1 * det-a14 * det-a22 * det-a31 * det-a43 ) + ( -1 * det-a14 * det-a22 * det-a33 * det-a41 ) +
        ( -1 * det-a14 * det-a23 * det-a31 * det-a42 ) + (  1 * det-a14 * det-a23 * det-a32 * det-a41 )
    ENDFORM.
    Det values are also f type. Problem is, that for several numbers I got the right values and for another det values I got wrong values... I also try to retype variable value on type p, but without success. Maybe I used wrong types or there is some ABAP rounding of numbers which cause wrong result.
    Any good ideas of solutions. <text removed>. Thanks for your time.
    Edited by: Matt on Sep 14, 2010 9:17 AM

    Hi Lubos,
    phew! that sounds far from SAP scope, but from Maths' numerical methods. Let's see if I can remember something about my lessons at University...
    - One issue can arise when adding and subtracting terms which are very similar, because the error tends to arise quite fast. Try to add the positive terms on one hand, and the negative terms on the other hand, then subtract one from the other.
    - Please take into account that the determinant value can be significantly close to zero when the condition number of the matrix is low, that is, when the range is 4 but the whole determinant is close to 0. Instead, try a [Singular Value Decomposition|http://en.wikipedia.org/wiki/SVD_(mathematics)] or an [LU decomposition|http://en.wikipedia.org/wiki/LU_decomposition]
    I hope this helps. Kind regards,
    Alvaro

  • Format-number not working for me with preview to excel

    Hi,
    I have a report with 8 fields across within a table.
    Each field is formatted in the same way, with format-number like this (there are 8):
    <?format-number:total-year-remaining;’PT999G999D99’?>
    (that's the type-your-own form-field help text in the word template).
    When I preview the PDF, the data looks fine (8 cells shown below):
    .00 (.10) (.10) .00 (.50) (.50) (.60) (.60)
    But when previewing to Excel, there are two problems:
    1. Only the data in the last field (the 8th one) is formatted with the oracle mask:
    (.60)
    But upon closer inspection, there are two blank spaces after the number in that cell, and the value itself is treated like a string, e.g. '(.60) '. In fact if I ask excel to format this cell like a number with currency and two decimal places, in won't do it because of trailing spaces. Its just not a number to excel at that point. Probably the ('s don't help things either.
    2. The data in the first seven fields in excel are numeric, and I can format them in excel as currency, but I wanted XMLP to handle this, not the excel user.
    The bottom line is this: I want both PDF and excel output. I want both forms to have the fomat mask applied correctly. And I want excel to treat each cell as a number. Is this possible?
    Thanks
    Adam

    Anatoli,
    Hello!
    I don't know if my situation is the same as yours, but after a lot of head-scratching, forum searching and template rebuilding, I finally figured out my problem.
    I had one column that no matter what I did kept appearing in Excel as text. I'd format it to Number in Excel and nothing. When trying to sum the column, Excel would not recognize any of the values as numbers. I even did the reformatting on the XML Word template to number, and the currency format that Adam mentions. Still no go. The $ and ',' appeared, but column still formatted as string.
    I just finally noticed Adam's mention of the 2 extra spaces at the end of the numbers and sure enough mine was doing the same thing. Take out the 2 spaces and voila! Number!
    Every time I redid my template in Word (07 and 03), I used the wizard. (Add-ins>Insert>Table>Wizard) walked through the steps, not really changing anything. Then I would preview and the spaces would be there. The column that I was having problems with was the last column of the table, which would get the text 'end G_ASSIGNED_CC' inserted in after the field name - separated by 2 spaces. Once I took out these two spaces, so the column now shows 'COSTend G_ASSIGNED_CC', it worked fine in Excel - all numbers.
    Hope that helps someone out there as I was having a heck of a time finding anything (solutions anyway) on this.
    Thanks,
    Janel

  • How do i put a mobile number in on numbers '09? like 0414441472. Doesn't like 0 at the front. Thanks

    How do i put a mobile number in on numbers '09? like 0414441472. Doesn't like 0 at the front. Thanks

    Ed,
    There are a number of ways to do this. Your phone number consists of all numerals, yet isn't a numeric value, but rather a text value. Numbers doesn't know that, so it treats it as a numeric value and strips off what it feels is an unnecessary leading zero.
    You have there options:
    Format the cells as Text prior to making the entry.
    Leave the cells as a Numeric value format, but choose Custom Format to set the number of displayed places and choose to display leading zeros.
    Use the Numeral System Format and set it to base 10, displaying 9 digits, or whatever you need.
    There are ways to convert a number to text and add required leading zeros with a formula too, but it's needless work.
    Jerry

  • XDK, XSLT Processor, Add JARs statically

    Hello,
    while using XDK's Oracle XSLT Extensions I'm facing an issue with class visibility after adding it via "loadjava" tool.
    I'm getting the following exception during transformation:
         oracle.xml.xpath.XPathException: Extension function error: Class not found ...
         oracle.xml.xslt.XSLStylesheet.flushErrors(XSLStylesheet.java:2495)
    The docs say the following: (Using the XSLT Processor for Java)
    "Note: The XSL class loader only knows about statically added JARs and paths in the CLASSPATH and those specified by wrapper.classpath. Files added dynamically are not visible to XSLT processor."
    So it's rather clear that loadjava adds classes dynamically. That explains the error message.
    The question however is: how to add classes statically?
    Thanks a lot in advance for you help!

    Trying some stuff at home now until we can call each other.
    Java version is a bit old, isn't it...?
    On my DB version at home (12.1.0.1), server side, it mentions:
    [oracle@localhost ~]$ java -version
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.11) (rhel-1.61.1.11.11.el6_4-x86_64)
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
    Will try to figure out what the local XDK stuff says.
    My $CLASSPATH is not set. The Oracle Java JDK version mentions:
    [oracle@localhost bin]$ $ORACLE_HOME/jdk/bin/java -version
    java version "1.6.0_37"
    Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
    After setting the environment on server database side, I get...
    [oracle@localhost oracle.xdk_11.1.0]$ oraxsl -v
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parser/v2/oraxsl
    Caused by: java.lang.ClassNotFoundException: oracle.xml.parser.v2.oraxsl
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: oracle.xml.parser.v2.oraxsl. Program will exit.
    [oracle@localhost oracle.xdk_11.1.0]$ echo $PATH
    /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/12.1.0/dbhome_1/bin
    [oracle@localhost oracle.xdk_11.1.0]$ echo $LD_LIBRARY_PATH
    /u01/app/oracle/product/12.1.0/dbhome_1/lib
    [oracle@localhost oracle.xdk_11.1.0]$ echo $JAVA_HOME
    /u01/app/oracle/product/12.1.0/dbhome_1/jdk/bin
    [oracle@localhost oracle.xdk_11.1.0]$ echo $ORACLE_HOME
    /u01/app/oracle/product/12.1.0/dbhome_1
    [oracle@localhost oracle.xdk_11.1.0]$ echo $CLASSPATH
    /u01/app/oracle/product/12.1.0/dbhome_1/lib/xmlparserv2.jar:/u01/app/oracle/product/12.1.0/dbhome_1/lib/xsu12.jar:/u01/app/oracle/product/12.1.0/dbhome_1/lib/xml.jar
    [oracle@localhost oracle.xdk_11.1.0]$ oraxsl -v
    Release version: Oracle XML Developers Kit 12.1.0.1.0 - Production
    oraxsl: Number of arguments specified (1) is illegal
    usage: oraxsl options* source? stylesheet? result?
                -w                          Show warnings
                -e <error log>              A file to write errors to
                -l <xml file list>          List of files to transform
                -d <directory>              Directory with files to transform
                -x <source extension>       Extensions to exclude
                -i <source extension>       Extensions to include
                -s <stylesheet>             Stylesheet to use
                -r <result extension>       Extension to use for results
                -o <result directory>       Directory to place results
                -p <param list>             List of Params
                -t <# of threads>           Number of threads to use
                -v                          Verbose mode
                -debug                      Debug mode
                -m <version #>              XSLT Version, 1 or 2
    Please refer to the readme file for more information on the above options
    [oracle@localhost oracle.xdk_11.1.0]$ java -version
    java version "1.6.0_24"
    OpenJDK Runtime Environment (IcedTea6 1.11.11) (rhel-1.61.1.11.11.el6_4-x86_64)
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
    [oracle@localhost oracle.xdk_11.1.0]$ export PATH=$ORACLE_HOME/jdk/bin:$PATH
    [oracle@localhost oracle.xdk_11.1.0]$ java -version
    java version "1.6.0_37"
    Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

  • Very Large Numbers Question

    I am a student with a question about how Java handles very large numbers. Regarding this from our teacher: "...the program produces values that
    are larger than Java can represent and the obvious way to test their size does not
    work. That means that a test that uses >= rather than < won?t work properly, and you
    will have to devise something else..." I am wondering about the semantics of that statement.
    Does Java "know" the number in order to use it in other types of mathematical expressions, or does Java "see" the value only as gibberish?
    I am waiting on a response from the teacher on whether we are allowed to use BigInteger and the like, BTW. As the given program stands, double is used. Thanks for any help understanding this issue!

    You're gonna love this one...
    package forums;
    class IntegerOverflowTesterator
      public static void main(String[] args) {
        int i = Integer.MAX_VALUE -1;
        while (i>0) {
          System.out.println("DEBUG: i="+i);
          i++;
    }You also need to handle the negative case... and that get's nasty real fast... A positive plus/times a positive may overflow, but so might a negative plus a negative.
    This is decent summary of the underlying problem http://mindprod.com/jgloss/gotchas.html#OVERFLOW.
    The POSIX specification also worth reading regarding floating point arithmetic standards... Start here http://en.wikipedia.org/wiki/POSIX I guess... and I suppose the JLS might be worth a look to http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html

  • Best practices for speeding up Mail with large numbers of mail?

    I have over 100,000 mails going back about 7 years in multiple accounts in dozens of folders using up nearly 3GB of disk space.
    Things are starting to drag - particularly when it comes to opening folders.
    I suspect the main problem is having large numbers of mails in those folders that are the slowest - like maybe a few thousand at a time or more.
    What are some best practices for dealing with very large amounts of mails?
    Are smart mailboxes faster to deal with? I would think they would be slower because the original emails would tend to not get filed as often, leading to even larger mailboxes. And the search time takes a lot, doesn't it?
    Are there utilities for auto-filing messages in large mailboxes to, say, divide them up by month to make the mailboxes smaller? Would that speed things up?
    Or what about moving older messages out of mail to a database where they are still searchable but not weighing down on Mail itself?
    Suggestions are welcome!
    Thanks!
    doug

    Smart mailboxes obviously cannot be any faster than real mailboxes, and storing large amounts of mail in a single mailbox is calling for trouble. Rather than organizing mail in mailboxes by month, however, what I like to do is organize it by year, with subfolders by topic for each year. You may also want to take a look at the following article:
    http://www.hawkwings.net/2006/08/21/can-mailapp-cope-with-heavy-loads/
    That said, it could be that you need to re-create the index, which you can do as follows:
    1. Quit Mail if it’s running.
    2. In the Finder, go to ~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong, e.g. by dragging it to the Desktop while holding the Option (Alt) key down. This is where all your mail is stored.
    3. Locate Envelope Index and move it to the Trash. If you see an Envelope Index-journal file there, delete it as well.
    4. Move any “IMAP-”, “Mac-”, or “Exchange-” account folders to the Trash. Note that you can do this with IMAP-type accounts because they store mail on the server and Mail can easily re-create them. DON’T trash any “POP-” account folders, as that would cause all mail stored there to be lost.
    5. Open Mail. It will tell you that your mail needs to be “imported”. Click Continue and Mail will proceed to re-create Envelope Index -- Mail says it’s “importing”, but it just re-creates the index if the mailboxes are already in Mail 2.x format.
    6. As a side effect of having removed the IMAP account folders, those accounts may be in an “offline” state now. Do Mailbox > Go Online to bring them back online.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder, i.e. ~/Library is the Library folder within the user’s home folder.

Maybe you are looking for