Hi all! I want to display xml file that i receive in my request object.

I am a newbie to servlet technology, my requirement is like thsi:
the XML file is like this:
<ns0:Http_Message_Type_Demo xmlns:ns0="http://abcdemo.com">
<Name>ABC</Name>
<RollNo>123</RollNo>
<Address>a-2</Address>
</ns0:Http_Message_Type_Demo>
I will receive an xml file in my HTTPRequest object. How to display the xml file as it is in browser.
Please help me Its urgent!
Thanks in advance!

Hi
please have a look at the test code which generates a static xml code , might be the change reqd here is that the request you are getting is xml which has to be passed to the response object
public class test extends HttpServlet
  public void doGet
    HttpServletRequest  req,   // This provides information sent by the browser
    HttpServletResponse res    // This is used to send information back to the browser
  ) throws
    ServletException,          // General exception that should be thrown if there
                               // is a unrecoverable error in the Servlet
    IOException              
    // Set the MIME type for the information being sent to the browser.
    // In this case, we are going to send back HTML
    <i> <b>  res.setContentType( "text/xml" );</b></i>
    // Get a reference to the output stream.
    // Anything written to this stream is sent directly to the browser
    // (The browser sees this as its input).
       ServletOutputStream out = res.getOutputStream();
    // The following println statements create an HTML page.
    // Notice that the <html></html>, <head></head>, and <body></body>
    // tags are all properly formed HTML syntax.
       out.println("<?xml version=\"1.0\"?>" );
       out.println("<?xml:stylesheet type=\"text/xsl\" href=\"file:///c:/servlets/test.xsl\"?>");
       out.println("<persons>");
       out.println("<person><firstname>Oren</firstname><lastname>Ben-KiKi</lastname></person>");
       out.println("</persons>");
hope this helps , please mark helpul answers
regards
rajeshkr

Similar Messages

  • 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 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 can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Is there any way to display a file that contains text and pictures

    Hi all,
    I was wondering if java has any way to display a file that contains both text and pictures. I have tried using the RTFEditorKit and using an RTF file and it only diplays the text contained in the file and omits the pictures all together.
    code:
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.rtf.RTFEditorKit;
    public class Test
         JScrollPane scroll;
         JEditorPane edit=new JEditorPane();
         RTFEditorKit kit=new RTFEditorKit();
         public Test()
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         edit.setEditorKit(kit);
         edit.setEditable(false);
         try
              kit.read(new FileReader(new File("Installation.rtf")),edit.getDocument(),0);
              catch(Exception e)
                   JOptionPane.showMessageDialog(null, e);
         frame.getContentPane().add(new JScrollPane(edit));
         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              frame.setBounds(0,0,screenSize.width, screenSize.height);
         frame.show();
         public static void main(String[] args)
    new Test();
    Please help!
    thanks in advance,
    Denise

    Not good as that usually means the project itself was corrupt.
    Any chance you sync'd to Creative Cloud? That's the only way I know of that backs up your PS Touch (PSDX) files.

  • Where to place an xml file that is read by  java class file  dir structure

    Hello all,
    I have an xml file that I am using in lieu of a database to track conference rooms . This is a small file. I need to read this file from my java class file which is used by a jsp. Currently I have an absolute path C://logger/conference.xml. All works fine but I need to deploy to a different machine soon and so I need to place this file somewhere in the project directory structure (created by netbeans) so that it will be included in the war file and can be read by the java class file.
    Also what would be the relative path to this suggested directory.
    TIA!!!

    public class DOMconference {
        /** Creates a new instance of DOMconference */
        public DOMconference() { }
        //private final static String XML_FILE_NAME = "/opt/conference.xml";//set the output file and location
        public String XML_FILE_NAME = "";
        private final static String FIRST_CONF_ID = "8200";//set the initial conference number
        static Document document;
        public void getFilePath(String path)
            XML_FILE_NAME = path.replaceAll("\\\\","/");
            System.out.println("XML==============="+XML_FILE_NAME);
        File file = new File(XML_FILE_NAME);
        *generic method that returns a Document object
       public Document getDocument() throws SAXException, ParserConfigurationException,
               IOException
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           factory.setIgnoringComments(true);
           factory.setCoalescing(true);
           factory.setNamespaceAware(false);
           factory.setValidating(false);
           DocumentBuilder builder = factory.newDocumentBuilder();
           document = builder.parse(file);   //HERE IS WHERE THE ERROR POINT S TO
           return document;
       }Here is the complete error:
    INFO: Server startup in 1282 ms
    XML===============C:/Documents and Settings/gforte/agi/build/web/WEB-INF/conference.xml
    [Fatal Error] bin:1:1: Content is not allowed in prolog.
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:172)
    at agi.DOMconference.getDocument(DOMconference.java:91)
    at agi.DOMconference.getLdapConferences(DOMconference.java:466)
    at agi.Ldap.getConferences(Ldap.java:243)
    at org.apache.jsp.test_jsp._jspService(test_jsp.java:111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    [Fatal Error] bin:1:1: Content is not allowed in prolog.
    NotifyUtil::java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:606)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:571)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:248)
    So if I change my code to this (note that all I change is how the constant XML_FILE_NAME is set and I copy and paste the path that is derived from getFilePath after the String.replaceAll call.):
    public class DOMconference {
        /** Creates a new instance of DOMconference */
        public DOMconference() { }
        private final static String XML_FILE_NAME = "C:/Documents and Settings/gforte/agi/build/web/WEB-INF/conference.xml";//set the output file and location
        //public String XML_FILE_NAME = "";
        private final static String FIRST_CONF_ID = "8200";//set the initial conference number
        static Document document;
        public void getFilePath(String path)
            //XML_FILE_NAME = path;//.replaceAll("\\\\","/");
            System.out.println("XML==============="+XML_FILE_NAME);
        File file = new File(XML_FILE_NAME);
        *generic method that returns a Document object
       public Document getDocument() throws SAXException, ParserConfigurationException,
               IOException
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           factory.setIgnoringComments(true);
           factory.setCoalescing(true);
           factory.setNamespaceAware(false);
           factory.setValidating(false);
           DocumentBuilder builder = factory.newDocumentBuilder();
           document = builder.parse(file);
           return document;
       }All is fine..
    Just in case, here is my xml file contents copy and paste from notepad.
    <?xml version="1.0"?><conf_rooms><conf_room><conf_id>8200</conf_id><conf_name>Conference room 1</conf_name></conf_room><conf_room><conf_id>8201</conf_id><conf_name>Conference Room 2</conf_name></conf_room><conf_room><conf_id>8202</conf_id><conf_name>dufus</conf_name></conf_room></conf_rooms>Thanks for hanging in there with me on this.
    Graham

  • Reading a XML file that does not have namespace

    Hi,
    I have a customer who sends XML files that has no namespace (no first line which has xmlns tag).
    It has a proper XSD, however I am unable to read this using File-Read as an XML file.
    Any suggestions ?
    (eg) file looks like below:
    <EdiAcknowledgementOut>
    <SchemaVersion>1.0</SchemaVersion>
    <FileType>PO</FileType>
    <CustCode>PII</CustCode>
    Thanks,
    Revathi

    Hi Naresh,
    The "rejectedMessage" property is for 10G, I am not 100% sure about its implementation in 11G.
    In 10G the faulted XML file moves to this location "Oracle_Home\bpel\domains\domain_name\jca\project_directory\rejectedMessages".
    This property is used to move the files which are not valid XML or which are not schema compliant. For DB polling I don't think this property is used.
    -Yatan

  • HT202887 I want to share a file that is 500 meg (video) can this be done via cloud?

    I want to share a file that is 500 meg (video) can this be done via iCloud?

    yes, my kids live 30 to 50 ,lies away and my brother in law 300 miles.
    You get the ip address of the TC using airport utility. Don't use the local lan number such as 10.0.3.12
    Using the Finder go to the top of the Desktop and select Go then connect to server,  type afp://that ip number , leave the user name alone and type in password. The TC hard drive should show on the Desktop.
    You have to set it up first using Airport Utility: launch it and go to the Disks tab. Check box enable file sharing and share disks over wan, choose secure disk with a password  and type in your password. The other person will need to know the password.
    You can now copy files over to the TC i.e. upload and download files.

  • Change PDF files that I receive to Word.

    All I want to do with Adobe is change PDF files that I receive to WORD. I want this to be a process explained in simple terms.

    Hi Dizzy Dame,
    I see that you have an ExportPDF subscription. I'll do my best to explain it in easy-to-follow steps!
    Log in to your account at https://cloud.acrobat.com/exportpdf using your Adobe ID and password.
    Click Select PDF Files to Export.
    Click Choose Files from My Computer.
    Browse to the file that you want to convert, and select it.
    Click Choose.
    Choose Microsoft Word Document from the Export Format pop-up menu.
    Choose the language to use for text recognition (English is the default).
    Click Export to Word.
    Please let us know how it goes. These steps are also spelled out in Getting Started with ExportPDF | Adobe Community (so you may want to bookmark that page in your browser for reference.)
    Best,
    Sara

  • How to go to the location of file that I received ...

    How to go to the location of file that I received on skype? I was able to do it easily in old version. 
    Now, I recieved the zip file. If I click on the file, it shows the Zip File View. I don't know where that file is downloaded. (of cuz, need to dip where I set the download path.) In old version of Skype, there is a link where we can open the file in windows explorere.
    I would suggest that the Skype UX or development team needs to read "Don't make me think" short book. 
    Update: There are other people who reported the issues in 2013 http://community.skype.com/t5/Modern-Windows-from-​Windows/Where-are-the-files-saved-that-someone-sen​... Please don't copy all metro skype UI to skype desktop without thinking about usability and royal user expereince. Thanks! 
    Note: Another thing: THis forum seems like it let me post without me logging in. But when I submit the context, it redirects to login page. So, I chose to login with my account and it redirect back me to this forum and the post that I wrote a few min ago was totally gone.. Seriously? 
    Solved!
    Go to Solution.
    Attachments:
    Fuck New UI.png ‏9 KB

    What about this?
    Attachments:
    ShowInFolder.jpg ‏28 KB

  • 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 do you display xml file with xlst sheet in jsp

    I have an xml file with accompanying xslt file (and several images that are used in a single directory. If I doubleclick on the xml file, it displays perfectly in my browser - Formatting, images and all!
              The 100 dollar question - How do I duplicate this behavior in a JSP page in WebLogic 8.1 using the code in the xml and the accompanying xslt (formatting) file? I tried simple embedding the xml code in the jsp, but that didn't seem to work. What is the secret?
              Okay, I need to add a bit more information here. I understand that it is really easy to just redirect to the XML file. The issue is really security. I want the XML to be inside a jsp that will only allow validated users to view it.
              Another way to look at the problem would be, can I add a jsp security tag to the xml file? Or how to I add the xml code inside a jsp and keep the path references to the xslt and graphics.
              Hope the added information helps
              Thanks,
              Ken
              Message was edited by: KLee - 20050609 10:25 MST
              [email protected]

    This proved out to be the answer. Thanks for the direction!
              import java.io.File;
              import java.io.IOException;
              import java.io.InputStream;
              import java.io.OutputStream;
              import java.io.FileNotFoundException;
              import java.io.FileOutputStream;
              import javax.servlet.ServletException;
              import javax.servlet.http.HttpServlet;
              import javax.servlet.http.HttpServletRequest;
              import javax.servlet.http.HttpServletResponse;
              import javax.xml.transform.Transformer;
              import javax.xml.transform.TransformerConfigurationException;
              import javax.xml.transform.TransformerException;
              import javax.xml.transform.TransformerFactory;
              import javax.xml.transform.stream.StreamResult;
              import javax.xml.transform.stream.StreamSource;
              public class XML_XSLT_Servlet extends HttpServlet {
              protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
                        String xmlfile = req.getParameter("xmlfile"); if (xmlfile==null) xmlfile = "test.xml";
                        String xsltfile = req.getParameter("xsltfile"); if (xsltfile==null) xsltfile = "test.xslt";
                        /* Test if file exists!, or use default file */
                        File f1 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xmlfile);
                        File f2 = new File(getServletContext().getRealPath("WEB-INF/displayfiles/"), xsltfile);
                   if (f1.exists() && f2.exists()) {
                             // System.out.println("Files Found");
                        } else {
                             System.out.println("XML and XSLT Files NOT Found");
                             System.out.println(f1.getPath());
                             System.out.println(f1.getName());
                             xmlfile = "test.xml";
                             xsltfile = "test.xslt";
              InputStream fileXML = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xmlfile);
              InputStream fileXSLT = getServletContext().getResourceAsStream("WEB-INF/displayfiles/" + xsltfile);
              OutputStream os = res.getOutputStream();
              TransformerFactory xFactory = TransformerFactory.newInstance();
              StreamSource stylesheet = new StreamSource(fileXSLT);
              Transformer xformer = null;
              try {
              xformer = xFactory.newTransformer(stylesheet);
              } catch (TransformerConfigurationException tfce) {
              tfce.printStackTrace();
              StreamSource input = new StreamSource(fileXML);
              StreamResult output = null;
              try {
              output = new StreamResult(os);
              } catch (Exception e) {
              e.printStackTrace();
              try {
              xformer.transform(input, output);
              } catch (TransformerException xfe) {
              xfe.printStackTrace();
              <pre></pre><pre></pre>

  • Writing a formatter in java to display XML file in an organized display

    i have to write a formatter that reads in an XML file and outputs something..like a text file that displays the XML content. Normally when you open XML in text file, all u say is one line in which all the content is displayed..i want to wirte a program that will read in the XML and output a text file which shows the XML content in the same way like wen u view it on a browser..
    thanks

    ok here you go....this is rough and probably buggy.
    Needs some real testing and refactoring and still does not work with
    <! and
    <?
    tags, but for simple XML it should do about what you want.
    import java.io.BufferedReader;
    import java.io.FileReader;
    public class XMLParse
        private static String OPEN_TAG = "OPEN_TAG";
        private static String CLOSE_TAG = "CLOSE_TAG";
        private static String SLASH = "SLASH";
        private static String LETTER = "LETTER";
        private static String SLASH_LETTER = "SLASH_LETTER";
        private static String GET_VALUE = "GET_VALUE";
        private static int INDENT_LEVEL = 4;
        public static void main(String[] args) throws Exception
            FileReader file = new FileReader( "props/test.xml" );
            BufferedReader fileInput = new BufferedReader( file );
            StringBuffer sb = new StringBuffer();
            String s;
            while ( (s = fileInput.readLine()) != null )
                sb.append( s );
            parseXmlString( sb.toString() );
        public static void printIndent(int x)
            for ( int i = 0; i < x * INDENT_LEVEL; i++ )
                System.out.print( " " );
        public static void print(String s)
            System.out.println( s );
        public static boolean isWhiteSpace(char c)
            boolean isWhite = false;
            if ( c == '\n' || c == '\t' || c == ' ' )
                isWhite = true;
            return isWhite;
        public static void parseXmlString(String s)
            char[] chars = s.toCharArray();
            int indentLevel = -1;
            String state = "";
            String latestTag = "";
            for ( int i = 0; i < chars.length; i++ )
                char c = chars;
    if ( state.equalsIgnoreCase( GET_VALUE ) || !isWhiteSpace( c ) )
    switch ( c )
    case '<':
    if ( state.equalsIgnoreCase( GET_VALUE ) )
    printIndent( indentLevel + 1 );
    print( "*" + latestTag );
    state = OPEN_TAG;
    latestTag = "";
    break;
    state = OPEN_TAG;
    latestTag = "";
    break;
    case '>':
    if ( state.equalsIgnoreCase( SLASH ) )
    indentLevel--;
    printIndent( indentLevel + 1 );
    print( "+-" + latestTag );
    state = CLOSE_TAG;
    break;
    if ( state.equalsIgnoreCase( SLASH_LETTER ) )
    printIndent( indentLevel + 1 );
    print( "-" + latestTag );
    state = CLOSE_TAG;
    break;
    printIndent( indentLevel );
    print( "+" + latestTag );
    state = CLOSE_TAG;
    break;
    case '/':
    if ( state.equalsIgnoreCase( OPEN_TAG ) )
    indentLevel--;
    state = SLASH;
    break;
    default:
    if ( state.equalsIgnoreCase( OPEN_TAG ) )
    indentLevel++;
    latestTag += c;
    state = LETTER;
    break;
    if ( state.equalsIgnoreCase( CLOSE_TAG ) )
    latestTag = "";
    latestTag += c;
    state = GET_VALUE;
    break;
    if ( state.equalsIgnoreCase( LETTER ) )
    latestTag += c;
    state = LETTER;
    break;
    if ( state.equalsIgnoreCase( SLASH ) )
    latestTag += c;
    state = SLASH_LETTER;
    break;
    if ( state.equalsIgnoreCase( SLASH_LETTER ) )
    latestTag += c;
    state = SLASH_LETTER;
    break;
    if ( state.equalsIgnoreCase( GET_VALUE ) )
    latestTag += c;
    state = GET_VALUE;
    break;

  • How to format and display xml file as displayed in IE

    I want to display the xml file as it is displayed in Internet Explorer. Which component I should use and how?
    Thanks in advance
    Sachin

    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.

  • List all documents types in a XML file...

    Hi, i want to list all document files that are on the portal and make a XML file with result. I found the Interface Query where i can use "search" method. Is there a way to use the APIs from hyperion, i try to do a servlet and obtain a list of all document type like with NAME, DATE CREATED, TYPE, UUID, DESC, etc.. The list can be order by NAME, DATE, etc... And put the result in a XML file. Is it possible to do this with that Hyperion API, or i spend my time to find the solution with this restricted/limited APIs? And first, is there a documentation for the developpers on what we can do with API's Hyperion? The JavaDoc Hyperion just give a little bit information, nothing consisting!! Thanks in advance for any help : [email protected]!Max

    hello
    you can rename the wsp with a.rar or a.cab extension and take a look inside
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

Maybe you are looking for