Removing the user define comments while trying to write to the property fil

Hi All,
While using new Properies().setPropety(). It is removing the user define comments from property file.
Could you please explain me why it is happening and how can I restrict it
Thanks & Regards
Edited by: Rakesh83 on Feb 20, 2008 4:33 AM

Rakesh83 wrote:
Could you please provde me sample code for this?
#! /usr/bin/groovy
xml = '''
<config>
    <property name="foo" value="bar" comment="blah, blah, blah" />
    <property name="baz" value="qux" comment="doodle doodle dee" />
</config>
def config = new XmlParser().parse(new StringReader(xml))
def property = config.property.find { it.'@name' =~ 'baz' }
assert 'doodle doodle dee' == property.@comment
property.@value = 'snorp'
assert 'doodle doodle dee' == property.@comment // comments preserved!
// write xml as needed~

Similar Messages

  • LMS 4.2 compliance reports for the User-Defined Policy Groups.

    Dear team,
    I need your help to know if i will be able to export compliance reports in PDF or CSV for the User-Defined Policy Groups.
    I have checkedk the reports tab and i was able to export compliance reports in PDF format inly for the system defined policies but i couldn't i find any option to export these reports for the a user defined compliance policy.
    Kindly let me know if this is possible.
    Regards,
    Muhannad

    Dears,
    Do anyone have an idea about this question?
    Regards,
    Muhannad

  • How to get the tag of the User Defined Variables using the Get Tag method%3F

    For the cRIO modules under a cRIO Chasis, a tag value can be obtained using the Get Tag method with crio.Type to the TagName input of the method. When it comes to the User Defined Variables, what should be fed to the TagName input?

    For the cRIO modules under a cRIO Chasis, a tag value can be obtained using the Get Tag method with crio.Type to the TagName input of the method. When it comes to the User Defined Variables, what should be fed to the TagName input?

  • Exception while trying to write xml file

    When I try to write my DOM tree to an XML file a get the following exception form the transformer.transform() function call:
    Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: org.apache.crimson.tree.XmlDocument.getXmlStandalone()Z
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:373)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:127)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:662)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
    at CentMon.ConfigRW.writeConfig(ConfigRW.java:77)
    The whole thing worked for 2 years. I did not change anything on the code. the only difference is that i have now office 2007 installed instead of office 2003.
    That's the code which generates the exception:
    import java.io.File;
    import java.io.IOException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.SAXException;
    public void writeConfig(Document doc){
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    Transformer transformer;
    if (doc==null){
    System.out.println("Document is null");
    else{
    try {
    transformer = tFactory.newTransformer();
    } catch (TransformerConfigurationException e) {
    transformer = null;
    System.out.println(e.getMessage());
    DOMSource source = new DOMSource(doc);
    StreamResult result = new StreamResult(new File(filename));
    try {
    if (transformer != null){
    transformer.transform(source, result);
    } catch (TransformerException ex) {
    Logger.getLogger(ConfigRW.class.getName()).log(Level.SEVERE, null, ex);
    }

    I am getting the exact same error when trying to write out an XML file. I have been following the J2EE Tutorial. Perhaps I need to look for a more recent tutorial.
    Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: org.apache.crimson.tree.XmlDocument.getXmlStandalone()Z
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:373)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:127)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:662)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
    at com.wordhopper.xml.DOMXMLParser.writeXMLFile(DOMXMLParser.java:55)
    at com.wordhopper.gui.xmltool.XMLEditor.writeButtonActionPerformed(XMLEditor.java:217)
    at com.wordhopper.gui.xmltool.XMLEditor.access$100(XMLEditor.java:13)
    at com.wordhopper.gui.xmltool.XMLEditor$2.actionPerformed(XMLEditor.java:139)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6348)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6113)
    at java.awt.Container.processEvent(Container.java:2085)
    at java.awt.Component.dispatchEventImpl(Component.java:4714)
    at java.awt.Container.dispatchEventImpl(Container.java:2143)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
    at java.awt.Container.dispatchEventImpl(Container.java:2129)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • Get Error while update the User defined row table through DSK Code

    Hi experts,
    I have got an error while updating the user row defined table.
    Error is - "Invalid row"
    I have created one master table "@CBF_FARM " and Child table "@CBF_FAR1"
    First i inserted 5 record in the child table so in my my child table there are 5 Line id (1,2,3,4,5 one for each row).
    after that i delete 2 rows (3rd & 4th row) from child table now in my child table there are 3 rows( Line id 1, 2, 5). Please See attachment.
    Now i am updating  the last record of child table through Code  (Line id is 5)  from other form, then i got error  invalid row.
    Following Code used for updating the user defined child table.
      SAPbobsCOM.GeneralService oGeneralService1 = null;
                                    SAPbobsCOM.GeneralData oGeneralData1 = null;
                                    SAPbobsCOM.GeneralDataParams oGeneralParams1 = null;
                                    SAPbobsCOM.CompanyService sCmp1 = null;
                                    SAPbobsCOM.GeneralData oChild1 = null;
                                    SAPbobsCOM.GeneralDataCollection oChildren1 = null;
                                    sCmp1 = clsAddOn.LDNA_Company.GetCompanyService();
                                    oGeneralService1 = sCmp1.GetGeneralService("CBF_FARM");
                                    // Get UDO record
                                    oGeneralParams1 = ((SAPbobsCOM.GeneralDataParams)(oGeneralService1.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
                                    oGeneralParams1.SetProperty("Code", oForm.Items.Item("edtFarmCd").Specific.Value);
                                    oGeneralData1 = oGeneralService1.GetByParams(oGeneralParams1);
                                    // Add lines on UDO Child Table
                                    oChildren1 = oGeneralData1.Child("CBF_FAR1");
                                    // Create data for rows in the child table
                                    SAPbouiCOM.Item oItem = oForm.Items.Item("cmbShed");
                                    oCombo = oItem.Specific;
                                    string ShedCode = oCombo.Selected.Value;
                                    ldna_Rec = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                                    string strQuery1 = "select LineId from [@CBF_FAR1] where U_ShedCd = " + ShedCode;
                                    ldna_Rec.DoQuery(strQuery1);
                                    oChild1 = oChildren1.Item(ldna_Rec.Fields.Item("LineId").Value - 1);
                                    oChild1.SetProperty("U_Status", "Ready For Schedule");
                                    //Update the UDO Record
                                    oGeneralService1.Update(oGeneralData1);
    Please Help me it is an urgent requirement,
    -Regards
    Vikas

    hi.
    Error is - "Invalid row"
    Now i am updating  the last record of child table through Code  (Line id is 5)  from other form, then i got error  invalid row.
    As per my knowledge
    What i understood is you have 5 lines and you are going to be update 5th line
    am i correct..
    while u are updating the line in child table
    you have to consider like this..
    line number         u have to update like
    1                                        0
    2                                        1
    3                                        2
    4                                        3
    5                                        4
    which means in child table treat
    line 1  as 0
    line 2 as  1
    line 5 as 4
    If you want to update the line 5 u have to mention 4 th line

  • Can user enter comments while creating shopping cart?

    Hello All,
    While creating shopping cart, is it possible to enter some text/comment in one of the user defined attribute for the item? In other words I need to define a simple single value chracteristics that is ready for input during shopping cart creation. This comment I need to enter before transferring item to the shopping cart. System is CCM2.0
    Regards,
    Ram
    Message was edited by: Ram Sahu

    Yann,
    To make it more clear, here are the steps I am performing:
    1. Search for catalog item in a catalog.
    2. Select the catalog item.
    3. Go to the items detail screen of the selected item.
    4. In this screen, I need to enter some additional information. May be an attribute ready for free text input. Here I tried, documents/attachements. But that doesn't serve the purpose.
    5. After entering comments, transfer/add the item to shopping cart.
    6. Save the shopping cart.
    So, step 4 is where I am looking to enter comments.
    Regards,
    Ram

  • Reg: Configuring the User-Defined Message Search

    Hi Experts !
    I am getting an error while configuring the user defined message search.
    Followed all the step mentioned in the sap help documentation.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/48/c85598f63335bfe10000000a42189d/frameset.htm
    The last step, where we need to enter  URL for WSDL Access i am getting the following error:
    Error in WSDL access: Exception occurred in communication framework:
    Error in HTTP Framework:404Not Found
    http://<Host>/<Port>/MessageSearch/MessageSearchImplBean
    You should enter the host name and the HTTP port for the Advanced Adapter Engine
    i didnt get the meaning of above sentence : Is it different from what we use in the URL to access ESR and ID.
    Is there any other steps to make   MessageSearch/MessageSearchImplBean available
    Regards,
    Srinivas
    Edited by: Srinivas on Oct 1, 2010 7:48 PM

    Hi José Omar,
    thanks for the reply...
    I tried manual configuration but with no luck..opened a similar forum thread
    I have applied the sap note suggested  ,thinking that the error is due
    to any source code.
    The data synchronization is happening properly , but when i use test extractor button it throws the above mentioned error.
    In the system details  in have given the port number as 50700(which is visible in the link when we open integration builder page) and ESR client as 001.
    could you please let me know if the exact values to be filled in transport setting.i just entered the port and client , other things
    as default.
    Regards,
    Srinivas

  • I am unable to connect to the icloud from my windows laptop and get an error message: "Connection error: icloud encountered an error while trying to connect to the server"

    I am unable to connect to icloud from my windows-based laptop and get the following error message: "icloud encountered an error while trying to connect to the server."

    I would remove the email account from mail and then set it up again.
    If your are able to long I via owa though without the auto fill, then we already know the user name and password are correct.
    Let me know if that works.

  • Trying to setup new iCloud in system preferences and get error message: "iCloud encountered an error while trying to connect to the server."

    Here's the sequence of events:
    Setting up a new iMac.
    Migration Assistant was aborted during setup and a normal setup was completed.
    Then ran Migration Assistant from the newly setup account.
    It ran fine, but put all the data in a new account called "user".
    Renamed "user" to a new name, renamed the home folder to a new name following these instructions: OS X: How to change your account name or home directory name
    Delete the account we originally created, so just have one account with the name we want and all the data, email. Works fine.
    Sign into the App Store with the account we share for purchases.
    Now, the problem:
    Go to System Preferences to setup iCloud with a new Apple ID
    Get this error: "iCloud encountered an error while trying to connect to the server."
    So I'm unable to setup iCloud for photo stream, FaceTime, etc.
    Internet works fine, we can get mail, etc.
    Rebooting doesn't help
    Ideas?

    never mind the problem is gone this morning.

  • "The following errors occurred while trying to open this page." Why?

    Dear all,
    I'm running an online store at http://bubblething.com. I created it with iWeb 08. It crashed and I've been trying to recreate it, partly from images retreived by Apple from their "webarchive" and partly with images created fresh. I But I keep getting a dropdown error box saying "The following errors occurred while trying to open this page." Then there's a list of the missing images, and the images are all crossed out on my page. This seems to be happening unpredictably, sometimes just a few days after I've worked on the page. What's happening? Is it because somehow I've moved files, and the links to the images are broken? Please help!

    Safari > Preferences > Privacy > Cookies and website data:
    Click “Remove All Website Data” button.
    https://support.apple.com/en-us/HT203370

  • When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • I keep getting an error that "iCloud encountered an error while trying to connect to the server". What's up?

    I've been getting an error most of the day that says "iCloud encountered an error while trying to connect to the server" on my pc. Also, anything I update on either iPad or iPhone does not update on the other device. What's up?

    Hello pongo19,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/ts1567
    Close iTunes and disconnect the iPhone, iPad, or iPod touch.
    Click the Windows Start button .
    In the Start Search field type Services.
    In the Programs section of the search results, Click "Services".
    Select Apple Mobile Device and click Stop the service as shown below:
    After the service has stopped, click Start the service.
    After the Apple Mobile Device service has started again, open iTunes and connect the device.
    Set the Apple Mobile Device Service Startup type to Automatic
    Remove and reinstall iTunes and AMDS
    Best of luck,
    Mario

  • Dose oracle.sql.ArrayDescriptor support the user defined type in package?

    Hi folks:
    I get a obstacle in calling stored procedure by using JDBC driver (ojdbc14.jar).
    I have the following code:
    create or replace package xxx AS
    type var_table is table of varchar2(50);
    procedure(parameter in var_table);
    end xxx;
    When I use the jdbc driver try to create a type for
    oracle.sql.ArrayDescriptor arrayDes = oracle.sql.ArrayDescriptor.createDescriptor( "var_table ",connection);
    The SQLException is thrown out like those:
    Invalid name pattern:user_schema. var_table
    So, my question is : Dose oracle.sql.ArrayDescriptor not support the user defined type in package? And I also tried to define such type by using sql "create xxxx" outside of package, then there is no SQLException.
    Hopefully for your response and suggestion.Thanks...

    To my knowledge, the Oracle JDBC driver does not support using the ArrayDescriptor for array data types (varray or nested table) that are defined inside of a package. The same is true for StructDescriptor as well. If you want to use array and object data types, you must define them outside of a package. Then you'll be able to use the descriptors in your JDBC programs.

  • System ID in the user defined function

    Folks,
    I am trying to get the system id of the XI system with in the user defined function. How can I get it? I have looked into the technical context objects/contants and could not find any which gives you the XI system ID (3 character system ID).
    Any input is greatly appreciated.
    - Shanth

    Hi,
    Adding to the link whihc Michael has given...
    There is another system property which gives sap system name...rather than taking 'user.name' and parsing....
    Please the code below.....
    System.getProperty("SAPSYSTEMNAME");
    this returns the 3 letter system id.....i got XID !!!!
    Thanks,
    Renjith

  • APP-ALR-04106: Please correct the user-defined SQL statement for this alert

    Hi All,
    I have created an alert for engineering module in R12. It got tested and was working fine. when the user testing it, while trigger the alert getting the error, "APP-ALR-04106: Please correct the user-defined SQL statement for this alert".
    when verified the alert, it got verified and ran also. It parsed the query successfully and when run it fetched few records.
    Need help in resolving the issue.
    Thanks in advance.
    Regards,
    sri
    Edited by: user10939296 on Jan 18, 2010 1:16 AM

    Hi Sri;
    I have already gone through the Note: 948037.1. But this note is related to 11i. The solution provided in the Note is for 11i.
    I am facing this issue in R12. Is this patch applicable to R12?I belive its not. But u can check Solution part 4 for your instance, at least it can give you idea. The other note in metalink related bug and all for R11 too.
    I belive its better way to rise Sr while waiting other forum user response to that thread
    Regard
    Helios

Maybe you are looking for