How to Display XML in a UIWebView?

Hi everybody. I like how Safari displays XML files and I would like to emulate that functionality in an iPhone UIWebView. However, I just can't get it to look the same when passing a URL to the UIWebView.
For example, take a simple XML file like http://molottery.com/rss-num.xml. Viewing that in Safari looks okay, but passing that same URL into a UIWebView just shows a blank page.
I changed the web protocol from http to feed (feed://molottery.com/rss-num.xml) and it launches the page in Safari instead of my UIWebView. Looks good, but it quit my app... :- (
I noticed that XML files on the iPhone get re-routed through reader.mac.com so I tried appending that to my URL (http://reader.mac.com/mobile/v1/http://molottery.com/rss-num.xml) but that did not work either.
When I tried URLEncoding the string like Safari does (http://reader.mac.com/mobile/v1/http%3A%2F%2Fmolottery.com%2Frss-num.xml) I get a UIWebView saying that "This Application Is Viewable Only On iPhone".
So how can I emulate the regular Safari XML functionality inside my UIWebView? I will post my code upon request, if that will help. Any assistance from the Developer Community would be greatly appreciated.
Thanks!

You may have better luck in the iPhone dev forums...
https://devforums.apple.com/community/iphone/web

Similar Messages

  • How to display xml to html using xsl?

    hi all...may i know how to display xml to html page?
    i ve included <xsl:output method="html" indent="yes" /> inside my xsl file. i clicked on output.xml file and everything is displayed correctly but the format is xml instead of html. is there anyway to transform it to html?
    below are my xsl and xml codes:
    // xsl file
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes" />
    <xsl:template match="/">
    <html>
    <body>
    <h2>Document Contents</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
         <th align="center">Document Name</th>     
         <th align="center">Document ID</th>          
         <th align="center">Owner</th>               
    </tr>
    <xsl:for-each select="Document/Contents">
    <tr>
    <td><xsl:value-of select="DocumentName"/></td>
    <td><xsl:value-of select="DocumentID"/></td>
    <td><xsl:value-of select="Originator"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    // xml file
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="xsltStyleSheet.xsl"?>
    <Document>
         <Contents>
              <DocumentName>register</DocumentName>
              <DocumentID>1</DocumentID>
              <Originator>hhh</Originator>
         </Contents>
    </Document>
    </xsl:template></xsl:stylesheet>

    your XSL transforms to HTML (in fact XHTML): what more do you expect? did you expected anything different from the following output? if yes: what and why?
    <html>
         <body>
              <h2>Document Contents</h2>
              <table border="1">
                   <tr bgcolor="#9acd32">
                        <th align="center">Document Name</th>
                        <th align="center">Document ID</th>
                        <th align="center">Owner</th>
                   </tr>
                   <tr>
                        <td>register</td>
                        <td>1</td>
                        <td>hhh</td>
                   </tr>
              </table>
         </body>
    </html>

  • How to display XML file that XI sent to my j2ee appl?

    Hi,
    In my scenario File->XI->J2EE appl.
    I got XML page cannot be displayed.
    XML document must have a top level element. Error processing resource 'http://localhost:7001/Invoke/DisplayRes'.
    I deployed my .ear file on BEA Weblogic application server9.0
    I found no error when i tested in SXI_MONI and RWB->Message monitor as well.
    This is my servlet code:
    public class DisplayRes extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         doPost(request,response);
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
         PrintWriter out = response.getWriter();
         response.setContentType("text/xml");
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);       
             //out.setContentType("text/xml");
             //out.println(sBuf.toString());
             out.write(sBuf.toString());
              brin.close();
             out.flush();
    What went wrong.All helpful answers are highly rewarded.
    Thanks

    Hi
    Can anyone tell me how XI sends messages to applications like J2EE. In REceiver comm channel, I think we specify about the target system like J2EE appl.
    Aadapter Type: HTTP
                   Receiver
    Transport Protocol:  HTTP1.0
    Message Protocol:    XI payload in HTTP body
    Adapter Engine:      Integration Server
    Addressing Type:     URL address
    Target host:         localhost
    Service Number:      7001(Port number of Weblogic appl server--where my J2EE appl is deployed).
    Path     :  /Invoke/DisplayRes/
    Authentication Type:Use Logon Data for SAP System
    Content Type: text/xml
    Username:   xiappluser
    password:   xx
    XML code:   UTF-8
    I suppose XI sends msgs to http://localhost:7001/Invoke/DisplayRes/........
    in this example if am correct?
    Then I have given all tyhe necessary setting but my servlet is not able to display XML msg in browser?
    This is my servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         PrintWriter out = response.getWriter();
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
            response.setContentType("text/xml");
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);
             out.println("hi");            
                out.println(sBuf.toString());
             brin.close();
             out.flush();
    What went wrong?
    Help me, all helpful answers are highly rewarded.
    Thanks

  • How to display Xml in a JEditorPane(in an applet)

    Hi All,
    I have an applet and i want to display xml in a JEditorPane in an applet. This xml document has a xsl attached to it for transformation. How can i do the transformation??
    Help or sample code or link to a sample code is highly appreciated!!!!
    Thanks
    Ragu

    Look this servlet which does a transformation. JEditorPane could call this servlet (with the method setPage) to do the transformation:
    public class SampleXSLTServlet extends javax.servlet.http.HttpServlet {
    public final static String FS = System.getProperty("file.separator");
    // Respond to HTTP GET requests from browsers.
    public void doGet (javax.servlet.http.HttpServletRequest request,
    javax.servlet.http.HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException
    // Set content type for HTML.
    response.setContentType("text/html; charset=UTF-8");
    // Output goes to the response PrintWriter.
    java.io.PrintWriter out = response.getWriter());
    try
    javax.xml.transform.TransformerFactory tFactory =
    javax.xml.transform.TransformerFactory.newInstance();
    //get the real path for xml and xsl files.
    String ctx = getServletContext().getRealPath("") + FS;
    // Get the XML input document and the stylesheet, both in the servlet
    // engine document directory.
    javax.xml.transform.Source xmlSource =
    new javax.xml.transform.stream.StreamSource
    (new java.net.URL("file", "", ctx+"foo.xml").openStream());
    javax.xml.transform.Source xslSource =
    new javax.xml.transform.stream.StreamSource
    (new java.net.URL("file", "", ctx+"foo.xsl").openStream());
    // Generate the transformer.
    javax.xml.transform.Transformer transformer =
    tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource,
    new javax.xml.transform.stream.StreamResult(out));
    // If an Exception occurs, return the error to the client.
    catch (Exception e)
    out.write(e.getMessage());
    e.printStackTrace(out);
    // Close the PrintWriter.
    out.close();

  • How to display xml attributes in Layout (indesign cs2)

    Hi,
    Javascript
    Indesign CS2
    PC Version
    Any one tell me, i want to display the ids in the margin. i read xml attribute, but i didn't know how to display to the margin. Help me.

    One way of doing that is to use JDOM...
    u create an xml tree, and then output using XMLOutputter class...it will be displayed in text...im not sure if thats what u want...however, if u do want to represent it visually then u may need to draw a tree...u may use the Graphics2D for that...there are alot of ways to do such thing, and the 2 possibilities arent the best...depends on what u want...elaborate more pls.

  • How to display XML content in a JSP

    Hi,
    can anyone help me in displaying xml content in a JSP?

    I think you want to display value from XML page to the
    JSP.If thats the case you can try out this
    xml...
    <component-profile>
            <property name="parm" value="Hi"/>
    </component-profile>
    jsp...
    <% var=profile.getProperty("parm");%>
    Hope this helps
    gEorgE

  • How to display XML file in java swing

    hi all
    now i do my M.Sc., project on data maining.this time i have one problem,thats i can't display XML file in swing frame.so any one know this plz give me that idea or code.
    Thanks to all.
    RSK

    One way of doing that is to use JDOM...
    u create an xml tree, and then output using XMLOutputter class...it will be displayed in text...im not sure if thats what u want...however, if u do want to represent it visually then u may need to draw a tree...u may use the Graphics2D for that...there are alot of ways to do such thing, and the 2 possibilities arent the best...depends on what u want...elaborate more pls.

  • How to display XML file(as markup) in jsp page..?

    Hi All,
    * I have to display the XML file(as markup) in jsp page (Tree Format)....
    * My XML file is an java.io.file object , and how to view this XML file on my JSP page...........
    Thanks in Advance,
    JavaImran

    You mean you want to see the XML source?
    You need to replace the characters '<' and '&' with corresponding entities '&lt;' and '&amp;'. You can use replaceAll, but do the ampersands first.
    Then I suggest you probably want to put them in a <PRE> block.

  • How to display XML file in browser using Servlets?

    Hi My XML file is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:purchase_order_MT xmlns:ns0="http://filetohttp.com">
    <ORDER_HEADER_IN>
    <purchase_date/>
    <purchase_group/>
    <purchase_org/>
    </ORDER_HEADER_IN>
    <vendor/>
    <ORDER_ITEMS_IN>
    <item>
    <storage_location/>
    <plant/>
    <quantity/>
    <material/>
    </item>
    </ORDER_ITEMS_IN>
    <ORDER_SCHEDULES_IN>
    <item>
    <delivery_date/>
    </item>
    </ORDER_SCHEDULES_IN>
    </ns0:purchase_order_MT>
    My Servlet receives this XML file and it should display the above XML as it is, How to do that?
    Please help me I have posted same question in many forums but i got no proper reply.
    Thanks a lot

    If you only need to display it, consider your HttpServletRequest just as byte stream. :) Just read from ServletInputStream and write it back into ServletOutputStream of HttpServletResponse.
    If you want to process incoming XML, please give some details first, what exactly you want to do. :)

  • How to display XML generated dynamically, as TREE in cluster environment

    hai guys,
    we are generating a tree.xml file in server side as follows.
    path = getServletConfig().getServletContext().getRealPath("/QBE/jsp/tree.xml");
    BufferedWriter out1 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path),"UTF8"));
    out1.write(xmlString + "</tree>");
    out1.close();
    "xmlString" holds the data in xml tag format.
    in order to display the xml file in TREE structure, we are using a function like
    function createTree()
         var tree = new WebFXLoadTree("SMQ/AMQ List", "tree.xml");
         document.write(tree);
    ALL THIS MECHANISM IS WORKING FINE IN DEVELOPMENT ENVIRONMENT ANS AS WELL AS WHEN WE DEPLOY THE RELEASE IN LOCAL MACHINE. BUT IT IS NOT WORKING WHEN THE RELEASE IS DEPLOYED IN CLUSTER ENVIRONMENT.
    Please help me out how to solve this...
    thanks in advance,
    Ranga
    Edited by: Ranganatha on Jun 5, 2008 5:18 AM

    Hey if you want any more information regarding this problem, i can provide.

  • How to display XML file as is it is in my browser using servlets???

    I have a question like my servlet receives an XML file in its request object. I just need display the same XML file as it is in my browser. How to do that? Please help me out. I have searched so many blogs, but i did not get right solution.
    My XML file file will be like this:
    <ns0:Http_Message_Type_Demo xmlns:ns0="http://abcdemo.com">
    <Name>A</Name>
    <RollNo>123</RollNo>
    <Address>a2</Address>
    </ns0:Http_Message_Type_Demo>
    Thnks

    You mean you want to see the XML source?
    You need to replace the characters '<' and '&' with corresponding entities '&lt;' and '&amp;'. You can use replaceAll, but do the ampersands first.
    Then I suggest you probably want to put them in a <PRE> block.

  • How to display XML document

    Hello All.
    I am using Apex 3.0.1.x. I've uploaded an XML file into an XMLTYPE column in a table and am now trying to display this XML data in an Apex report region.
    I saw a beautiful example of doing this in Denes Kubicek's wonderful demo app 31517, page 90. Here's the link to this page:
    http://htmldb.oracle.com/pls/otn/f?p=31517:90
    I copied the procedure code he uses to display the XML into a package. Here's the code I'm using:
    <pre>
    PROCEDURE DISPLAY_XML (P_ID IN INTEGER)
    AS
    V_PROC VARCHAR2(100);
    V_ERRMSG VARCHAR2(300);
    V_MIME VARCHAR2 (48);
    V_LENGTH NUMBER;
    V_FILE_NAME VARCHAR2 (2000);
    V_LOB_LOC BLOB;
    XML_TO_BLOB_ERROR EXCEPTION;
    BEGIN
    V_PROC := 'ONLINE_MODEL_PKG.DISPLAY_XML_DEVICES';
    V_ERRMSG := NULL;
    SELECT DECODE(V('APP_USER'),NULL,'N','Y')
    INTO V_HTML_FLAG
    FROM DUAL;
    BEGIN
    SELECT X.MIME_TYPE,
    PROC_FUNC_PACK.CLOB2BLOB(X.DEVICE_XML.GETCLOBVAL()),
    X.DEVICE_FILENAME
    INTO V_MIME,
    V_LOB_LOC,
    V_FILE_NAME
    FROM XML_DOCS X
    WHERE X.ID = P_ID;
    EXCEPTION
    WHEN OTHERS THEN
    V_ERRMSG := SUBSTR('ERROR ('||V_PROC||'): DURING DISPLAY OF XML DATA: '||SQLERRM, 1, 300);
    RAISE XML_TO_BLOB_ERROR;
    END;
    V_LENGTH := DBMS_LOB.GETLENGTH (V_LOB_LOC);
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    OWA_UTIL.MIME_HEADER (NVL (V_MIME, 'application/octet'), FALSE);
    -- SET THE SIZE SO THE BROWSER KNOWS HOW MUCH TO DOWNLOAD
    HTP.P ('Content-length: ' || V_LENGTH);
    -- THE FILENAME WILL BE USED BY THE BROWSER IF THE USERS DOES A SAVE AS
    HTP.P ( 'Content-Disposition: filename="'
    || V_FILE_NAME
    || '"'
    -- CLOSE THE HEADERS
    OWA_UTIL.HTTP_HEADER_CLOSE;
    -- DOWNLOAD THE BLOB
    WPG_DOCLOAD.DOWNLOAD_FILE (V_LOB_LOC);
    EXCEPTION
    WHEN XML_TO_BLOB_ERROR THEN
    V_ERRMSG := PROC_FUNC_PACK.FORMAT_MSG(V_ERRMSG, V_HTML_FLAG);
    RAISE_APPLICATION_ERROR(-20010, V_ERRMSG);
    WHEN OTHERS THEN
    V_ERRMSG := SUBSTR('ERROR ('||V_PROC||'): '||SQLERRM, 1, 300);
    V_ERRMSG := PROC_FUNC_PACK.FORMAT_MSG(V_ERRMSG, V_HTML_FLAG);
    RAISE_APPLICATION_ERROR(-20020, V_ERRMSG);
    END DISPLAY_XML_DEVICES;
    </pre>
    I then invoke this packaged procedure in an iframe, just like what Denes is doing. I put the following code in my report region source field:
    <pre>
    DECLARE
    v VARCHAR2 (500);
    BEGIN
    v :=
    'SELECT '
    || '''<iframe src="#OWNER#.ONLINE_MODEL_PKG.DISPLAY_XML?p_id='
    || :p53_id
    || '"'
    || ' height="800" width="950"></iframe>'''
    || ' document_display'
    || ' FROM DUAL';
    RETURN v;
    END;
    </pre>
    When I run the report in Intenet Explorer (version 6.x), I get a strange security warning popup asking if I want to display unsecure items. When I click "Yes", the report region shows up with a "Could not find web page" error 404 inside the report region.
    I then tried running the app in Fire Fox (version 2.0.0.15). This time I do not get any security warning, but the report region shows up with the message "Procedure Doesn't Exist".
    Another page in my app calling other procedures in my package, and so, I know that Apex is "seeing" the package.
    Does anyone know why I'm seeing these strange things? And, is there, perhaps, another way to display an XML document in an Apex page?
    Thank you.
    Elie

    Hi Arthur,
    I assume you are using EP6.0, below SP3.
    The XML Forms can be displayed using standard SAP layouts only. There is a special type of servlet. This alongwith the CSS is applied when you click to display the "Show" form.
    As far as I know, there is no other way to display as you want to. You can probably get more help by specifying the exact scenario.
    Hope this helps you.
    Regards,
    Sagar

  • How to display xml code in page?

    Hi,
       I have a string which content is a xml file, I want to display the content of string in xml mode, such like dispalying a xml file in IE browser. How to do it?
        Thanks a lot!

    set the MIME type of the page to "text/xml".
    while creating the page if you create it with extention .xml, the system would automatically set this for the page.
    and just place the string holding the XML in the layout .
    <%=stringholdingxml%>
    Regards
    Raja

  • How to display xml sting as tree , using af:tree

    Hi, i need to display a xml string stored in the data base table, as a xml tree in GUI.
    I understand ADF having a component called <af:tree> . It expects input data as "oracle.adf.view.faces.model.TreeModel" type.
    how to convert the string format of xml stored in the database , to the required type " "oracle.adf.view.faces.model.TreeModel"".
    Is there any examples to do this. Thanks .
    ganesh

    Thanks for the post.
    I looked at the link , before posting my question. That;s not i what i want. It says,
    The Oracle ADF Framework includes a Data Control for URL Services (a.k.a URL Service Data Control). The URL Service Data Control provides the ability to access files (CSV, XML) through a URL. You can also utilize this Data Control to access Servlets and JSPs that return simple, textual data such as XML data. In this How To, the URL Service Data Control will be used to access the JDeveloper RSS News feed and present that data within a Rich Client Interface. You will need JDeveloper 11g, available from OTN, to give this a try. Also provided is the Application that is utilized in this How-To.
    But what i want is entirely different than URL data control.
    A table is having xml file as string (The size can go upto 1 mb. )
    In the GUI i need to display it as tree.

  • JEditorPane - How to display XML Linked HTML File in JEditorPane ?

    Dear Friends,
    I have a HTML File consisting of stylesheet, xml linked (for data) and with headers, footers...
    When i called a ordinary html file using setpage property of JEditorpane..it's working no problem...but when i call the html file having xml linked or buttons...it's not properly displayed....
    If anybody hits this problem....pls...help me....
    Regards,
    V.Prasanna

    If you only need to display it, consider your HttpServletRequest just as byte stream. :) Just read from ServletInputStream and write it back into ServletOutputStream of HttpServletResponse.
    If you want to process incoming XML, please give some details first, what exactly you want to do. :)

Maybe you are looking for

  • How to use Oracle database in CR XI R2!!!

    Hi All, I am having Oracle database in onsite machine. I need to design the report without DSN and installing Oracle in my machine. I dont know how to use connection String and Find DSN file option. Please anyone help me to solve the issue. Thanks in

  • Loss in video quality

    Hello all, I wrote a program which display several screens one after an other in a loop. One of these screen displays a video using JMF. The first time this video is displayed the quality is perfect but the second time and the next times the loss in

  • Mx_internal_uid property being added to one of my data classes

    So I have a data object of a custom class, which just has a set of properties like the following: name: type: location: source: target: but somewhere and sometime randomly Flex/Flash adds to it a new property named mx_internal_uid: (some long number)

  • GTS error while GR

    All, I m trying to do MIGO for a PO. But its saying the below error : SAP GTS: Legal Control: Purchase order xxxxxxx is locked Please tell tell me how to unlock this. 1. Whether this is a material based settings ? Thanks,

  • Resolution for the below error

    Hi Gurus, facing the below error when trying to run/save/access IBots even though the BI Scheduler is up and running fine. Oracle BI Scheduler Error: [nQSError: 12008] Unable to connect to port 9705 on machine localhost. [nQSError: 12010] Communicati