How ECMAScript enabled SVG Documnt be generated dynamically using DOM API.

<?xml version="1.0" encoding="UTF-8"?>
<svg height="200cm" width="200cm">
<script type="text/ecmascript">
<![CDATA[function rect_click(id){appletHost.getSelectedRectId(id);}]]>
</script>
<rect fill="none" height="1.0cm" i="5" id="B7001-09" j="0" stroke="blue" stroke-width="1" width="2.0cm" x="27.0cm" y="0.8cm" onclick="rect_click('B7001')"/>
<rect fill="none" height="1.0cm" i="5" id="B7001-09" j="0" stroke="blue" stroke-width="1" width="2.0cm" x="27.0cm" y="0.8cm"/>
<rect fill="none" height="1.0cm" i="5" id="B7001-09" j="0" stroke="blue" stroke-width="1" width="2.0cm" x="27.0cm" y="0.8cm"/>
</svg>

Sorry to ask u this question, its ver simple.
Create CDATA Section through the document and append it to the Script Element..
Element script = doc.createElement("script");
script.setAttribute("type","text/ecmascript");
script.appendChild(doc.createCDATASection("function rect_click(id){appletHost.getSelectedRectId(id);}"));
doc.getDocumentElement().appendChild(script);
Output inside <svg> tag::
<script type="text/ecmascript">
<![CDATA[function rect_click(id){appletHost.getSelectedRectId(id);}]]>
</script>
Rohit Joshi

Similar Messages

  • How to move XML tree to another level using DOM api ?

    <p>
    Hi,
    </p>
    <p>
    I have a followin function
    </p>
    <p>
    <font face="courier new,courier"><strong>    public void printEmployeesAsXML(){
    </strong></font>
    </p>
    <p>
    <font face="courier new,courier"><strong>        ViewObject vo = getEmployees();
            Node no = vo.writeXML(-1,XMLInterface.XML_OPT_ALL_ROWS);
            XMLNode oraXML = (XMLNode)no; 
            try {
                    oraXML.print(System.out);
                } catch (IOException e) {
                    e.printStackTrace();
        } </strong></font>
    </p>
    <p>
    <font face="courier new,courier"><strong>that gives me following XML:</strong></font>
    </p>
    <p>
    <font face="courier new,courier"><strong>&lt;Employees&gt;
       &lt;Employee&gt;
          &lt;Empno&gt;7369&lt;/Empno&gt;
          &lt;LastName&gt;SMITH&lt;/LastName&gt;
          &lt;Job&gt;CLERK&lt;/Job&gt;
          &lt;Manager&gt;7902&lt;/Manager&gt;
          &lt;HireDate&gt;1980-12-17&lt;/HireDate&gt;
          &lt;Salary&gt;800&lt;/Salary&gt;
          &lt;Deptno&gt;20&lt;/Deptno&gt;
       &lt;/Employee&gt;</strong></font>
    <font face="courier new,courier"><strong>&lt;/Employees&gt;</strong></font>
    </p>
    <p>
    I always wil have only one row, so I need following XML:
    <font face="courier new,courier"><strong>
       &lt;Employee&gt;
          &lt;Empno&gt;7369&lt;/Empno&gt;
          &lt;LastName&gt;SMITH&lt;/LastName&gt;
          &lt;Job&gt;CLERK&lt;/Job&gt;
          &lt;Manager&gt;7902&lt;/Manager&gt;
          &lt;HireDate&gt;1980-12-17&lt;/HireDate&gt;
          &lt;Salary&gt;800&lt;/Salary&gt;
          &lt;Deptno&gt;20&lt;/Deptno&gt;
       &lt;/Employee&gt;</strong></font>
    </p>
    <p>
    Question is how to remove <strong>&lt;/Employees&gt;</strong> tag using w3c DOM API and move tree one level above
    </p>
    <p>
    Kuba 
    </p>
    <p>
    </p>

    The XSLT for the required transformation is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/Employees">
    <xsl:copy-of select="Employee"/>
    </xsl:template>
    </xsl:stylesheet>

  • How i can deal with oracle file by using php api

    how I can deal with oracle file by using php api ?

    What has this to do with Reflections and Reference Objects?

  • To generate PDF using BI APIs and loadjava utility

    Hi All,
    I am trying to generate PDF using BI APIs(FOProcessor etc).
    I have generated XML data through the PL/SQl procedure and storing it in a file. This file is loacted in database tier.
    The APIs is used through a simple java program which is application tier. To test the process, I had to manually provide the XML file to the java class in order to generate PDF and it does generate.
    Now the issue is I need to load the java class to the database so that everything gets automated(loadjava utlility).
    when i try to do it, it give no class found error.
    Do I need to load the referenced classes in the java file , that is, FOProcessor,RTFProcessor,FOUtility,jdbc.driver.OracleDriver as well?
    If the above is not possible, is it possible to reference a file in database tier from application tier so that i can use the XML file as input the java class in application tier.
    thanks,
    Srik

    The only reason I am responding to this post is because the poster sent me a request through the forum message system asking for my help.
    Although I did populate PDFs with FDF data generated by web forms a year or so ago, I have since abandoned that kind of solution. It was a big headache. I found it far more stable and flexible to use html, php and css to populate forms that are almost as nice looking as PDFs.
    So my advice is, if you can possibly avoid going the FDF/PDF route, you will be better off.

  • How to create snapshot portlet and snapshot query using server API

    How to create snapshot portlet and snapshot query using server API
    Regards
    Dheeraj

    Hi Sebastian,
    I have used the query and it is working fine. but, How could i include the headers of the query also in to the Excel Sheet.
    RehaanKhan. M
    see the method discussed here
    http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to responce back HTML format to MVC using asembler API

    Hi,
    Now we are trying to build integration between MVC Web Application on Seesar2 framework(http://www.seasar.org/en/) and endeca commerce 3.1.1.
    In order to responce back the HTML page from endeca based on the query executed by MVC side, assembler API should return the format of HTML, however, it seems that Assembler API actually returns the contentItem data with which cartridge should be used, so assembler API responce as is cannot be used as HTML page output.
    Is there any way to generate the HTML page format using assembler API ?
    Also I've found following forum saying that Assembler API can be called by Spring MVC, but is it also applicable for other framework than spring ?
    https://qa.endecacommunity.com/questions/149/creating-endeca-dispatcher-using-spring-mvc-instead-of-assemblerjsp-in-endeca-310
    Re: How to use Spring MVC instead of assembler.jsp in endeca 3.1.0
    Thanks,
    Yuki

    Instead of writing HTML directly why not write an XML representation of your data and then use XSLT to create an HTML view and a PDF view. PDF can be generated from XML using FOP (http://xml.apache.org/fop/index.html).

  • Generate MDM_GID using ABAP API

    Hi all!
    Does anybody know how to generate unique MDM_ID while loading records to MDM from BI using ABAP API (it is done automatically when using OHD , but when doing manually - no idea).
    I tried to call INVOKE_STRATEGIES but nothing happened.

    Hi,
    You can refer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b01e4269-f744-2b10-929b-fa7b49aac540
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06a92de-614e-2b10-4989-d913c2154a64
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00f0d853-936f-2b10-1880-d3deb1fbd858
    Regards
    Nisha

  • Can i generate certificates using java api

    can i generate certificates signed by my private key using java API.
    I found cetificatFactory must generate a certificate from a file,
    but how can i generate this file?
    Thanks

    visit :
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/jarsigner.html
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html
    u can create ur own certificate
    Edward

  • How to post a document in the future using DI API?

    Hello friends
    Please can someone help me find a clever way around this....
    I am using SAP 2005 SP01 PL09. I am trying to add an invoice into SAP using a VB.Net application. I want to set the date for the invoice to a future date (e.g. 01/01/2008). The problem is that even though I have set the setting which "<b>Allows future Posting Date</b>" in SBO I still get a "<b>Date deviates from permissable range</b>" Error (-5002) when I try adding the invoice.
    I know that when I try post the invoice through the SAP <i>front end</i> (i.e. still posting it in 01/01/2008) I get a confirmation screen which pops up and says "<b>Posting Date later that System Date</b>" and I can either click on "<i>OK</i>" or "<i>Cancel</i>". If i click on OK the Invoice goes through no problem.
    This however does not work when i try use the DIAPI to do the same thing.
    How can i bypass this error when i use the DIAPI??
    Any help is much appreciated
    Greeshma

    Hello,
    if you want to escalate to SAP, I think you upgrade your SAP B1 to  the latest PL i.e. PL 36. Let me know if the error still persists after upgrading.
    Rgds,

  • How to remove element namespaces in XML file using DOM or SAX?

    Hi Guys,
    I developed a JAVA mapping in XI to add name spaces for XML file, after mapping,name spaces xmlns="http://www.mro.com/mx/integration" and xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" were added correctly, but for some nodes, such as <Header> and <Content>, a name space xmlns="" was added automatically.Please check below files to compare.
    It looks like be added automatically by XI. I didn't process anything for these nodes in JAVA program.
    Now the issue is, how can I remove these redundant namespaces? Such as xmlns="".
    Can I remove them using DOM or SAX in JAVA Mapping?
    Thanks in advance.
    ====>Original XML file
    <?xml version="1.0" encoding="UTF-8"?>
    <LLYLPPInterface language="EN">
       <Header>
          <SenderID>GBIP</SenderID>
          <CreationDateTime>2008-02-13T22:49:34-05:00</CreationDateTime>
          <RecipientID/>
          <MessageID/>
       </Header>
       <Content>
          <LLY-LPP>
             <INVOICE>
                <INVOICELINE>
                   <PONUM>4780000008</PONUM>
                   <POLINENUM>1</POLINENUM>
                   <INVOICEQTY>1</INVOICEQTY>
                   <LOADEDCOST>68</LOADEDCOST>
                </INVOICELINE>
             </INVOICE>
          </LLY-LPP>
       </Content>
    </LLYLPPInterface>
    ===>Target XML file after JAVA mapping
    <?xml version="1.0" encoding="utf-8"?>
    <LLYLPPInterface language="EN" xmlns="http://www.mro.com/mx/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <Header xmlns="">
              <SenderID>GBIP</SenderID>
              <CreationDateTime>2008-02-13T23:11:55-05:00</CreationDateTime>
              <RecipientID/>
              <MessageID/>
         </Header>
         <Content xmlns="">
              <LLY-LPP>
                   <INVOICE>
                        <INVOICELINE>
                             <PONUM>4780000008</PONUM>
                             <POLINENUM>0</POLINENUM>
                             <INVOICEQTY>1</INVOICEQTY>
                             <LOADEDCOST>68</LOADEDCOST>
                        </INVOICELINE>
                   </INVOICE>
              </LLY-LPP>
         </Content>
    </LLYLPPInterface>
    Edited by: Eddie Zhang on Feb 14, 2008 9:22 AM
    Edited by: Eddie Zhang on Feb 14, 2008 9:24 AM

    Hi Milan,
    Thanks for your replay.
    Actually when I used module XMLAnonymizerBean to convert namespaces, the header of XML, such as <?xml version="1.0" encoding="UTF-8"?> was converted to format <?xml version='1.0' encoding='UTF-8'?>, quote was converted to single quote. Although I set parameter anonymizer.quote = ", it still didn't work, single quote appeared instead of quote.
    I'm not sure why this happened. Can anyone help to clarify this?
    Thanks
    Edited by: Eddie Zhang on Feb 15, 2008 2:11 AM

  • How to put values in a HashMap dynamically using a ArrayList as 'value'

    i have to generate different maps dynamically by passing arraylist (which is also dinamically increasing) in the value.
    i want to use :
    List myList=new ArrayList();
    for(..........){
    Map mymap=new HashMap();
    myMap.put(key, myList.add(objectBean));
    =====================================================================================================
    this line is giving error :
    myMap.put(String , myList.add(objectBean));
    it says myList.add(objectBean) is boolean where as it should be put(String, ObjectBean).

    None of this makes any sense whatsoever. You're creating a new map per loop iteration, you're using an apparently constant key, and you're adding something that's a boolean when you should be adding an ObjectBean (according to you).

  • How to view pdf, xls files generated by using JasperExport

    I am using Weblogic Server 8.1 to deploy my project. I have some pdf, xls files that generated by JasperExport. Code: <br>
    Map parameters = new HashMap(); <br>parameters.put("donvi",DVi); String ConnectionURL ="jdbc:oracle:thin:@localhost:1521:qltb"; <br>Class.forName("oracle.jdbc.driver.OracleDriver"); <br>Connection jdbcConnection = DriverManager.getConnection(ConnectionURL,"qltb","qltb12345");<br> jasperReport = JasperCompileManager.compileReport("C:\\baocao.jrxml"); <br>jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jdbcConnection);<br> //JasperViewer.viewReport(jasperPrint); <br>JasperExportManager.exportReportToPdfFile(jasperPrint, "report.pdf");<br>
    report.pdf is exported to folder <br> C:\bea\user_projects\domains\cems ( cems is name of domain) . <br> But I dont know how to view this file or write relative path of this file For example : in test.jsp page I write Report 1 But it doesnt work.

    Install IronTrack SQL as described in the following link
    http://www.irongrid.com/documentation/irontracksql/install.html#install_oracle9iAS

  • How to enable Remote Management on multiple Macs using Workgroup Manager?

    Hi
    I want to use workgroup manager to enable remote management on multiple macs I manage.
    How can I do that?
    Regards,
    Omer Barel

    The only way I know to enable remote managment remotely is by running kickstart.
    http://support.apple.com/kb/HT2370
    If you are already using a login script you could run kickstart from there.
    We clone our Macs with remote management turned on.
    Otherwise, lace up your sneakers.   

  • How to enable forms extenstion for adobe reader using Acrobat SDK?

    Adobe acrobat GUI tool  enables PDF forms designers to extend the use of Adobe Reader and allow the end user to save the PDF form locally using the Reader.
    Is it possible to do the same kind of fuctionality at run time on the server using Acrobat SDK?.
    We are creating several PDF Form on the server, is there any way we can use Acrobat SDK to enable form's extenstions programatically on the server after the PDF is created.
    If Yes How? any code example?

    Not using the Acrobat SDK, no.
    However, Adobe sells the LiveCycle Reader Extensions Server that can be
    used on a server for exactly this purpose.

  • How to enable Rosetta at the system level using the command line?

    I need to find a way to enable Rosetta at the system level (e.g. all users) using the command line. When Rosetta is enabled, the following entry is created in ~/Library/Preferences/com.apple.LaunchServices (run defaults read com.apple.LaunchServices)
    LSPrefsFatApplications = {
    "com.apple.Safari" = (
    <00000000 009a0003 00010000 c323458f 0000482b 00000000 00000023 0000727b 0000c2b0 8b4e0000 00000920 fffe0000 00000000 0000ffff ffff0001 00040000 0023000e 0016000a 00530061 00660061 00720069 002e0061 00700070 000f0014 00090053 00650072 00760065 00720020 00480044 00120017 4170706c 69636174 696f6e73 2f536166 6172692e 61707000 00130001 2f00ffff 0000>
    Does anyone know what the data shown here is? It doesn't change when Rosetta is turned off and then back on. It also doesn't change between user accounts (e.g. joe's com.apple.LaunchServices.plist has the same value as jane's).
    Will it be possible to run defaults in a way that makes this change work for all users of the computer?

    I am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.

Maybe you are looking for