Reading in an xml template

I want to create an MS word template in xml, put a set of "fields" in it, read it into my java program, put in variables instead of the fields and then output it.
I know it is possible i just dont know how to do it. The fields will be like ##date## and i'll be using replaceAll() to put in to variables. Has anybody out there done anything like this before or know anything that might be of help.
thanks

Now I understand what you're saying. You're talking about the xml-format that word says it supports ... never looked into it, but I'll asume for a moment that it's real XML ;-)
DOM is the document object model and is the in-memory representation of an XML structure (see the API of org.w3c.dom for documentation). You get it by parsing the XML file with an XML parser (google for a tutorial, if needed, it's not that hard).
You shouldn't treat an XML file as a plain text file (i.e. just read line by line, replacing stuff), because XML got too many little things to consider and it's much easier to let the XML parser handle that stuff).

Similar Messages

  • Flilter webpart to read the data from XML template

    Hi
    Is there any out of the box webpart to read data from xml file for filtering in sharepoint 2010.
    The filter dialog look like following functionality and allow to select only one value.
      .Paretn1
         chiild1
         child2
     .Parent2
         child1
         child2
    Thanks

    Hi,
    According to your post, my understanding is that you wanted to read data from xml file with the out of the box web part.
    There is no out of the box web part for us to read the data from the xml file in SharePoint 2010.
    However, you can create your own custom web part to achieve it.
    There are some articles about the read the xml file, you can have a look at them.
    http://mosshowto.blogspot.com/2008/10/simplify-xpath-use-c-class.html
    http://social.technet.microsoft.com/Forums/en-US/6ae03f7a-23fe-4361-9e4f-d82bd3802ebf/how-to-read-data-from-an-xml-file-in-sharepoint-2010s?forum=sharepointgeneralprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Working with Flash content in XML template

    My knowledge base of html and DWCS3 is limited. My knowledge of Flash CS3 is better and have built a web site using it.
    This is a newbie DW question. Am working on an XML template, which contained the following folders:
    site_flash folder containing:  main_v8.swf, tfile_main.xml, style.css, index (firefox doc) (+gallery stuff)
    flash folder containing: main_v8.swf, main_v8.fla, tfile_main.xml, AC_RunActiveContent (JSS file) (+gallery stuff)
    I was told by the template people to use the site_flash folder but there are no visuals (Design views), to work with and could not access Flash through DW to alter the files in Flash. When I can get a Design view in DW, all I get is the f symbol. In all the tutorials I've watched on DW, there is a Design view to work with.
    SO, I used the flash folder and adjusted the main layout in the .fla file to suit my needs, and worked on the tfile_main.xml document in DW and they seemed to be 'talking' as my changes were recognized. When I test the file from either Flash or DW, it is perfect. But when I run it from my test folder through the server, the page formatting is off (page pushed down, menu buttons squashed, etc). There is no style.css sheet in the flash folder.
    Am willing to go back and start over with the site_flash folder with CSS page if this will resolve things, but don’t know how to edit the flash layout through DW. I need a Design view…am very weak in the html side of things.
    Test run:  http://www.mackenziemode.com.au/test.html
    Any advice you can give would be helpful.
    The Not-feeling-so-Handy Ma'am  

    In followup to my own frenzied query, in case anyone else is having the same problem, the solution to the 'squashed'
    web site (that's works perfectly on testing outside the browser) is to upload the main.xml file in binary mode.

  • Issue generating pdf from xml template, data and StreamServer webservices

    We purchased Abode LiveCycle Premium Print ES4. It included a product called StreamServe which we planned to use to merge xml templates and data into a pdf file using a StreamServe webservice (for developers). It seems the StreamServe webservices are not equal to that task.  Can anyone offer a hint how this automated pdf generation can be achieved using LCPP?  (I suspect it can be done using Workbench but I don't know this to be a fact.)
    TIA,
    Bill

    Was that another shameless book plug??
    Sorry, gotta run. I just got word the Fed Ex delivery of my copy of your book just arrived. Do you 'e-sign' personalized copies?
    p.s. The preview of Chapter 7 (Transforming XML with XSLT) is great and filled with good clean examples and explanation.

  • XSL-XML Templates

    Hello,
    My requirement is generate xml output file using BI Publisher. I think xsl-xml template will generate xml output from xml extract.
    Is there a easy way of developing xsl-xml templates using BI Publisher for given XML Extract? I know we can write a xsl file manually but looking for a tool where I can drag and drop. I read this article: http://blogs.oracle.com/xmlpublisher/entry/building_xsl_templates
    However, In my Jdev, I do not see an option of Inregration tier to map. Any info. on this is greatly appreciated.
    Thanks

    I have changed the filter but still not showing up Integration tier. I am on JDev 11g Release2. Please let me know if I have to switch to different version of JDev or any other settings that I need to do.
    Thanks again for your info.

  • OBIEE Writeback error - The system is unable to read the Write Back Templat

    Hi all,
    I'm trying to set up the write back feature for one of the reports. All the set up up including XML file in the custommessage folder is done.Ensured the webmessage name tag value (pmet_update) is same as the one used in the report write back template value etc.
    Also the server is restarted after the latest XML file(as shown below) is copied after all type of debugging with similar threads on this matter.
    But when i click on the update button in the report (button is highlighted), i'm getting the error
    "The system is unable to read the Write Back Template 'pmet_update'. Please contact your system administrator."
    here is the xml.
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="pmet_update">
    <XML>
    <writeBack connectionPool="PMTCOG">
    <insert></insert>
    <update> UPDATE XREF_PMET_URL SET URL= '@{c1}' WHERE API='@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Could you please help?

    Hi,
    I think that you have to spacify also an SQL statement for the update tag, for example:
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="pmet_update">
    <XML>
    <writeBack connectionPool="PMTCOG">
    <insert> select null from dual</insert>
    <update> UPDATE XREF_PMET_URL SET URL= '@{c1}' WHERE API='@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    The witeback wants for both the tags (<insert></insert> and <update></update>) an SQL Statement.
    For me it works.
    Let me know!
    Gianluca Ancarani

  • Write Back Error The system is unable to read the Write Back Template 'test

    Write Back Error The system is unable to read the Write Back Template 'test'. Please contact your system administrator. OK
    But, the update button is on.
    It did work and now it doesn't... nothing of course that we know of has changed. We got this message when we started and the name of the file was what we put as template name in obiee instead of webmessage name but the update button was off.... now we have update button on and same error.
    File is on unix and we have made 777 so it's open to the world.
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="D_EXEC_METRIC">
    <WebMessage name="test">
    <XML>
    <writeBack connectionPool="writeback">
    <update>UPDATE D_EXEC_METRIC SET EXEC_METRIC_ICON_WID = @{c3}, EXEC_METRIC_COMMENT='@{c7}' WHERE SECTOR_WID=@{c0} AND EXEC_METRIC_WID=@{c2}</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    thanks in advance for your help!

    You're better off searching for an answer to this question in the [OBIEE Forum|http://forums.oracle.com/forums/forum.jspa?forumID=378].
    The topic is discussed at least twice a month so there's tons of posts with all the answers you need. Make a forum search for writeback and you'll have your answer.
    Cheers,
    C.

  • 10g - write back - The system is unable to read the Write Back Template

    hi,experts,
    I enabled write back on a report.
    the button (write back) is enabled (not grey)
    but when I click the button, there is a message
    The system is unable to read the Write Back Template 'UPDATETESTWRITEBACK'. Please contact your system administrator.
    I put UPDATETESTWRITEBACK.XML in C:\OracleBI\web\msgdb\customMessages
    the syntax in the xml is correct.
    what is the result? any log to check?

    Its not mandatory to have the same template name as your xml file name.
    But the <WebMessage name= "UPDATETESTWRITEBACK"> should be same what the templetae you are using in the webcat.
    Please find sampel xml which can have any xyz name in the folder "OracleBIData\web\msgdb\customMessages'
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web.messageSystem">
    <WebMessageTable lang="en-us" system="WriteBackTemplates" table="Templates">
    <WebMessage name= "ResourceAllocation">
    <XML>
    <writeBack connectionPool="--your connection pool name">
    <insert> Insert statement </insert>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Cheers,
    Rajeev A

  • Calling PL/SQL stored procedure from XML template

    I've a requirement to call a store procedure/function/package from XML template. How can i achieve this?

    >
    XML template
    >
    do you mean "data template" with sql statement?
    below using package in sql statement and data structure element for data template
    <?xml version="1.0" encoding="UTF-8" ?>
    <dataTemplate name="XXCUSTOM_PKG" defaultPackage="XXCUSTOM_PKG" version="1.0">
    <sqlStatement name="Q_INVOICES">
    select
    XXCUSTOM_PKG.invoice_type()
    from <some_table>
    </sqlStatement>
    <dataTrigger name="beforeReportTrigger" source="XXCUSTOM_PKG.beforereport"/>
    <dataStructure>
    <element name="in_title"  dataType="varchar2" value="XXCUSTOM_PKG.in_titleformula()"/>     
    </dataStructure>
    <dataTrigger name="afterReportTrigger" source="XXCUSTOM_PKG.afterreport()"/>
    </dataTemplate>or it's xml data for report?

  • Procedure for read/write an XML-File using UCCX9

    Hi Team!
    Is there someone who can explain me the procedure of reading/writing an XML-File using Cisco UCCX Rel. 9.0?
    In the last couple of days I did a lot of research on the partner community as well as reading the CRS-Editor-PDFs.
    But I can’t find a solution.
    There are some templates available but they all didn’t seem to work.
    I have two xml-files, both uploaded to “Document Management\en_us\”.
    The script itself is attached to this posting.
    I build that my script according to a sample script I found in the community.
    From my point of view I have configured my script exactly like the sample script.
    But it still doesn’t work.
    I am especially interested in where to store the the appropriate files.
    I would be very happy if there is someone who can explain me, what’s wrong there.
    Many thanks in advance.
    Kind regards
    Michael

    I'm experiencing the same issue [reading XML causes errors that say things from "no such file" to some odd Java exception.] I'm able to use a template XML file and after authenticating a user, transform the template into a proper XML file and then successfully save it to the en_US Doc Repository with updated values.
    However, no matter what I've tried or who I've asked, the READ on the XML file so that I can actually script something that does some routing based on the value of the XML file created in my first script? Ultra fail.
    I've even worked with three separate TAC IPCC engineers who were able to reproduce the issue in their test environment, but they were unable to assist. Eventually, whe pressed, I received this response from the last IPCC engineer.:
    "Hello Brad,
    Yes I know what I provided you with is what you already have achieved and this missing step is precisely what you need: how to setup the script to check the status and value of this XML document and then decide routing according to the state.   But unfortunately this is what I found internally.  The other resources are the ones you already know:  support forums, scripting guides.  The other resource with suggest to customer looking for script assistance is the Cisco Account Manager of your company, they know where to get the resources for such issues.   Then again as I mentioned before on our phone conversation TAC does not support scripting but certainly if I find something else on my side I will let you know for sure."
    I would do ponderous cartwheels of joy if someone who has this working in version 9.x [9.0.2 specifically] could share the deep magic.

  • Importing XML Templates

    Hi,
    Currently I am using Adobe Framemaker to import XML templates and make tables of data. Once the data has been imported into Framemaker it is easy to manipulate (change colours/sizes of columns etc.)
    However, I am looking for a way to do this work in InDesign.
    So far, I have tried importing the XML template into InDesign successfully, but as soon as I try to change columns/delete columns, basically make any changes to the table, InDesign freezes, and I have to restart the program.
    The XML document is very large (4,089 rows in excel) and imported from Excel.
    I am using CS4 on Windows XP.
    Can anyone help ?

    Does InDesign freeze if the table is not tagged? (i.e. untag the table and perform the column changes.)

  • Using ANT to create config.xml template

    Does anyone have an example on how to use ant to create a config.xml template?

    try this:
    <target
         description="Creates the config.xml file from the config-template.xml file"
         name="parseConfigXML">
         <copy
              file="config-template.xml"
              tofile="config.xml"
              overwrite="true"
         />
         <replace
         file="config.xml"
         value="defaultvalue"
         replacefilterfile="local.configtemplate.properties">
         </replace>
         <antcall target="parseSetDomainEnv" />
    </target>

  • XML template not updating

    Hi
    I have a data definition and a template registered.
    When i make changes to the xml template and upload it still shows the same old output.
    ie when i run the concurrent proram i am getting the same old template layout.
    i tried to change few labels on the template and uploaded,but the concurrent program still picks the old template.
    Can any one help me regarding this.
    Thanks in advance.

    Hi,
    Try this and see if you still get the same Output
    Save the XML Output of the Concurrent Program
    After making changes to Template, load XML Data and see preview of the Output in the Stand alone.
    or
    Check whether Data Definition and Template are Assigned Accordingly
    Regards
    JDev..

  • How to convert DTD files into XML(template) by using Java ?

    I am a beginner to java,and want to convert a random DTD file
    into a XML template(having no data).
    any guys can give me some suggestions ?
    thanks very much

    DTD allow you to validate a XML file.
    To do so, you can use API such as dom or xalan.
    To transform an XML file from a vocabulary A to vocabulary B, you have to write a XSLT style sheet, and use xerces to perform the transformation.
    Using tools such as XSL-FO, you can transform your XML into PDF.

  • SMDIAG_WIZARD and XML template for EWA

    Hi all experts,
    I'm in SolMan 4.0 SP12 want to make a EWA report from Enterprise Portal 6.0.
    1) I have a problem when I run SMDIAG_WIZARD to my Enterprise Portal 6.0. error : <i>Localization failed: ResourceBundle='com.sap.engine.services.rfcengine.RFCRes jktgrhxsapepq (RC=)</i>
    any idea?
    2) I also try to setup from host:port/smd/wizard . On managed system setup, I can't go to the next step for setup.
    Error in troubleshooting :
    <i>XML Template could not be read : com.sap.engine.lib.xml.parser.ParserException: XMLParser: Bad Attribute value(:main:, row:2, col:15)(cause=com.sap.engine.lib.xml.parser.ParserException XMLParser: Bad Attribute value (:main:, row:2, col:15))
    </i>
    where's the location of xml template that to be transfered in SolMan system ?
    Thanks n Regards,
    adh

    Hi,
    You should not use the smd/wizard and troubleshooting section. If you managed system is not yet setup please follow chapter 4.5 of
    https://websmp201.sap-ag.de/~sapdownload/011000358700000548322007E/Setup_Guide_Solman40SPS12.pdf.
    But all you are doing there is not correlated with EWA. You will be able to setup EWA as soon as SMD has been completely setup. For more information about EWA for non ABAP please see <b>SAP Note 976054</b>.
    Regards,
    Stephan

Maybe you are looking for

  • How to create a system recovery USB drive?

    My U845-S406 crashes every 15 minutes with a BSOD referencing iastor.sys. Multiple diagnostics say it is all good. Multiple virus softwares say it is clean. It crashes even quicker in safe mode. I have the latest Toshiba raid drivers, but updated to

  • When should applets  be used

    i'm doing a student database project,which stores student details and allows the updations or deletions to be performed.It also performs additional operations for different categories of users like admin users,normal users,HOD,etc. now i'm confused w

  • Getting the error "Authentication failed."

    Hi, I am getting the error +"Authentication failed. If problem persists, please contact the system administrator"+ while login to OEM12c grid console as sysman user. I thought it was sysman password related and set the new password at DB level and OM

  • Determine Drive Info From Crystal Reports - Free Space & Drive Size

    I am looking for a way to determine drive information in crystal reports. I know you can report on files and directories but I'm looking to report: Drive Size Free Space Is it possible to use Visual Basic or Crystal commands to provide this info? Any

  • HELP I love my music

    I have 356 songs total that are all still on my iPhone, but suddenly only 40 of those songs are on my iTunes account on my laptop. How can I get all the music on my iPhone 4S back on my iTunes?