Editing XML programmatically.

Hi All,
I am getting an XML file, I am parsing it successfully , but I need some code to edit the same file. Is there any classes or APIs that do that or we will have to manually code for editing the XML and saving it and then sending back.
Thnx..
Amit

You need to do these w/XML:
1 fetch
2 read/parse
3 edit
4 save
5 send back
...lots of people (1) fetch and (2) parse XML via their iPhone app. Others seem determined to (3,4,5) bifurcate.
XML is just text, of course, and it can be trivial to just (3) edit and (4) save. If you want to reformat content (add instead of just edit), it gets a bit more interesting, of course.
It can get tricky when 5'ing since it depends on where you're 5'ing, which you haven't alluded to just yet. Are you creating a (redirected) new stream, such as an RSS feed and distributing it directly to clients...or...are you updating content on a host that will be then used as an RSS feed, etc.?
I'm guessing you can't 1 in other formats for obvious reasons, so you are stuck w/XML. I'm also guessing you're not 5'ing back to a host or you'd have already figured out it would be easier to let the host massage the content into XML instead. This means your only actual need is to write XML on the iPhone and everything else is secondary at this point.
Writing XML involves tagging, which can be done programmatically by creating a template and dumping your content in via filters. You'll need to write this since it is your content, with your tags and your filters.
Have you taken a look at TinyXML or TouchXML yet?

Similar Messages

  • Editing web.xml OR weblogic.xml programmatically

    Hi there,
    I am trying to edit the web.xml and weblogic.xml programmatically. I am trying to load the above deployment descriptors in DOM object. But as DTD is mentioned externally, connection to URL is failing.
    But weblogic.jar contains all DTD in local machine. Is there any way to make parser to refer DTD in weblogic.jar. Or any weblogic API available to edit the deployment descriptors programatically.
    Thanks in advance.
    I am getting following error.
    java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
    ction.java:512)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
    .java:489)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:617)
    at java.net.URL.openStream(URL.java:913)
    at weblogic.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityMan
    ager.java:836)
    at weblogic.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntity
    Manager.java:796)
    at weblogic.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDSc
    annerImpl.java:275)
    at weblogic.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.disp
    atch(XMLDocumentScannerImpl.java:841)
    at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume
    nt(XMLDocumentFragmentScannerImpl.java:329)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
    n.java:525)
    at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
    n.java:581)
    at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
    at weblogic.apache.xerces.parsers.DOMParser.parse(DOMParser.java:257)
    at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilder
    Impl.java:201)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:151)
    at JAXPandDOM.main(JAXPandDOM.java:39)

    I believe you could get around this with a custom EntityResolver. It's possible that Tomcat does something like this.
    However, I would question why you are trying to do this. If your container is set to Development mode, you might get away with the container automatically reloading your changes, but it certainly won't happen in Production mode, and even in Development mode, I don't know that I could predict how that would work.
    You'd be better off, with respect to portability and flexibility, if you store dynamic resources in an external file, not in the web.xml or weblogic.xml file. You could have a timed "watcher" for the file, to see when it's modified.

  • How can I edit XML results ?

    Hi,
    In the documentation I read about how to get the results of a query (in .xsql) as a XML-page using the XSQL Servlet. With forms I can insert data into the Database, but what about retrieving data from it and immediately edit and update it (combination of the two) ?
    What is the easiest way to achieve that ? I just want to update my data using XML as a data interchange format...
    thanks,
    Erik

    One of the difficulties would be locking
    your record.
    Without locking, it's just a matter of
    writing your XSL to enter data as a default
    value into text fields in a form.
    You could also use Transviewer Beans to
    create a Swing app to edit XML files.
    null

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • Editing xml in java

    hello everybody,
    i'm trying to write a java application for editing xml documents.
    I know It is possible to use xsl stylesheets to transform xml documents but it is possible to display the result of the transformation process in java?
    I mean,
    I make the transformation XML --->XSL ---->but i don't want to view the output in a browser!! I want to view that in my java application !!
    Can i display this output in swing objects?? Can i modify this output??
    Thanks to all.

    I make the transformation XML --->XSL ---->but i don'tYou mean XML+XSLT=>XML
    want to view the output in a browser!! I want to view
    that in my java application !!
    Can i display this output in swing objects?? Can i
    modify this output??Here is an example for saxon:
    // I didn't compile or run this code, please refer to API documentation for more detail instructions.
    // Transformer factory.
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    // XML source file
    File source_file = new File("xml_file.xml");
    // output file
    File outputFile = new File( "output.out");
    // Transformation source
    Source source = new StreamSource(source_file);
    // Transformation result
    out = new java.io.FileOutputStream(outputFile);
    StreamResult result = new StreamResult(out);
    result.setSystemId(outputFile.toURI().toString());
    // Must be synchronized by factory, since factory isn't thread safe
    synchronized (transformerFactory) {
    // obtain a transformer
    transformer = transformerFactory.newTransformer(new StreamSource(new File("xslt_template.xsl")));
    // perform transformation
    transformer.transform(source, result);
    As you can see, you easely can redirect result to your Swing editor.
    If you don't want to bother about streams and so on, you can use this example to write the result into the file, and open the file in your editor.

  • Editing XML in Dreamweaver

    Can you view and edit XML documents in dreamweaver?

    Yes;
    "paul_carron" <[email protected]> wrote in
    message
    news:ev00cn$ila$[email protected]..
    > Can you view and edit XML documents in dreamweaver?

  • How to edit xml using jdom

    hi
    how to read and edit xml file using jdom, i tried using
    javax.xml.transform.*; // JAXP
    javax.xml.transform.dom.DOMSource; //
    i can read xml file . but iam not able to edit the xml file.
    how to achive this

    1. Select nodes to be modified with the JDom XPath class selectSingleNode and selectNodes methods.
    SAXBuilder saxBuilder=new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    org.jdom.Document jdomDocument=saxBuilder.build(new File("c:/input.xml"));
    org.jdom.Element node= (org.jdom.Element)(XPath.selectSingleNode(jdomDocument,"/root/node"));
    2. Modify the node values with the Element class setter methods.
    3. Output document with the XMLOutputer class.

  • Editing XML File

    Any idea or url around for an example how to edit XML files
    with ASP.VB ?
    thanks fpr any reply
    Sebastian

    To modify an XML document obtain a DOM stucture of the XML file, select nodes with XPath expression, and modify nodes.
    http://otn.oracle.com/pub/notes/technote_domparser.html

  • How to edit xml using AS3

    I want to edit xml file on run time dynamically using AS3
    Plzzzzzzzz if it possible send the tutorials links or sample script.

    Flash player 10 has support for accessing local system file. This can be done using the FileReference class. You can browse a loca file, rad it and then save it back. But at the time of saving, the user is prompted to choose a location for saving the file.
    Else you can use some server side technology with your app to read and write files.

  • Can you edit xml files in adobe contribute

    can you edit xml files in adobe contribute

    No, you can't even open them in recent versions of PSE.

  • Help required to edit xml document

    I am new to java and xml compatibility.I just had familiarised SAX parser.
    I now want to familiarse the technology to edit xml document from a java program(more precisely write to an xml file).I came to know about many methods - JAXP DOM method,JAXB api method - and is totally confused.
    Can any body give me guidance about these api's and suggest a method that
    i should follow?
    i repeat that my application will have to frequently edit xml files
    Thank you

    Hi,
    it's very easy to edit and create XML. See examples in docs: http://livedocs.adobe.com/flex/3/langref/XML.html#includeExamplesSummary
    There are many examples how to get attributes and other data.
    You also can set attributes the same way.
    If you have concrete questions, ask.

  • Configure mapViewerConfig.xml Programmatically

    Is it possible to add a datasource entry to mapViewerConfig.xml programmatically so that we can avoid using the GUI?
    Is it a simple case of possibly using PERL to add our datasource entry to the .xml file and bouncing the J2EE tier or is there an API I can call to append my datasource?
    Thanks for any help.
    Duncs

    I presume your servlet is in a package called CheckServlets?
    ie it starts something like
    package CheckServlets
    public class HelloServlet extends HttpServlet {
    }Remove the / signs from the servlet-class. This attribute should be a fully qualified class name. Like java.lang.String, or com.mypackage.servlet.MyServlet
    Given the above servlet in a package, it should be
    <servlet>
      <servlet-name>test</servlet-name>
      <servlet-class>CheckServlets.HelloServlet</servlet-class>
    </servlet>Cheers,
    evnafets

  • Editing XML Through NAL

    Hey All,
    I am having a lot of trouble editing XML files through the NAL. I was
    hoping to be able to do it easily using the text editor built into the
    NAL, but have had no success. Changing the file extension to txt doesn't
    help either. Pretty much everyhtng leads to crashing the NAL or buffer
    overruns. Any help would be greatly appreciated.
    Thanks,
    Matt

    On Wed, 07 Nov 2007 20:40:26 GMT, Matt wrote:
    > I am having a lot of trouble editing XML files through the NAL. I was
    > hoping to be able to do it easily using the text editor built into the
    > NAL, but have had no success. Changing the file extension to txt doesn't
    > help either. Pretty much everyhtng leads to crashing the NAL or buffer
    > overruns. Any help would be greatly appreciated.
    what do you mean with editing xml through NAL?
    do you mean an application objects which changes stuff in a text file?
    if yes, how big is the text file, are there any special characters, doesn
    the file contain the stuff you want to change more than once?
    Marcus Breiden
    If you are asked to email me information please remove the - in my e-mail
    address.
    The content of this mail is my private and personal opinion.
    http://www.didas.de

  • Edit web.xml programmatically

    And another question
    Can I edit the web.xml from the web application, in session been for example. I want the admin user to add roles from the web application page and grant them to users.
    Then it should be created automatically in the database
    and in web.xml.
    Maybe it is possible to add it in data base but not to web.xml.
    is there a way?
    Thank you, I hope to get answers soon from you.

    There probably are options to do this, but all of them(the ones i know of atleast), are either too cumbersome or an over-kill.
    Why do you want to add security roles/grants for "users" in your "web.xml" ? Apart from compromising security, I think your definitely going to violate some standard there.
    As a general note: In the end, all xml files are parsed and converted to beans. XML files merely are a place holder for convenience. If required you can figure out the bean holding this information and accordingly change the info it.
    Alternatively if you're still persistent in adding this security information on your web.xml the only plausible way i can think of is old-school. Get a file writer and add/edit this info. But this idea is too crazy to even suggest.
    Best suggestion: Design your application in such a way, so as to pick the info from a DB and accordingly handle.
    Cheers,
    K

  • How get and edit xml code of BI Publisher Report

    Hi to all,
    I need to do some costumization to one BI Publisher report. Investigating I found a solution to do my costumization. However this requieres edit the xml code. Can you please let me know how can I get and edit this code?
    Thanks in advance
    regards
    Daniel

    obiee / ebs .... ?
    Investigating I found a solution to do my costumization. However this requieres edit the xml code.
    no need edit seeded code (it's for SR)
    your steps:
    - get seeded code
    - edit
    - create custom report
    Can you please let me know how can I get and edit this code?
    for ebs you can look xml publisher responsibility, find by code

Maybe you are looking for