Formating and calculating xml tag value

I have an xml file that holds xml tag such as <weight>.55 kg</weight>
I want to have two outputs:
Output 1) Output to print: 0.55
Output 2) Output to print 0.8 of the xml tag value (0.55 * 0.8) : 0.44
I was able to get the Output 1) by using <?format-number:weight;'9G990D00'?>
However, I can not get the Output2) as expected.
If I put <?format-number:(weight)*0.8;'9G990D00'?>,
I get the error message "Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert .55 kg to number."
Appreciate any help on how to solution for Output2)
Edited by: user4697912 on Jun 22, 2010 1:23 AM
Edited by: user4697912 on Jun 22, 2010 1:23 AM

If that is the case then try using
<?format-number:( substring-before(WEIGHT,'kg')*0.8);'9G990D00'?>

Similar Messages

  • How to filter particular xml tag value using -DBMS_XMLGEN / DBMS_XMLSTORE

    Hi,
    I am using dbms_xmlgen and dbms_xmlstore package to extract xml datafile tag value from file server to oracle database table.
    I have used the below pl/sql program to extract the xml tag values to oracle relational table.Its working fine for me.
    But I would like to extract the values based on particular filter condition.
    The following xml program I have 3 rows I would like extract the xml data based on the following condition .
    Filter condition
    ==============
    the tag <STATE_ABBREVIATION> value shuold be 'CA' and the <CITY> tag value should be Palo_Alto then I will store the ZIPCODE
    ZIP_CODE_EXTN,STATE_ABBREVIATION tag values in the Oracle Relational table.
    The below pl/sql program storing all the three rows but I required the values based on the filter condition that I mentioned earlier.
    Kindly assist me what are the steps that I need to change in this program.?
    XML Program file content.
    ======================
    <ZIPCODES>
    <mappings>
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    <CITY>Palo_Alto</CITY>
    </mappings>
    <mappings>
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>95302</ZIPCODE>
    <ZIP_CODE_EXTN>9279</ZIP_CODE_EXTN>
    <CITY>LA</CITY>
    </mappings>
    <mappings>
    <STATE_ABBREVIATION>TX</STATE_ABBREVIATION>
    <ZIPCODE>75038</ZIPCODE>
    <ZIP_CODE_EXTN>7837</ZIP_CODE_EXTN>
    <CITY>DALLAS</CITY>
    </mappings>
    </ZIPCODES>
    PL/SQL Program for XML extract.
    ==========
    declare
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp number;
    insCtx DBMS_XMLStore.ctxType;
    ctx dbms_xmlgen.ctxHandle;
    v_FileHandle UTL_FILE.FILE_TYPE;
    begin
    v_FileHandle := utl_file.fopen('XMLTEST','XML_NEW_CITIES.XML','r') ;
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    insCtx := DBMS_XMLStore.newContext('SYS.ZIPCODES');
    dbms_xmlgen.setRowsetTag(insCtx,'ZIPCODES');
    dbms_xmlgen.setRowsetTag(insCtx,'mappings');
    DBMS_XMLStore.clearUpdateColumnList(insCtx);
    DBMS_XMLStore.setUpdateColumn(insCtx,'ZIPCODE');
    DBMS_XMLStore.setUpdateColumn(insCtx,'ZIP_CODE_EXT N');
    DBMS_XMLStore.setUpdateColumn(insCtx,'STATE_ABBREV IATION');
    rowsp := dbms_xmlstore.insertXML(insCtx,finalstr);
    end;
    Thanks,
    nat

    Thanks for your reply. :)
    Its working fine in the DBMS_XMLSTORE package. Here I have given the code
    CREATE OR REPLACE TYPE typ_dummy AS  OBJECT
    ( "@ENO"   NUMBER,
      "@ENAME" VARCHAR2(100),
      eno      NUMBER,
      ename    VARCHAR2(100));
    CREATE TABLE EMP
      empno    VARCHAR2(25),
      sal      NUMBER,
      hiredate DATE,
      typ      TYP_DUMMY
    DECLARE
      insCtx DBMS_XMLStore.ctxType;
      rows NUMBER;
      xmldoc CLOB :=
        '<ROWSET>
           <ROW num="1">
             <SAL>1800</SAL>
             <EMPNO>739</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
               <TYP ENO="739" ENAME="Nazurullah">
               <ENO> 1 </ENO>
               <ENAME> ALDRIN </ENAME>
               </TYP>
           </ROW>
           <ROW>
             <SAL>18000</SAL>
             <EMPNO>7369</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
             <TYP ENO="7369" ENAME="PEPPIN" />
           </ROW>
           <ROW>
             <SAL>37000</SAL>
             <EMPNO>20701</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
             <TYP>
               <ENO> 20701 </ENO>
               <ENAME> VENKATACHALAM </ENAME>
             </TYP>
           </ROW>
         </ROWSET>';
    BEGIN
      insCtx := DBMS_XMLStore.newContext('emp'); -- get saved context
      -- Now insert the doc.
      -- This will only insert into EMPNO, SAL and HIREDATE columns
      rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
      -- Close the context
      DBMS_XMLStore.closeContext(insCtx);
    END;
    SELECT * FROM emp;
    EMPNO        SAL HIREDATE          TYP(@ENO, @ENAME, ENO, ENAME)
    739         1800 27-AUG-96     TYP_DUMMY(739, 'Nazurullah', 1, ' ALDRIN ')
    7369       18000 27-AUG-96     TYP_DUMMY(7369, 'PEPPIN', NULL, NULL)
    20701      37000 27-AUG-96     TYP_DUMMY(NULL, NULL, 20701, ' VENKATACHALAM ')

  • Setting the XML tag value in Java script

    Hi,
       I am trying to set a XML tag value in the initialize event of a text field.. The code works fine in FormCalc but I needed it to work in java script.
         FormCalc:
         $record.prospectApplication.typeName = "namedInsured";
         Java Script:
         xfa.record.prospectApplication.typeName = "namedInsured";
         The above JavaScript does not work. Can any one help on this?
    Thanks
    Srini

    Hi Srini,
    In JavaScript you don't get any default properties so you need to say;
    xfa.record.prospectApplication.typeName.value = "namedInsured";
    That is assign the value to the "value" property not the dataValue object.

  • How do you differentiate IDOC XML format and ordinary XML format

    how do you differentiate IDOC XML format and ordinary XML format since they are used by IDOC adapter and RFC adapter???

    Hi,
    Cremas Structure starts with Header and followed by Segments...
    Normally it begins like this
    <CREMAS03><IDOC BEGIN="1">
    The second node is Idoc in the header..
    Thanks
    Anju

  • Html tag as xml tag value?

    Hi,
    Can I put a html tag as value to a xml tag? something like this
    <abc>
    <username>Uma</username>
          <displayTag>
                  <start><h1></start>
                  <end></h1></end>
          </displayTag>
    </abc>Please help.
    Thanks in advance.

    You can either use > and < for < and > to get something that appears to be an html tag, or you can use a CDATA section.
    It partly depends on what you plan to do with that content.
    Dave Patterson

  • Search for, edit, and delete XML tag (Adobe InDesign Server CS5)

    Hi all,
    I'm working with Indesign Server CS5 and JavaScript, though having some trouble coming up with a solution to a problem...
    I need to build a JS script (called through SOAP) that will enable me to search an InDesign file for a given XML tag.
    Upon finding the XML tag, if the 'action' variable is set to delete, it should delete the tag and its contents.
    If the action is set to edit, it should change the contents of the tag to some user-specified content.
    The primary caveat is that the XML tag is variable, as is the XML structure of the InDesign file.
    Here's what I have in mind, in pseudocode:
    function findXMLTag(tag, action) {
         app.searchForTag(tag);
         if (tagIsFound) {
              if (action == "delete") {
                   tag.delete;
              } else if (action == "edit") {
                   tag.contents = "Updated content";
    Any help would be greatly appreciated!
    Thanks,
    Ben Kay

    'searchForTag' can be implemented as a recursive function.
    Recursion is defined like this: I thought, "I'll just search this forum for 'recursion'." The first post I found was one of my own, suggesting that the poster should search the forum for 'recursion'.
    Here is an example: find the XML Element [<email>]
    And another: Remove xml element using JS[CS3] (read carefully, as the OP got stuck on how to successfully remove an element and continue)
    And one, using XML Rules -- which I'm totally unfamiliar with, but may work for you: Changing Values in XML tags

  • Search and Replace XML TAG using JAVA

    Hi All,
    I have an XML file, say RESULT.XML Which has about 30000 Lines (yes Thirty Thousand ). For some reason i need to replace an existing tag with a different tag(not the value inside the tag, But the tag itself) . I am facing a challenge. I will explain it as below.
    I have a csv file which has 2 values as given below
    <VALUE A> , <VALUE B>
    where <VALUE A> is an existing node in the RESULT.XML and <VALUE B> is the node that should replace <VALUE A> in the RESULT.XML
    i have 500 such entries in the file.
    Now i need to write a program to read the csv file, Search <VALUE A> in the RESULT.XML and Replace it with <VALUE B> of the csv file.
    please let me know how do i start with this.
    I really want to fix this issue.
    Existing Node = <Product ID="role (contact) 3" UserTypeID="Product Number">_
    To be changed to = <Product ID= role (contact)3" UserTypeID="Product Number">_
    please reply if you need any further information
    Thanks in Advance
    Manzoor

    Sounds like a job for XSLT or Perl not Java though it can be done in Java. In Java I would initially try
    1) Read the csv file using one of the many free CSV parsers and build a Map<String,String>.
    2) Create a Rewriter using the map keys as targets and use the map values as replacements.
    3) Read the XML file line by line and process each line with the Rewriter.
    4) Save each line to an output file.
    For a one-off task this would probably serve but it could prove very slow if you need to run this on a daily basis.

  • How can i find and replace xml tags?

    Hi, i am using xml in my workflow and want to be able to remove certain tags if they contain particular text.
    here is an example of my xml structure…
    <entry>
        <name>DEFAULT</name>
        <tel>DEFAULT</tel>
        <address>DEFAULT</address>
    </entry>
    I am using this initial structure to set the paragraph styles to be followed when the xml data is imported.
    This leaves DEFAULT in place wherever an entry doesn't have any content for that field.
    I want to be able to import my XML then run a script that removes any tags that include DEFAULT, - I need the entire xml tag to be removed not just the text, if i do a normal find and replace it will only remove the text not the tags which is causing problems with styling. I also want to remove the end of para/return (^p) that i've placed at the end of the line. So it would be the same as opening up story editor and removing the content + tags + hard return in there, but i want to automate the process…
    So i think this is what i need to search for in each case
    "<name>DEFAULT</name>^p"
    and i want to replace it with nothing ""
    Can this be done through scripting (ideally javascript)?
    I have a little knowledge of javascript but am not sure how to search and target that kind of string in indesign...
    using indesign cs5
    many thanks

    Hi,
    Script should do it in two steps:
    1. find all occurences of i.e. ">DEFAULT<"
    2. remove whole paragraph which is a found_text's container.
    For example this way -JS - (a textFrame filled with your text should be selected) :
    var mStory = app.selection[0].parentStory;
    app.findTextPreferences =  null;
    app.findTextPreferences.findWhat = ">DEFAULT<";
    var myF = mStory.findText();
    var count = myF.length;
    while (count--)
         myF[count].paragraphs[0].remove();
    rgds

  • b and /b xml tags displayed in pdf

    hi Experts,
    I am using 10.1.3.3.2
    I am displaying the fillter view along with the report on the dashboard. When I generate the pdf (printer friendly -> PDF) for that, the dates between filter condition is showing the <b>and</b> tags around 'and' instead of displaying 'and' in bold.
    I.e it is displayed as- Maturity Date is between *01/07/2010* <b>and</b>*31/07/2010*
    while it should be-
    Maturity Date is between *01/07/2010 and 31/07/2010*
    In the html view it is correct. The problem is in pdf.
    Has anyone got a solution for removing the <b>and</b> tags?

    The problem is pdf format will display HTML tags. If you want to get rid of the tags, rewrite your "between" filter like this:
    Maturity Date >= 01/07/2010
    And
    Maturity Date <= 31/07/2010
    The "And" here will not display with the HTML tags when you save the report to pdf.

  • Export Query SQL multi-linee in XML format and Import XML in SAP

    Good morning
    Someone know if is possible after Export Query SQL on OITT and ITT1 with thousands rows in XML with values already change thru the query.
    Then import the XML without using loop in SAP with the above code vb.net
    oDistinta = DirectCast(m_oCompany.GetBusinessObjectFromXML(xmlFile, 0), SAPbobsCOM.ProductTrees)
                    Dim errCode As Integer = 0
                    Dim strErrore As String = ""
                    Dim iErrore As Integer = 0
                    oDistinta.Browser.ReadXml(xmlFile, 0)
                    errCode = oDistinta.Update
                    m_oCompany.GetLastError(iErrore, strErrore)
                    'on error
                    If iErrore <> 0 Then
    To make easy the program i post with 2 ProductTrees item. The 2 item already exist in OITT e ITT1.
    When i update the 1st item is modify but the 2nd not change.
    Here is the XML
    <?xml version="1.0" encoding="UTF-16"?>
    <BOM>
      <BO>
        <AdmInfo>
          <Object>66</Object>
          <Version>2</Version>
        </AdmInfo>
        <ProductTrees>
          <row>
            <TreeCode>V9998</TreeCode>
            <TreeType>iProductionTree</TreeType>
            <Quantity>1000.000000</Quantity>
            <U_SHI_MZDA>0</U_SHI_MZDA>
            <U_SHI_PUMA>0</U_SHI_PUMA>
            <U_SHI_PUUO>0</U_SHI_PUUO>
          </row>
        </ProductTrees>
        <ProductTrees_Lines>
          <row>
            <ItemCode>1047</ItemCode>
            <Quantity>5.000000</Quantity>
            <Warehouse>Mc</Warehouse>
            <Price>0.000000</Price>
            <Currency>
            </Currency>
            <IssueMethod>im_Backflush</IssueMethod>
            <Comment>
            </Comment>
            <ParentItem>V9998</ParentItem>
            <PriceList>2</PriceList>
            <DistributionRule>
            </DistributionRule>
            <U_IDE_POS>10</U_IDE_POS>
            <U_IDE_FASE>0</U_IDE_FASE>
            <U_IDE_OPER>10</U_IDE_OPER>
            <U_SHI_UndInv>N</U_SHI_UndInv>
            <U_SHI_Pri1>
            </U_SHI_Pri1>
            <U_SHI_Pri2>
            </U_SHI_Pri2>
            <U_SHI_Pri3>
            </U_SHI_Pri3>
            <U_SHI_Prgm>
            </U_SHI_Prgm>
            <U_SHI_Tim2>0.000000</U_SHI_Tim2>
            <U_SHI_Tim3>0.000000</U_SHI_Tim3>
            <U_SHI_DexNACQ>
            </U_SHI_DexNACQ>
            <U_SHI_BP>
            </U_SHI_BP>
            <U_SHI_PrcKit>0.000000</U_SHI_PrcKit>
            <U_SHI_ItmNACQ>
            </U_SHI_ItmNACQ>
            <U_SHI_LineOk>N</U_SHI_LineOk>
          </row>
        </ProductTrees_Lines>
        <ProductTrees>
          <row>
            <TreeCode>V9999</TreeCode>
            <TreeType>iProductionTree</TreeType>
            <Quantity>1000.000000</Quantity>
            <U_SHI_MZDA>0</U_SHI_MZDA>
            <U_SHI_PUMA>0</U_SHI_PUMA>
            <U_SHI_PUUO>0</U_SHI_PUUO>
          </row>
        </ProductTrees>
        <ProductTrees_Lines>
          <row>
            <ItemCode>1015</ItemCode>
            <Quantity>1000.000000</Quantity>
            <Warehouse>Mc</Warehouse>
            <Price>0.000000</Price>
            <Currency>
            </Currency>
            <IssueMethod>im_Backflush</IssueMethod>
            <Comment>
            </Comment>
            <ParentItem>V9999</ParentItem>
            <PriceList>5</PriceList>
            <DistributionRule>
            </DistributionRule>
            <U_IDE_POS>30</U_IDE_POS>
            <U_IDE_FASE>0</U_IDE_FASE>
            <U_IDE_OPER>30</U_IDE_OPER>
            <U_SHI_UndInv>N</U_SHI_UndInv>
            <U_SHI_Pri1>
            </U_SHI_Pri1>
            <U_SHI_Pri2>
            </U_SHI_Pri2>
            <U_SHI_Pri3>
            </U_SHI_Pri3>
            <U_SHI_Prgm>
            </U_SHI_Prgm>
            <U_SHI_Tim2>0.000000</U_SHI_Tim2>
            <U_SHI_Tim3>0.000000</U_SHI_Tim3>
            <U_SHI_DexNACQ>
            </U_SHI_DexNACQ>
            <U_SHI_BP>
            </U_SHI_BP>
            <U_SHI_PrcKit>0.000000</U_SHI_PrcKit>
            <U_SHI_ItmNACQ>
            </U_SHI_ItmNACQ>
            <U_SHI_LineOk>N</U_SHI_LineOk>
          </row>
        </ProductTrees_Lines>
      </BO>
    </BOM>
    Someone know the reason ?
    Thanks in advance.
    Regards

    Hi Gabriele,
    The issue is that the ReadXml method takes an index parameter which is the number of the object that you want to read from the XML data. In your code you are specifying index 0 which is the first product tree in your file so when you call the Update method this is the only record that will be updated. It is not possible to do a mass update using the DI API in this way, you must always load each object separately. You can use the GetXMLelementCount method of the Company object to find out how many product tree objects are in your file and then use the ReadXML method to load each one by incrementing the index parameter in a loop.
    Kind Regards,
    Owen

  • Validate the XML tag value and display the Binding data in XDP

    Hi,
    I am new to Adobe Life Cycle.... and i am working on the following requirement and XML file is enclosed...
    1. Need to validate the XML value of <pp> with condition
    2. Basing on the value of <pp>, need to display the <ct> values in text field
    If i simply bind, it takes the values from top of array and display..
    Please suggest how to restrict the binding values basing on the condition.
    Thanks
    Madhu

    Hi Paul,
    Thank you for quick respose.
    The solution which you have give me not excatly looking for.... working for the solution in alternative methods...
    Regards
    madhu

  • Issue Using C# to Get RTF Text From Clipboard to Outlook With Formatting and Without Encoding Tags

    I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox.  A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
    and pasted into an Outlook Email.  When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it. 
    I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly.  This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
    formatting into the mail body.
    I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property.  In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
    work, I feel that I must be missing something really simple while trying to work with RTF.
    I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item.  This is bringing in all the RTF encoding tags.  I have tried to paste this directly into the RTFBody of the mail item,
    yet an execption gets thrown when executed.  Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it.  Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
    it will render properly.
    This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception.  Any help in the matter would be greatly
    appreciated.  I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
    Thanks for the help.
    Some pertinent information:
    Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
    Because of this Systems.Windows.Forms is not in use
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Pasting data into body of email
    myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
    myNewMailIoI.Display(); //Allow for window to be minimized
    myNewMailIoI.Display(true);

    Ok, I found the solution.  Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
    byte stream.  Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes. 
    This is where I failed to understand the previous answers.  I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
    misunderstanding) and that I needed to somehow take this byte array and do something with it.  My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
    after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray). 
    This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property.  Included below is the final code such that I hope that it helps some other
    person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
    using System.Text;
    using Outlook = Microsoft.Office.Interop.Outlook;
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    //Add Subject
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    //Set Body Format to RTF
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
    string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
    byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
    //Inserting RTF bytes into RTFBody property
    myNewMailIoI.RTFBody = myNewRtfBytes;
    myNewMailIoI.Display(); //Displays the newlycreated email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>";

  • Calculation XML signature value with timestamp

    I know how to calculate a signature value based on the elment "SignedInfo" in a xml document.
    The problem is when a timstamp is used, hash value is also added to the signedinfo, but the calculation of the signature value is not the signature of that element, there is an extra calculation with that timestamp. Does anyone know the algorythm with timestamp?

    If you are trying to add a timestamp to your document, put it into a SignatureProperty and include the property for the signautre calculation; see here for an example: XML dsig: Can I sign a SignatureProperty of the Signature?
    If you are trying to do something else, you need to elaborate.
    Arshad Noor
    StrongAuth, Inc.

  • Formating and operating with integer values

    I am new to XML Publisher.
    I have a task to make a layout using rtf. The problem is that I must do an arithmetical operation using data generated from a system report. I must not modify the report!!!
    The value retrieved from report is of X.Y format which means a time period (X - years, Y - months). So I want to split this value in two - one for years and other for months with a posibility of making arithmetical operations over them. Is it possible?? And if so, cand anybody give me a solution for this...?

    ok, back to the problem. As I red in the XML Publihser Users Guide there is a posibility to transform strings in numbers, but I can't figure out how it works! As speaking of my problem I can not do arithmetical operations with that value (YEARS.MONTHS). I tried the to_number function described in XML Publisher User's Guide (page 7-3) over the vlaue x.y, I tried to change the point (x.y) to a comma (x,y) and again aply to_number function over resulted value, but it doesn't work. What do I do wrong?
    I tried the solution of spliting the x from y, but I run into a problem again. The years part x has a variable length so I can't get the y part. (the substr function didn't worked with negative start position - substr(DATE, -3, 3))
    Generaly I'm a very confused about XML Publisher. There are examples in User's Guide which didn't work for me...
    If anybody has some links with documentation about XML Publisher, other than those from ORACLE, please share them with me.
    10x!

  • About checkbox and calculation with that value..pls help me ...

    Hi, in my applet there are three checkboxes about food shape which is wanted to be selected by the user. The user will choose one of them and by his/her choice p and r values are set and i think its done by itemStateChange method. In this method using by if the p and r values are differently set because of users different 3 choice. But because the method is closed using }after writing it and before starting actionperformed method. In action performed method if button is pressed the calculation is done (if i would afford to write it in a true way). My question arises with usage of p and r values which is set in other first method and call it in next method and use it in calculation and making the calculation work. May be it is very easy to do it but not for me being at first step of programming. Thank u for all of ur interest. My codes are below:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    import java.text.*;
    public class kenan extends Applet implements ActionListener, ItemListener {
    DecimalFormat df=new DecimalFormat("0.####");
    double p, r;
    Panel satir1 = new Panel();
    Label l1 = new Label("Asagidaki kutulara gerekli degerleri girip 'hesapla' butonuna bas&#305;n&#305;z", Label.CENTER);
    Panel satir2 = new Panel();
    CheckboxGroup sekil = new CheckboxGroup();
    Checkbox levha = new Checkbox("Levha", false, sekil);
    Checkbox silindir = new Checkbox("Silindir", false, sekil);
    Checkbox kure = new Checkbox("Kure", false, sekil);
    Panel satir3 = new Panel();
    Label yogunluk = new Label("Yogunluk");
    TextField y = new TextField();
    Label kalinlik = new Label("Kalinlik");
    TextField dx = new TextField();
    Label iletim = new Label("Iletim katsayisi");
    TextField k = new TextField();
    Label tasinim = new Label("Tasinim katsayisi");
    TextField h = new TextField();
    Label ilksicaklik = new Label("Baslangic sicakligi");
    TextField tilk = new TextField();
    Label cevresicaklik = new Label("Cevre sicakligi");
    TextField tcevre = new TextField();
    Panel satir4 = new Panel();
    Button hesapla = new Button("Hesapla");
    Panel satir5 = new Panel();
    Label sure = new Label("Donma icin gecmesi gereken sure");
    Label tdonma = new Label("t");
    public void init(){
    GridLayout appletLayout = new GridLayout(5, 1, 5, 5);
    setLayout(appletLayout);
    FlowLayout layout1 = new FlowLayout(FlowLayout.LEFT, 5, 5);
    satir1.setLayout(layout1);
    satir1.add(l1);
    add(satir1);
    FlowLayout layout2 = new FlowLayout(FlowLayout.LEFT, 5, 5);
    satir2.setLayout(layout2);
    satir2.add(levha);
    satir2.add(silindir);
    satir2.add(kure);
    add(satir2);
    GridLayout layout3 = new GridLayout(3, 2, 5, 5);
    satir3.setLayout(layout3);
    satir3.add(yogunluk);
    satir3.add(y);
    satir3.add(kalinlik);
    satir3.add(dx);
    satir3.add(iletim);
    satir3.add(k);
    satir3.add(tasinim);
    satir3.add(h);
    satir3.add(ilksicaklik);
    satir3.add(tilk);
    satir3.add(cevresicaklik);
    satir3.add(tcevre);
    add(satir3);
    FlowLayout layout4 = new FlowLayout(FlowLayout.CENTER, 5, 5);
    satir4.setLayout(layout4);
    satir4.add(hesapla);
    add(satir4);
    FlowLayout layout5 = new FlowLayout(FlowLayout.CENTER, 5, 5);
    satir5.setLayout(layout5);
    satir5.add(sure);
    satir5.add(tdonma);
    add(satir5);
    setBackground(Color.lightGray);
    hesapla.addActionListener(this);
    levha.addItemListener(this);
    silindir.addItemListener(this);
    kure.addItemListener(this);
    public void itemStateChanged(ItemEvent event)
    String command = (String) event.getItem();
    if (command =="levha")
    {double p = 1/2;
    double r = 1/8;
    if (command =="Silindir")
    {double p = 1/4;
    double r = 1/16;
    else
    {double p = 1/6;
    double r = 1/24;}
    public void actionPerformed(ActionEvent event)
    {if (event.getSource()==hesapla)
    {double q,d,ti,tc,ki,hc;
    q = Double.valueOf(y.getText()).doubleValue();
    d = Double.valueOf(dx.getText()).doubleValue();
    ti = Double.valueOf(tilk.getText()).doubleValue();
    tc = Double.valueOf(tcevre.getText()).doubleValue();
    hc = Double.valueOf(h.getText()).doubleValue();
    ki = Double.valueOf(k.getText()).doubleValue();
    double buzE = 333707.99;
    double x = r*(Math.pow(d,2));
    double tsure = (q*buzE/(ti-tc))*((p*d/hc)+(x/ki));
    tdonma.setText(String.valueOf(df.format(tsure)));
    }

    First thing to fix is in itemStateChanged, use "equals" instead of "=="
    if (command.equals("levha"))
    else if (command.equals(...))
    Second thing is:
    double r = 1/2;is really telling Java the following:
    int tempR = 0; //integer division of 1/2;
    double r = (double) tempR = 0;Use:
    double r = ((double) 1)/2; // or just use 1.0/2.0;-------------
    Third thing is that your declarations of r and p in itemStateChanged hide the declaration of r and p in your kenan class. Just say:
    r = ((double) 1)/2; // or "r = 1.0/2.0;"-------------
    Try those three things, see what happens, and post the results.

Maybe you are looking for

  • Is sound possible with lightening-VGA connection to projector?

    I want to use my iPad-4 to give a Keynote presentation that contains video clips using a projector but a reviewer on Amazon has said that the Apple MD826 adaptor does not allow sound. Is this true of all lightening-VGA adaptors?

  • T61 & Micro Dock USB port issues

    I'm a remote worker and have a T61 and Micro Dock that had vista on it originally.  Our company was sold and our IT group only supports XP and Dell units.  They rolled me back to XP, but since then I have been having intermittent trouble with my dock

  • Web based Game

    Hi Friends. I want to design a web based game. There is a server and two clients. Each client is a player and the server will handle the collaboration between them. I am using Netbeans and jsp. First client one will type the url of server and gets co

  • What's the hold up Adobe?

    When will flash player and other awesome programs that Adobe offers Android and Apple phones be available for Windows phone?

  • 10.5.3 causes shutdown every few minutes

    Hi guys Last night I used software update to upgrade 10.5.3 Now when I use my mac, it just shuts down after a few minutes. No error message, no shutting down message, the screen just goes black and the machine shuts down. I'm using a 1.8Ghz iMac G5.