Xml to jsp transformation

Hi All,
I have an xml file created from database which contains certain fields in french.
Now using this file as input source and a xsl file i am creating a jsp. In the xml file all the french characters appear as in database, but after transformation into jsp i get encoding problems.
I am using StringBuffer and FileOutputStream to write to the xml file.
If I donot change the transformer OutputProperty my jsp displays fine in web server but French characters are all messed up.
If I use "utf-16" encoding in transformation
i.e if i set the transformer as follows:
transformer.setOutputProperty("encoding", "utf-16");
characters in the jsp generated are all correct but I cannot bring up my jsp in web server.
Any suggestions please.
Thanks
Rajeev

Okay, you know how to set the encoding in the transformer. That's one step. Another step is, you have to set the encoding in your OutputStream to be the same. You haven't showed how you're using your OutputStream, you just said you were using a FileOutputStream which surely must be a misprint, as the rest of your post suggests you are sending the XML to the JSP's response. Also, you have to set the encoding of your HTTP response to be the same encoding you used everywhere else, using its setCharacterEncoding() method.
I would suggest ISO-8859-1 for your encoding, since that covers all Western European characters and all browsers understand it.

Similar Messages

  • How to update the value in xml file using transformer after setNodeValue

    Hi,
    This is my code
    I want to set update the values in xml file using transformer..
    Any one can help me
    This is my Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    Jsp Page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <% String str="";
    String str1="";
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    out.println("Before change");
    NodeList n11 = doc.getElementsByTagName("name");
    Node n22= n11.item(0).getFirstChild();
    str1 = n22.getNodeValue();
    out.println(str1);
    out.println("After change");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    node.setNodeValue(name);
    NodeList n1 = doc.getElementsByTagName("name");
    Node n2= n1.item(0).getFirstChild();
    str = n2.getNodeValue();
    out.println(str);
    catch(Exception e)
    out.println(e) ;
    %>
    <h1><%=str%></h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>

    hi check this exit...
    IWO10012

  • Best way to create, modify, XML with JSP ?  HELP

    Hi friends,
    As i am new to XML,
    I know there are two APIs used for XML processing, i want to know as a begineer level, which API
    is easy and good to implement XML with JSP.
    1) SAX
    2) DOM
    i want to make a log file in XML, so on web page it will be displayed on HTML form through XSL.
    Since there is good tutorial on http://www.w3schools.com/dom
    but i think its HTML dom
    I want XML procession through JAVA CODE , what should i use ? and give some good tutorials on XML DOM
    that is used with JAVA / JSP.
    HELP.
    Edited by: Ghanshyam on Sep 19, 2007 3:24 PM

    Well what i think is you gonna checkout with your requirements before implementing any of the popular XML parsing mechnisms.
    If you are intrested in faster processing @sacrifising a gud amount of your Memory,DOM is the one which you are looking for.
    If you are instrested in Managing your memory and but if you are ok with sacrifising speed SAX is the best solution.it works on what is called a push technology.
    and if you think either way you might have to look towards a pull parser which is StAX (Streaming API for XML Parsing)
    it'd be a gr8 idea if you can go through the below article which explians about each of the parsing mechanisms
    http://www.stylusstudio.com/xml/parser.html#*
    coming back to helpful resources as far java is concern checkout the below link which might be of some help.
    and the main thing is that all of these parser there is a defined specification you might find implementations of different vendors on this.
    eg:Sun Provides one with JDK itself,same as IBM provides one,oracle does the same & so on...
    your first task would be to focus on one such implementation which can cater your requirements.
    DOM:*
    Basic Parsing Objects / Interfaces Involved while DOM parsing:
    http://www.w3.org/TR/DOM-Level-2-Core/java-binding.html
    Breif Overview & few important API details:
    http://www.developerlife.com/domintro/default.htm
    Simple Example:
    http://www.brics.dk/~amoeller/XML/programming/domexample.html
    Others:
    http://www.roseindia.net/xml/dom/
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM.html#wp79994
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/1_read.html
    SAX:*
    http://www.javacommerce.com/displaypage.jsp?name=saxparser1.sql&id=18232
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/index.htm
    http://java.sun.com/developer/Books/xmljava/ch03.pdf
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPSAX.html#wp69937
    http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=6
    StAX:*
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP2.html
    http://javaboutique.internet.com/tutorials/stax/
    http://today.java.net/pub/a/today/2006/07/20/introduction-to-stax.html
    Hope this might be of some help :)
    REGARDS,
    RaHuL
    http://weblogs.java.net/blog/spericas/archive/2006/04/sun_stax_parser.html

  • How to Pass values from XML to JSP??? Urgent Please Help me

    Hi guys,
    I am new to XML, I want to pass values from XML to JSP. I have a xml file with attributes, I should send this values to a JSP file. How is it??? Please Help guys.... its very urgent. Please send me how to do it with an example or atleast any urls related that....
    Looking for ur favourable reply.
    Thanks in advance,
    Sridhar

    in a servlet :
    parse your xml file (see how at the end of the post) and
    put the values you want in the request attributes
    request.setAttribute("value1", value1);
    ...redirect to the jsp
    in the JSP:
    get the wanted attributes:
    String value1=(String)request.getAttribute("value1");To learn how to parse a xml file, pay a look at this page, it explains how to read the XML document to build an object representation, and then how to navigate through this object to get the data
    http://labe.felk.cvut.cz/~xfaigl/mep/xml/java-xml.htm

  • Creating XML using JSP

    Hi I want to create a xml using JSP For eg I want to create a report
              and I want to take all the data required for the report from the user
              and want to put all the information in a session and whenever a user
              wants to see the html output I should be able to parse the xml file
              and show it to user.
              I know it is doable but I am confused about storing the data in
              session and concerting that data into XML file any help would be
              great.
              Thanks,
              Preeti
              

    Sounds like you might want to look at XML data binding. Something like JAXB
              or Castor can create an object that can be turned into XML by merely calling
              a single method and probably streamed to Xalan or whatever to create HTML.
              However, don't quote me on this - I am having enough troubles with trying to
              get the compiled Objects to be as I wish. Basically, they both take your
              DTD with an extra file that defines the types to be used in the classes -
              i.e. instead of string int might be used - and which tags to turn into
              classes and general information such as this about the output of your
              classes. You then simply call Unmarshal (for both castor and JAXB) and it
              loads the file from the selected input stream into the created object, you
              edit the object, what ever - store it on the server... and call Marshal to
              get back the xml... as this is all using streams it could be passed to Xalan
              for processing i think...
              Hope I've helped, and answered your question a little!
              "Preeti Sikri" <[email protected]> wrote in message
              news:[email protected]...
              > Hi I want to create a xml using JSP For eg I want to create a report
              > and I want to take all the data required for the report from the user
              > and want to put all the information in a session and whenever a user
              > wants to see the html output I should be able to parse the xml file
              > and show it to user.
              >
              > I know it is doable but I am confused about storing the data in
              > session and concerting that data into XML file any help would be
              > great.
              >
              > Thanks,
              > Preeti
              

  • Whitespace in XML-Style JSP

    Hi,
    I am having a slight issue with the XHTML content generated by a JSP. The output is stripped entirely of all whitespace, such that the content is all on one line. I have a request from one of our content writers to view the source "nicely". Oddly, in all of my searches for this problem, I have found people experiencing the opposite problem.
    Suppose I have a JSP like so:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
    <jsp:directive.page language="java" contentType="text/html;charset=ISO-8859-1"/>
    <html>
    <head>
         <title>A JSP Page</title>
    </head>
    <body>
         <table>
              <tr>
                   <td>Table Cell</td>
              </tr>
         </table>
    </body>
    </html>
    </jsp:root>The resulting output is:
    <html><head><title>A JSP Page</title></head><body><table><tr><td>Table Cell</td></tr></table></body></html>How can I get the output to have the same indentation as the source?
    I am using Tomcat 4.1.29.
    Thanks!

    Hi Syed,
    Try these links:
    <a href="http://www.javaranch.com/newsletter/Feb2002/xmljsp.html">Exploring JSP Documents (XML Style JSP Pages)</a> --> an excellent overview of the benefits of JSP Documents (XML Style JSPs) over standard JSP Pages.
    <a href="http://www.webmonkey.com/webmonkey/01/22/index3a.html?tw=programming">Intro to JSP</a>
    You can also try googling for "XML Style JSP"...
    Regarding books on JSP 2.1 and Servlet 2.5 -- I really can't believe that there are none available! Have you tried searching on amazon?
    HTH!
    -Vladimir

  • Request xml, process jsp..

    Hello
    My English abillity very poor. sorry...
    My homepage base on xml(not servelet, jsp)
    so user connect a.xml...
    a.xml+a.xsl combine... so user can view homepage....
    but I want to....
    user request a.xml
    a.xml call specific jsp process and make new b.xml...
    and b.xml+a.xsl... > view new page.....
    so How can I connect a.xml + process.jsp.....
    a.xml must call process.jsp...
    Help me

    Have the XML page call a servlet in the usual HTML manner passing what ever parameters needed. In the Srevlet do what ever processing needed. In the response back to the browser do:
    res.setContentType("text/xml");
    pw = res.getWriter();
    pw.print(xmlString);
    pw.flush();
    pw.close();
    where xmlString is the desired xml in a String. You could also play around with getOutputStream if you prefer.

  • XSL + XML in JSP

    JSP code:
    <%@ page import="javax.xml.transform.*,javax.xml.transform.stream.*,java.io.*" %>
    <%TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer( new StreamSource("book.xsl"));
    transformer.transform( new StreamSource("book.xml"), new StreamResult(out));%>
    Result:
    excepcion
    javax.servlet.ServletException
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
    org.apache.jsp.book_jsp._jspService(book_jsp.java:55)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    causa raiz :
    java.lang.NoClassDefFoundError
    org.apache.xml.serializer.ToStream.<init>(ToStream.java:112)
    org.apache.xml.serializer.ToXMLStream.<init>(ToXMLStream.java:57)
    org.apache.xml.serializer.ToUnknownStream.<init>(ToUnknownStream.java:136)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    java.lang.Class.newInstance0(Unknown Source)
    java.lang.Class.newInstance(Unknown Source)
    org.apache.xml.serializer.SerializerFactory.getSerializer(SerializerFactory.java:91)
    org.apache.xalan.transformer.TransformerImpl.createSerializationHandler(TransformerImpl.java:1097)
    org.apache.xalan.transformer.TransformerImpl.createSerializationHandler(TransformerImpl.java:981)
    org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1187)
    org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1170)
    org.apache.jsp.book_jsp._jspService(book_jsp.java:49)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    Why it happens? I have been several hours with this problem
    Thanks!

    I'm not sure, but I think you have to use XSLTCSource in stead of StreamSource. Check the Xalan API docs at xml.apache.org .
    http://xml.apache.org/xalan-j/apidocs/index.html

  • Multiple xml sources - JSP

    Hi to all,
    Ok this is my situation. I have XML data that is coming from servlets. I need to build a JSP page that will output the XML data, but from multiple servlets. Is there anyway to do this? I have XSLT that transforms the XML data, but it has to be linked at runtime, since the servlets only outputs the data (I need a clear separation between data presentation and the data itself)
    Coul somebody she some light plz...
    Thanks

    Well, not exactly.
    Let's say I have two HTML lists in my JSP page that needs to be outputted. Each of these lists get their data from different servlets. These servlets outputs the XML data. I have this JSP page that needs to take the 2 XML outputs (from each servlets), link the XML data with their respective XSLT file (dynamically!) and render it in HTML.
    So I have multiple XML sources, not just one. That is exactly what I don't want because the XML data combinaison is irrelevant. I want to be able to use this output with other pages. (So joining the 2 sources is not acceptable)
    Thank you

  • Error in xml to html transform function in 11g(Help needed urgent)

    We are migrating from 9g to 11g.Code given below is working fine with 9g but giving following error while converting xml to html.
    Error:Exception occurred in XML_TO_HTML :ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00609: Function call with invalid number of arguments in 'position (//USER)'.
    Code :<?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <HTML>
    <BODY>
    <!--begin header-->
    <xsl:for-each select="AMAP_REMMIT_EMP/HEADERS/HEADER">
    <TABLE border="0" cellpadding="0" cellspacing="0" style="padding:1px" width="100%" height="95" bgcolor="#EAEAEA"><font size="6" face="Arial">amdocs </font>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="VENDOR_NAME"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Date: <xsl:value-of select="RUN_DATE"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="ADDRESS"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" /> <xsl:value-of select="TAX_ID"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="CITY"/> <xsl:value-of select="ZIP"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Vendor Number: <xsl:value-of select="OSEK_MURSHE"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> </TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Fax Number: <xsl:value-of select="FAX"/>
    </TD>
    </TR>
    </TABLE>
    </xsl:for-each>
    <!--end header-->
    <!--begin lines-->
    <p dir="ltr" align="center">
    <span style="font-family: Arial; text-decoration: underline; font-weight: 700">
    Subject: Remittance Advice</span></p>
    <table border="1" cellspacing="1" width="100%" bgcolor="#C0C0C0">
    <tr>
    <th width="20%"><font face="Arial"><b>Invoice Date</b></font></th>
    <th width="20%"><font face="Arial"><b>Invoice Number</b></font></th>
    <th width="40%"><font face="Arial"><b>Description</b></font></th>
    <th width="20%"><font face="Arial"><b><xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/CURRENCY"/> Amount</b></font></th>
    </tr>
    <xsl:for-each select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE">
    <tr>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="INVOICE_DATE"/></td>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="INVOICE_NUM"/></td>
    <td width="40%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="DESCRIPTION"/></td>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="AMOUNT"/></td>
    </tr>
    </xsl:for-each>
    <tr>
    <td width="80%" bgcolor="#FFFFFF" colspan="3" align="right">
    <b>Total Payment:</b></td>
    <td width="20%" bgcolor="#FFFFFF"><xsl:value-of select="//TOTAL"/></td>
    </tr>
    </table>
    <p dir="ltr" align="left"><span style="font-family: Arial"><font size="2">In accordance with your instructions, this amount will be transferred to your <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/SITES/SITE/INCLUDE_BANK_DETAILES='Y'">
    account number <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/ACCOUNT"/> in bank
    <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/BANK"/> , branch <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/BRANCH"/>
    on the date of <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/CHECK_DATE"/>.
    </xsl:if>
    <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/SITES/SITE/INCLUDE_BANK_DETAILES!='Y'">
    account on the date of <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/CHECK_DATE"/>.
    </xsl:if>
    <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/CREDITNOTES/CREDITNOTE/CREDITNOTE>'0'">
    <p>The payment will be credited in two days from the payment date in your account.</p>
    </xsl:if>
    <p>In case this date is not a valid value date in the bank system, the money will be transferred in the next valid value date.</p>
    <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/NOTES/NOTE/DESCRIPTION"/>
    </font></span></p>
    <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="50">
    <TR >
    <TD width="60%" ></TD>
    <TD width="40%" align="left"><b/><font size="2" face="Verdana" />Yours sincerely,</TD>
    </TR>
    <TR >
    <TD width="60%" ></TD>
    <TD width="40%" align="left"><b/><font size="2" face="Verdana" /> <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/COMPANY_NAME"/></TD>
    </TR>
    <!--end lines-->
    <!--end trailer-->
    </TABLE>
    <table cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-width: 1; padding: 0" bordercolor="#111111" width="100%">
    <tr>
    <td width="34%">Alert No:<xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/ALERT_ID"/></td>
    <td width="33%">Environment: <xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/DB_NAME"/></td>
    <td width="33%">Date:<xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/MAIL_DATE"/></td>
    </tr>
    </table>
    <!--end trailer-->
    </BODY>
    </HTML>
    </xsl:template>
    </xsl:stylesheet>
    Thanks in advance.

    #1. We need to see the code that is being used to invoke the stylesheet.
    #2. We need to see the document that is being transformed...
    It's most likely a bug in 9g which has been fixed in 11g...

  • ABAP to XML File (Simple Transformation)

    Hi guys,
    this is my first question here and if I do something wrong please tell me about it.
    I created my own simple transformation which I use in my program:
    CALL TRANSFORMATION ZST_MAGAZYN_BB
         SOURCE lt_magazyn_rh = lt_magazyn_rh[]
                lt_mag_hdr = lt_mag_hdr[]
                lt_mag_hdr2 = lt_mag_hdr2[]
         RESULT XML xml_string.
    Then I tried to use GUI_DOWNLOAD on "xml_string" but there is no content in output xml file (but file's size is not 0kb):
    DATA:  xml_table TYPE STANDARD TABLE OF string.
    APPEND xml_string TO xml_table.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         filename = 'C:\rh.xml'
       TABLES
         data_tab = xml_table.
    I would really appreciate your help.

    Try to change the path where you're saving the file.
    I had the same problem once, it was authorization. I couldn't save in C:\ root.
    Change filename = 'C:\rh.xml'   to    filename = 'C:\TEMP\rh.xml'.
    Or try any other path, but C:\

  • Successful Read of XML File by Transforms Return Null

    Hi:
    I'm starting out with a simple BPEL process: Read an XML file, transform two fields. write an XML file. Both the read and write operations use the same .xsd file.
    I am successful at creating, compiling, deploying, and executing the process. The output file contains empty tags. In the BPEL Console and can see each activity. The read activity shows the data read from the input file, arranged as expected. The I conclude that this activity works correctly. Here is what I see when I drill down on the first activity:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <user-details>
    - <user-list>
    - <user>
    <first-name>test1</first-name>
    <last-name>abc</last-name>
    <gender>male</gender>
    <age>1</age>
    </user>
    </user-list>
    </user-details>
    The second activity shows empty values for the tags defined for the target variable. Here's what I see for the second activity, the Transform activity:
    <Invoke_WriteOut_Variable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="user-details"><user-details xmlns:ns0="http://www.example-irfan.org" xmlns="http://www.example-irfan.org">
    <ns0:user>
    <ns0:firstName/>
    <ns0:lastName/>
    <ns0:gender/>
    <ns0:age/>
    </ns0:user>
    </user-details>
    </part></Invoke_WriteOut_Variable>
    This second activity, the Transform, simply maps fields received from activity one too a new variable defined using the same .xsd as the first variable.
    The third activity writes to the output file. Here is that file:
    <?xml version="1.0" ?><user-details xmlns:ns0="http://www.example-irfan.org" xmlns="http://www.example-irfan.org">
    <ns0:user>
    <ns0:firstName/>
    <ns0:lastName/>
    <ns0:gender/>
    <ns0:age/>
    </ns0:user>
    </user-details>
    This is a "simple" 3-activity process, and I've reviewed it thoroughly. Can anyone help? It seems that the variable defined to accept the input xml file is not getting populated, although the process manager seems to say differently. Why would this be?
    Thanks.

    Thank you for your response. My problem and confusion indeed relate to the xsd file. I know this because I can take one of the sample processes and modify it to perform the simple task that I want: open an xml file, transform a field or two, write to a new xml file. Still I have not been able to understand what BPEL considers a "valid" xsd file. I have tried like heck to match my xsd file to match the sample, but it still doesn't work.
    So, my next question to anyone: does any documentation exist on the proper format for an xsd file? I have tried to take examples from on-line postings and blogs, but these don't work. It seems to me that the initial <schema> tag is the most important and that the http references in this tag are vital, but I can't tell for sure.
    Any suggestions are appreciated.

  • Need help in displaying XML in JSP

    Hi there,
    i'm a newbi in XML and Java - I have the following prob, think for most of u nothing very difficult (or better thought so, I've posted this question in different forums here, but nobody answers :)
    I get an XML response from a search engine, now I want to display the search result in a jsp.
    The result is stored in the session [I hope I figured out correctly ;)]
    with the following command ->
    this.pageContext.getSession().setAttribute(SEARCHRESULT, dSearchResult);
    [its from the java class, which generates the result]
    Result example ->
    <?xml version="1.0" encoding="UTF-8"?>
    <FindSearchResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xml/SearchResult.xsd">
    <Result Hits="2" Name="OfficeLand_en_US">
    <Items>
    <Item Score="250">
    <Field FieldNo="0" Name="ProductID">KqvAqAB1Tq0AAADnFthtpZvC</Field>
    <Field FieldNo="1" Name="CatalogCategoryID">gh0KAAFvj3wAAADiW8SMtr6o</Field>
    </Item>
    <Item Score="250">
    <Field FieldNo="0" Name="ProductID">4rwKAAFvtNYAAADiwdCMtr6o</Field>
    <Field FieldNo="1" Name="CatalogCategoryID">gh0KAAFvj3wAAADiW8SMtr6o</Field>
    </Item>
    </Items>
    <HitDistribution>
    <Hit Hits="75" Score="0"/>
    <Hit Hits="2" Score="250"/>
    </HitDistribution>
    </Result>
    </FindSearchResult>
    How many 'Field' elements exist, depends on the query.
    The result example is a response, which is send to my JSP page. It is stored in an variable under the name SEARCHRESULT (it's the result of a query in a search engine).
    My JSP page is the page, which should display the searchresult.
    So i need to know, how to programm something in my JSP page to check the SEARCHRESULT to display not the whole xml file. I just want to display all Items (compare with result example) -> The name of each existing FieldNo, the Score and the HitDistribution.
    Please help me :)

    hi there,
    first create a xml schema for the xml you will be receiving.
    use jaxb or castor with the schema and create a class.
    in your jsp unmarshal the xml result you are getting with the class
    generated by either jaxb or castor. the class will have methods that return you the required elements.
    get to know xml schema better and just a pass thru of jaxb or castor will solve the problem.
    vedha_g

  • XML Won't Transform in Batch [JS, CS3]

    When I use import xml manually into indesign, it works - but when I import it using the script below, it does not apply the transformation.
    Any ideas?
    with(app.activeDocument.xmlImportPreferences) {
            allowTransform = true;
            transformFilename = XMLTransformFile.STYLESHEET_IN_XML;
            createLinkToXML = false;
            ignoreWhitespace =true;
            ignoreUnmatchedIncoming = false;
            importCALSTables = true;
            importToSelected = false;
            allowTransform = false;
           importTextIntoTables = true;   
           repeatTextElements = false;
           removeUnmatchedExisting = false;
           importStyle = XMLImportStyles.MERGE_IMPORT;

    arrgh, this was not was i wanted to test: it works with cs3 if you omit the with {} statement.
    if you set the xmlImportPreferences direct it does work here.
    app.activeDocument.xmlImportPreferences.allowTransform = true;
    app.activeDocument.xmlImportPreferences.transformFilename = XMLTransformFile.STYLESHEET_IN_XML;
    so this is not working:
    var _file = File.openDialog ("Choose XML File");
    with(app.activeDocument.xmlImportPreferences) {
            allowTransform = true;
            transformFilename = XMLTransformFile.STYLESHEET_IN_XML;
            //transformFilename = File.openDialog ("Choose XSL File");
    app.activeDocument.importXML(_file);
    but this works fine:
    var _file = File.openDialog ("Choose XML File");
    app.activeDocument.xmlImportPreferences.allowTransform = true;
    app.activeDocument.xmlImportPreferences.transformFilename = XMLTransformFile.STYLESHEET_IN_XML;
    //transformFilename = File.openDialog ("Choose XSL File");   
    app.activeDocument.importXML(_file);

  • How can I use SAX to Read XML in JSP?

    I created a class which extend DefaultHandler of SAX. I can use java to call this class and read XML data without any problems. But I can't call this class through JSP. Looks it didn't active startElement() when I called from JSP. Do you have any ideas on this case?
    ======================This is java call and works==============
    import java.io.*;
    import java.util.*;
    import ReadXmlSax;
    public class ReadElement
         public static void main(String argv[])
              ReadXmlSax r = new ReadXmlSax();
              Enumeration e = r.getAttribute("dre.xml","server","name");
              try{
                   while (e.hasMoreElements()) {
                   System.out.println((String)e.nextElement());}
              }catch(Throwable t){
                   t.printStackTrace();
    ======================================================================
    ========================This is jsp call but doesn't work=============
    <%@ page import = "java.util.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "ReadXmlSax" %>
    <html>
    <head><title>SAX Reader</title></head>
    <body>
    <%
    ReadXmlSax r = new ReadXmlSax();
    Enumeration e = r.getAttribute("dre.xml","server","name");
    while (e.hasMoreElements()) {
    out.println(e.nextElement());
    out.println("<br>");
    %>
    </body>
    </html>
    ======================================================================

    maybe you just simply can't reach dre.xml from your web server!

Maybe you are looking for

  • Can't get Apple Remote App to stay connected to my ITunes library.

    I recently had my modem and router taken out by lightening.  So I replaced them both with what is supposed to be the latest and greatest.  Simultaneously, Apple had a new version of ITunes, so I updated.  Now I can't get the Apple remote app to stay

  • How to add a input parameter in Web Intelligence ?

    Hi, I create a report in Web intelligent rich client and I want to prompt user to input a parameter such as report date then show this value in a report cell. Please tell me how to do ? Thanks Mau Vu Huu

  • MacBooks and closed lid mode

    Has Apple changed the OS yet for the MacBook so one can keep it operating when the lid is closed? For a machine that costs three times as much as your typical MS Windows laptop, this seems to be an expensive annoyance. I've read older posts of same t

  • Print Preview broken with Reader 9.3/Firefox 3.5.7?

    Since updating to Firefox 3.5.7 and Reader 9.3, one of our users reports the print preview no longer works properly.  Trying to downgrade to Reader 9.2 or Firefox 3.5.6 produced similar results on my test workstation. Computers in question are runnin

  • EJB ClassCastException Retrieving from Collection in same AppServer

    I am experiencing a weired Problem. I am passing a Collection of IdNameTO Transfer Object from My EJB Client(JSP) to EJB. At Server Side EJB is able to get the Object From Collection but when it does a Cast to convert the Object back to IdNameTO I ge