XML Document object access problem?

Hi,
I have created a servlet,which will call .sh file, which will call java application.........
this java application is working as a search engine,which will do search in the XML document object...........This is working fine when only one user run this servlet...........But when more than servlet do the same it is not working......... But once first servlet create the Document object,which is main source for serching..........then second servlet will work fine.......same thing with third servlet and so on...... I used the thread.sleep()/synchronize but it is not working...bcoz i am accessing the same application.....Then instead of servlet i tried to run the java application from the Dos prompt..........But i am facing the same problem......So pl guide me bcoz everything is working excluding this..........Becoz this document object creation is taking some time........ i am creating the object shown below
Document doc =parseXmlFile("Article.xml", false);
Element docElem = doc.getDocumentElement();
public static org.w3c.dom.Document parseXmlFile(String filename, boolean validating)
               try {
     // Create a builder factory
     DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
     factory.setValidating(validating);
     // Create the builder and parse the file
     // org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(filename);
     org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(new File(filename));
     return doc;
} catch (SAXException e) {
// A parsing error occurred; the xml input is not valid
} catch (ParserConfigurationException e) {
} catch (IOException e) {
return null;
}

Hi,
This is my Servlet code..............
package PW.Feed;
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.StreamResult;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;
public class PrintDom extends HttpServlet
     Document doc;
     Element docElem;
     Connection Conn=null;
     Statement stmt=null,stmt1=null;
     ResultSet rs1=null,rs=null;
     PrintWriter out;
     Vector myVector1=new Vector();
     Vector myVector2=new Vector();
     String strSql="";
     public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
          res.setContentType("text/html");
          out=res.getWriter();
          try
               String pubtype=req.getParameter("PubType");
               String pubDate=req.getParameter("PubDate");
               String toDate=req.getParameter("ToDate");
               String fromDate=req.getParameter("FromDate");
               if(pubDate==null)pubDate="2";
               if(toDate==null)toDate="02/09/2005";
               if(fromDate==null)fromDate="02/08/2005";
               Class.forName("org.firebirdsql.jdbc.FBDriver");
               Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.15/3050:D:/FBDatabases/PW1.GDB","SYSDBA","cohezia");
               //Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.99/3050:/share/pw1.gdb","SYSDBA","cohezia");
               stmt = Conn.createStatement( );
               if(pubDate.equals("2"))
                    strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.readdate>'"+fromDate+"' and sh.readdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
               else
                    strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.cuttingsdate>'"+fromDate+"' and sh.cuttingsdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
               rs=stmt.executeQuery(strSql);
               DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
               doc = builder.newDocument();
               docElem = doc.createElement("RECORDLIST");
               doc.appendChild(docElem);
               Element rootElem = doc.createElement("RECORDS");
               docElem.appendChild(rootElem);
               String artid="";
               while(rs.next())
                         Element artElem = doc.createElement("RECORD");
                         if((rs.getString("ARTICLEID")).length()>0)artElem.setAttribute("id",rs.getString("ARTICLEID"));
                         rootElem.appendChild(artElem);
                         Element rootFieldElem = doc.createElement("FIELDS");
                         artElem.appendChild(rootFieldElem);
                         Element eleCuttingDate = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleCuttingDate);
                         eleCuttingDate.setAttribute("fieldName","CUTTINGSDATE");
                         if((rs.getString("CUTTINGSDATE")).length()>0) eleCuttingDate.appendChild(doc.createTextNode(rs.getString("CUTTINGSDATE")));
                         Element eleReadDate = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleReadDate);
                         eleReadDate.setAttribute("fieldName","READDATE");
                         if((rs.getString("READDATE")).length()>0) eleReadDate.appendChild(doc.createTextNode(rs.getString("READDATE")));
                         Element eleHeadLine = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleHeadLine);
                         eleHeadLine.setAttribute("fieldName","HEADLINE");
                         if((rs.getString("HEADLINE")).length()>0) eleHeadLine.appendChild(doc.createTextNode(rs.getString("HEADLINE")));
                         Element eleSummary = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleSummary);
                         eleSummary.setAttribute("fieldName","SUMMARY");
                         if(rs.getString("SUMMARY")==null){
                              //out.println("String is null");
                              else
                              {eleSummary.appendChild(doc.createTextNode(rs.getString("SUMMARY")));}
                         Element eleAuthor = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleAuthor);
                         eleAuthor.setAttribute("fieldName","AUTHOR");
                         if((rs.getString("AUTHOR")).length()>0) eleAuthor.appendChild(doc.createTextNode(rs.getString("AUTHOR")));
                         Element elePageFrom = doc.createElement("FIELD");
                         rootFieldElem.appendChild(elePageFrom);
                         elePageFrom.setAttribute("fieldName","PAGEFROM");
                         if((rs.getString("PAGEFROM")).length()>0) elePageFrom.appendChild(doc.createTextNode(rs.getString("PAGEFROM")));
                         Element elePubName = doc.createElement("FIELD");
                         rootFieldElem.appendChild(elePubName);
                         elePubName.setAttribute("fieldName","PUBNAME");
                         if((rs.getString("PUB_NAME")).length()>0) elePubName.appendChild(doc.createTextNode(rs.getString("PUB_NAME")));
                         Element eleReaderName = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleReaderName);
                         eleReaderName.setAttribute("fieldName","READER NAME");
                         if((rs.getString("READER_NAME")).length()>0) eleReaderName.appendChild(doc.createTextNode(rs.getString("READER_NAME")));
                         Element eleParentTitle = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleParentTitle);
                         eleParentTitle.setAttribute("fieldName","PARENTTITLE");
                         if((rs.getString("PARENTTITLE")).length()>0)eleParentTitle.appendChild(doc.createTextNode(rs.getString("PARENTTITLE")));
                         Element eleCanMail = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleCanMail);
                         eleCanMail.setAttribute("fieldName","CANMAIL");
                         if((rs.getString("CANMAIL")).length()>0) eleCanMail.appendChild(doc.createTextNode(rs.getString("CANMAIL")));
                         Element elePublicationID = doc.createElement("FIELD");
                         rootFieldElem.appendChild(elePublicationID);
                         elePublicationID.setAttribute("fieldName","PUBLICATION_ID");
                         if((rs.getString("PUBLICATION_ID")).length()>0) elePublicationID.appendChild(doc.createTextNode(rs.getString("PUBLICATION_ID")));
                         Element eleJournlistID = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleJournlistID);
                         eleJournlistID.setAttribute("fieldName","JOURNALIST_ID");
                         if((rs.getString("JOURNALIST_ID")).length()>0) eleJournlistID.appendChild(doc.createTextNode(rs.getString("JOURNALIST_ID")));
                         Element eleIspdf = doc.createElement("FIELD");
                         rootFieldElem.appendChild(eleIspdf);
                         eleIspdf.setAttribute("fieldName","ISPDF");
                         if((rs.getString("ISPDF")).length()>0) eleIspdf.appendChild(doc.createTextNode(rs.getString("ISPDF")));
                         Element rootKeyElem=doc.createElement("KEYWORDS_CODES");
                    String[] arrCodes=getKeyCodes(rs.getString("ARTICLEID"));
                    int count1 = myVector1.size();
                    String[] myArray1=new String[count1];
                    myVector1.copyInto(myArray1);
                    int count2 = myVector2.size();
                    String[] myArray2=new String[count2];
                    myVector2.copyInto(myArray2);
                    for(int j=0;j<arrCodes.length;j++)
                         Element eleKeyword= doc.createElement("KEYWORD_CODE");
                         eleKeyword.setAttribute("CodeId",arrCodes[j]);
                         eleKeyword.setAttribute("LongName",myArray1[j]);
                         eleKeyword.setAttribute("CodeType",myArray2[j]);
                         rootKeyElem.appendChild(eleKeyword);
                    artElem.appendChild(rootKeyElem);
               Source source = new DOMSource(docElem);
               //File file = new File("/share/PrintDom.xml");
               StringWriter rw=new StringWriter();
               Result result = new StreamResult(rw);
               //Result result = new DOMResult();
               // Write the DOM document to the file
               Transformer xformer = TransformerFactory.newInstance().newTransformer();
               xformer.transform(source, result);
               out.println(rw);
          catch (ClassNotFoundException e)
                    out.println("Unable to load Driver Class" + e);
                    return;
                    //fileLog.log(e,"PressWatchFrame1.PressWatchFrame1()");
          catch (SQLException se)
               out.println(se);
          catch (Exception e)
               out.println(e);
finally{
                    try{
                         if(Conn!=null) Conn.close();
                    catch(SQLException ignored){}
     public String[] getKeyCodes(String strArticleId)
          Vector myVector=new Vector();
          myVector1.removeAllElements();
          myVector2.removeAllElements();
     try{
          stmt1=Conn.createStatement( );
          //String strSql1="Select codeid FROM SCANSSUBJECT where articleid='"+ strArticleId +"'";
          String strSql1="Select ss.codeid,c.longname,c.codetype FROM SCANSSUBJECT ss,CODES c where ss.codeid=c.codeid and articleid='"+ strArticleId +"'";
          rs1=stmt1.executeQuery(strSql1);
          String strCodes="";
          while(rs1.next())
               myVector.add(rs1.getString("codeid"));
               myVector1.add(rs1.getString("longname"));
               myVector2.add(rs1.getString("codetype"));
          }catch (SQLException se)
                                   out.println(se);
          int count = myVector.size();
          String[] myArray = new String[count];
          myVector.copyInto(myArray);
          return myArray;
..................Thanx

Similar Messages

  • Converting string to xml Document object.

    Hi all,
    I having a string consiste of xml data.
    I wants to convert this to an xml document object.
    When i am trying to do this i am getting fatal error Premature End of file.
    This is sample code from my program.
    String xmlStr = " <TravelItineraryAddInfoRQ>
    <POS>
    <Source PseudoCityCode="A2PB"/>
    </POS>
    </TravelItineraryAddInfoRQ>";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware( false );
              DocumentBuilder builder = null;
              char[] ch = new char[1200];
    builder = factory.newDocumentBuilder();
    StringReader sr = new StringReader(xmlStr);
    InputSource is = new InputSource(sr);
    Reader r = is.getCharacterStream();
    r.read(ch);
    System.out.println("String Starting ==== ");
    for(int i=0;i<ch.length;i++)
    System.out.print(ch);
    Document XMLDoc = builder.parse(new InputSource(sr));
    System.out.println("Document Object ==== "+XMLDoc);
    thnx,
    raj

    Hi Rajaven,
    use the below step, I think it could help u
    StringBufferInputStream sb = new StringBufferInputStream(strBf));
    doc = db.parse(sb);first conver a string to StringBufferInputStream then parse to doc Object
    hope it will solve.
    let me know if it's not working
    With cheers,
    PrasannA

  • JNDI NIS object access problem

    JNDI NIS object access problem:
    Hi all,
    After long fight, i'm now able to connect to my NIS server on my network. the initial context factory is 'com.sun.jndi.nis.NISCtxFactory' and provider url are given and i obtain namingennumeration of items in the NIS directory.
    purpose of my project:
    using ypcat command we can view the services,passwd,host... objects in unix.
    my project requirement is that i shd open this 'services' object in java (using JNDI probably) and shd access its content.
    i'm able to obtain the object and the type of this object is 'NISCtxServices' defined in 'com.sun.jndi.nis.NISCtxFactory' package, but all the classes and methods except some are not public and so im not able to use almost all the methods in this class 'NISCtxServices' .
    Can any one help me in accessing the information inside this object.
    Thanks in advance! and i'm waiting!

    It's because JFrame does not have a public progessbar variable, only your subclass has that.
    //change this
    JFrame frame = new ProgressBarDemo();
    //to this
    ProgressBarDemo frame = new ProgressBarDemo();

  • Merging two XML Document Objects

    I'm trying to merge two seperate XML Document Objects into one Object.
    Any suggestions would be very much appreciated.
    This is what the Objects look like when returned.
    FIRST:
    <?xml version = '1.0'?>
    <app>
    <name>Home</name>
    <active>true</active>
    <order-as-sibling>1</order-as-sibling>
    </app>
    SECOND:
    <app>
    <name>Developers</name>
    <active>true</active>
    <order-as-sibling>6</order-as-sibling>
    </app>

    That would work nicely if the XML documents had names, but they are coming back as a list in an XML object. I have about 8 separate XML Objects I'd like to merge into one.
    Thanks

  • How can i send a XML document object over the JMS wire

              HI,
              does anybody has anyidea about sending the XML Document over the JMS and receiving
              it n the other side..
              regards,
              Akhil
              

    Is this the full stack trace?
              Akhil Nagpal wrote:
              > HI ,
              > Sorry the excepiotn is of deserialization...this is the stack trace...mistake...
              >
              > weblogic.jms.common.JMSException: Error deserializing object
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:140)
              > at com.sds.kb.cm.CMMDBReceiver.onMessage(CMMDBReceiver.java:143)
              > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:356)
              > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:290)
              > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:271)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2303)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:2226)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              > ----------- Linked Exception -----------
              > weblogic.jms.common.JMSException: Error deserializing object
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:140)
              > at com.sds.kb.cm.CMMDBReceiver.onMessage(CMMDBReceiver.java:143)
              > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:356)
              > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:290)
              > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:271)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2303)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:2226)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              >
              >
              > Akhil
              >
              >
              > "Akhil Nagpal" <[email protected]> wrote:
              >
              >>HI,
              >> Actually i have created my own class which implements serializable.
              >>I set the
              >>object of this class in the ObjectMessage and send it across. Sometime
              >>i have
              >>to send some vector,sometimes string and sometime a XML document. So
              >>i can set
              >>these type of objects in my custom serializable object and send it. For
              >>sending
              >>XML , either i can send it as a string or as u said as Document object.
              >>But i
              >>want to do send it as a Document object. So i have created a an object
              >>of "org.jdom.Document"
              >>which implement serializable and setting this object into my custom object
              >>and
              >>sending this custom object in the objectmessage. But then weblogic throws
              >>some
              >>exceptions which has nothing to do with serialization.I am printing the
              >>exception
              >>below. (without the object of org.jdom.Document this custom object reaches
              >>safely
              >>and happily:))...this exception is something related to transactions.....can
              >>you
              >>or anybody tell me what could be the reason..
              >>I am not able to think why this kind of exception comes only when i try
              >>to send
              >>the jdom's Document object and never in other cases..
              >>
              >>java.sql.SQLException: XA error: XAER_RMERR : A resource manager error
              >>has occured
              >>in the transaction branch start() failed o
              >>n resource 'oraclePool': XAER_RMERR : A resource manager error has occured
              >>in
              >>the transaction branch
              >>oracle.jdbc.xa.OracleXAException
              >> at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:483)
              >> at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:190)
              >> at weblogic.jdbc.jta.VendorXAResource.start(VendorXAResource.java:41)
              >> at weblogic.jdbc.jta.DataSource.start(DataSource.java:569)
              >> at weblogic.transaction.internal.ServerResourceInfo.start(ServerResourceInfo.java:1165)
              >> at weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResourceInfo.java:1108)
              >> at weblogic.transaction.internal.ServerResourceInfo.enlist(ServerResourceInfo.java:287)
              >> at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:391)
              >> at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1146)
              >> at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1101)
              >> at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:145)
              >> at weblogic.jdbc.jta.Connection.createStatement(Connection.java:204)
              >> at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.java:130)
              >> at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:71)
              >> at com.sds.kb.cm.CMMDBReceiver.onMessage(CMMDBReceiver.java:134)
              >> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:356)
              >> at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:290)
              >> at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:271)
              >> at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2303)
              >> at weblogic.jms.client.JMSSession.execute(JMSSession.java:2226)
              >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              >>
              >> at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1151)
              >>
              >>
              >>any help will be appriciated..
              >>Akhil
              >>
              >>
              >>
              >>Raj <[email protected]> wrote:
              >>
              >>>wrap it up as an object message(I think DocumentImpl is Serializable).
              >>>This way you
              >>>wont be vendor specific and can retrieve it at the other end.
              >>>
              >>>Akhil Nagpal wrote:
              >>>
              >>>
              >>>>HI Raj,
              >>>> thanks for the response..actually we dont want our application
              >>>
              >>to
              >>
              >>>be weblogic
              >>>
              >>>>specific...
              >>>> there should be some other way arround....
              >>>>
              >>>>REgards
              >>>>Akhil
              >>>>
              >>>>"Raj" <[email protected]> wrote:
              >>>>
              >>>>>There is a weblogic specific XMLMessage similar to ObjectMessage,
              >>>>
              >>>BytesMEssage
              >>>
              >>>>>etc.. Try using that to wrap ur XML document and send it across.
              >>>>>
              >>>>>-Raj
              >>>>>
              >>>>>"Akhil Nagpal" <[email protected]> wrote:
              >>>>>
              >>>>>>HI,
              >>>>>>does anybody has anyidea about sending the XML Document over the
              >>>>>
              >>>JMS
              >>>
              >>>>>>and receiving
              >>>>>>it n the other side..
              >>>>>>regards,
              >>>>>>Akhil
              >>>>>
              >
              

  • JNDI NIS object access problem: urgent help

    Hi all,
    After long fight, i'm now able to connect to my NIS server on my network. the initial context factory is 'com.sun.jndi.nis.NISCtxFactory' and provider url are given and i obtain namingennumeration of items in the NIS directory.
    purpose of my project:
    using ypcat command we can view the services,passwd,host... objects in unix.
    my project requirement is that i shd open this 'services' object in java (using JNDI probably) and shd access its content.
    i'm able to obtain the object and the type of this object is 'NISCtxServices' defined in 'com.sun.jndi.nis.NISCtxFactory' package, but all the classes and methods except some are not public and so im not able to use almost all the methods in this class 'NISCtxServices' .
    Can any one help me in accessing the information inside this object.
    Thanks in advance! and i'm waiting!

    It's because JFrame does not have a public progessbar variable, only your subclass has that.
    //change this
    JFrame frame = new ProgressBarDemo();
    //to this
    ProgressBarDemo frame = new ProgressBarDemo();

  • Object access problem...

    I am reading the demo code of the sun hp.. about the progressbar..
    I use
    JFrame frame = new ProgressBarDemo();
    frame.pack();
    frame.setVisible(true);
    to construct the ProgressBarDemo object... however when i use the code
    frame.progressBar.setvalue(0);
    the complier scold me, can't resolve symbol
    progressBar
    can any expert help me .. why?
    public class ProgressBarDemo extends JFrame {
    public final static int ONE_SECOND = 1000;
    public JProgressBar progressBar;
    private Timer timer;
    private JButton startButton;
    private LongTask task;
    private JTextArea taskOutput;
    private String newline = "\n";
    public ProgressBarDemo() {
    super("ProgressBarDemo");
    task = new LongTask();
    //Create the demo's UI.
    startButton = new JButton("Start");
    startButton.setActionCommand("start");
    startButton.addActionListener(new ButtonListener());
    progressBar = new JProgressBar(0, task.getLengthOfTask());
    progressBar.setValue(0);
    progressBar.setStringPainted(true);
    etc

    It's because JFrame does not have a public progessbar variable, only your subclass has that.
    //change this
    JFrame frame = new ProgressBarDemo();
    //to this
    ProgressBarDemo frame = new ProgressBarDemo();

  • UCCX 8 - Dramatic change in the Create File Document step that is used by the Create XML Document step in order to read an XML file

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    For the last 5 years (and in IPCC3.x/4.x,UCCX/5.x/7.x) I've used the same basic subflow to read a XML document that contains holiday dates where the queue should be closed.  I've re-used this script on 20+ client installs and it's always worked.  The structure of the script allows you to pass the path and filename of the XML document as parameters to the subflow. (The document is in the repository)
    I loaded this script in UCCX 8.0.2 recently and it crashed with a Java.IO error.  It looked like it was trying to read the file system directly and not the repository. (In the Linux appliance model this kind of makes sense but why is the step trying to read the file system directly?)
    So I open a TAC case (SR# 615243125) and TAC tells me that the method of using the Create File Document step is not supported anymore and that I should specify the filename directly in the Create XML Document step
    The problem that I see (aside from having to edit all my scripts that use XML files) is that the Create XML Document step is looking for the input to be a type DOCUMENT and not a type STRING.  This seems to imply that I have to hardcode the document in each script that I deploy for a customer.  When it was a string it was easy to construct the full file path from parameters and pass to the subflow.
    Questions to the group
    #1 Am I missing something here?
    #2  Do you assume that you'll be able to load a script that worked fine in UCCX 7 into UCCX 8 and that it should completely function when you're doing everything according to the step reference documentation.
    #3 Cisco didn’t document this in any way that I can find.
    #4 How can you use the Create XML Document step in a fashion that would let you construct the path of the file and the filename previously in the script so you could pass it to a subflow ?  It would seem this functionality has been killed in UCCX 8
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    (Background)
    Create File Document Step
    The input filename is a STRING, could be an explicit path and filename in the repository or a variable that represents that path and string
    The output of this step is a DOCUMENT to be used in the Create XML Document step
    The string FILE_FullPathHolidayFiles references  en_us\folderName\documentName.xml
    The document was properly uploaded into the repository only, NOT trying to directly read c:\foo\blah…
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    The create XML document input can only be a type DOCUMENT

    #1 Am I missing something here?
    You are mixing two different issues together here.
    The Create File Document step is indeed not needed or supported for creating an XML document. That is why there is a unique step; to trigger XML parsing within the MIVR subsystem.
    Accessing the file system is restricted to a single folder within the VOS model (i.e. 8.0+). This folder is not backed up, replicated, or cleaned up automatically. It was intended to give developers some FS access as a temporary swap location only.
    #2  Do you assume that you'll be able to load a script that
    worked fine in UCCX 7 into UCCX 8 and that it should completely
    function when you're doing everything according to the step reference
    documentation.
    Assume nothing; read the documentation and attend one of the dozens of partner training sessions that CCBU put on advising of the upcoming changes.
    #3 Cisco didn’t document this in any way that I can find.
    You're right, I guess, on the Create File vs. XML Document step. AFAIK Cisco never wrote a notice into the Step Reference Guide explicitly stating that you cannot use the Create File Document although the documentation seemed pretty clear to me without it. File system restrictions are documented in the 8.0 release notes.
    Scripting and Development Series: Volume 2, Editor Step ReferenceUse the Create XML Document step to create a logical document that maps a document to another document variable (where the document has already been pre-parsed as an XML document and is ready to be accessed by the Get XML Document Data step).Use this step before the Get XML Document Data step to obtain data from a document formatted using the Extensible Markup Language (XML).
    #4 How can you use the Create XML Document step in a fashion that would
    let you construct the path of the file and the filename previously in
    the script so you could pass it to a subflow ?  It would seem this functionality has been killed in UCCX 8
    No it hasn't; just concatinate a string to build the Source Document parameter the step needs. Example:  "DOC[" + myFilePath + "]"

  • HOW TEXT CAN BE MADE SUBSCRIPTED IN XML DOCUMENT?

    SIR,
    I WANT TO DISPLAY MATHEMATICAL FORMULAS,WHICH INCLUDE MATHAMATICAL NOTATIONS LIKE "SIGMA" "DELTA" AND SO ON, AND ALSO SYMBOLS WITH SUBSCRIPTED TEXTS OR LETTERS,IN XML DOCUMENT.
    MY PROBLEM IS HOW CAN WE RENDER SUBSCRIPTED TEXTS IN XML DOCUMENT.
    FOR Eg.CONSIDER THE FORMULA SHOWN BELOW,IN HTML FORMAT.
    ÓAli * Bli / Cli
    PLEASE,TELL HOW THIS CAN BE REPRESENTED IN XML DOCUMENT.
    AND ALSO TELL ME HOW CAN A HORIZONTAL RULE BE DRAWN IN XML DOCUMENT
    THANK YOU.

    Ouch. Would you please not type in all capitals. It's hard to read.
    Anyway the question doesn't make sense. XML is just a format for storing and transmitting data. XML doesn't have the concepts of subscripting and drawing horizontal rules. Perhaps you were thinking of HTML?

  • Error when emailing XML document

    Hi there
    I am trying to email an XML document to an external vendor by using the CL_DOCUMENT_BCS class.  The email is sent successfully and I receive it in the relevant mailbox.  To make it an XML document, I move 'XML' to the I_TYPE parameter of the class.  This sends it perfectly as an XML document.
    The problem occurs when I receive the email and open the attachment.  When I open the attachment, I get the error "Whitespace is not allowed at this location".  To rectify this problem, I open the XML attachment in notepad, concatenate these lines by deleting the return characters and I save the file and open it again.  It then displays perfectly.
    When I send the email as a normal text document and I change the extension manually to 'XML', the XML can be viewed perfectly. 
    Can anyone assist in rectifying this so that there is no manual intervention?
    Kind Regards
    Gustav Coleske

    Raja
    The code is as follows:
    FORM send_data_via_email .
      DATA:   new_object_id LIKE sofolenti1-object_id,
              l_idx         LIKE sy-tabix.
    All activities done via facade CL_BCS!
      DATA: send_request              TYPE REF TO cl_bcs.
      DATA: text                      TYPE bcsy_text.
      DATA: document                  TYPE REF TO cl_document_bcs.
      DATA: sender                    TYPE REF TO cl_sapuser_bcs.
      DATA: recipient                 TYPE REF TO if_recipient_bcs.
      DATA: bcs_exception             TYPE REF TO cx_bcs.
      DATA: lt_contents               TYPE TABLE OF soli.
      DATA: lt_contents2              TYPE TABLE OF solix.
      DATA: lv_subject                TYPE sood-objdes VALUE 'Rental Units'.
      DATA: lv_length                 TYPE i.
      DATA: lv_receiver_email_address TYPE adr6-smtp_addr.
      DATA: lv_string                 TYPE string.
    Select the record for email address to send to off parameter table
      SELECT SINGLE value FROM zca_partr INTO gs_real_recipients-receiver
        WHERE progid = sy-repid
        AND   id     = 'OUT_EMAIL'.
      APPEND gs_real_recipients TO gt_real_recipients.
      CLEAR gs_real_recipients.
      CLEAR new_object_id.
      gv_items_sent = 'X'.
    Send back non-delivery and delivery reports.
      LOOP AT gt_real_recipients INTO gs_real_recipients.
        gs_real_recipients-notif_del  = 'X'.
        gs_real_recipients-notif_ndel = 'X'.
        gs_real_recipients-express    = gv_express.
        MODIFY gt_real_recipients FROM gs_real_recipients.
      ENDLOOP.
      gt_contents[] = gt_xml_out[].
    Set the subject of the email
      lv_subject                   = 'Rental Units for rent'.
      gs_packing_list-mail_subject = lv_subject.
      gs_packing_list-doc_type     = 'XML'.
      TRY.
    Create persistent send request
          send_request = cl_bcs=>create_persistent( ).
    Create and set document
    Create document from internal table with lt_content
          lt_contents[] = gt_contents[].
          DESCRIBE TABLE lt_contents[] LINES lv_length.
          gs_packing_list-doc_size = lv_length * 255.
          document = cl_document_bcs=>create_document(
                          i_type     = gs_packing_list-doc_type
                          i_text     = lt_contents
                          i_length   = gs_packing_list-doc_size
                          i_subject  = lv_subject
                          i_language = sy-langu
    Set the subject for the sending of mails.
          lv_string = gs_packing_list-mail_subject.
          TRY .
              CALL METHOD send_request->set_message_subject
                EXPORTING
                  ip_subject = lv_string.
            CATCH cx_sy_dyn_call_illegal_method .
          ENDTRY.
    Add document to send request
          CALL METHOD send_request->set_document( document ).
    Do send delivery info for successful mails
          CALL METHOD send_request->set_status_attributes
            EXPORTING
              i_requested_status = 'E'
              i_status_mail      = 'A'.
    Set sender
          sender = cl_sapuser_bcs=>create( sy-uname ).
          CALL METHOD send_request->set_sender
            EXPORTING
              i_sender = sender.
    Add recipients (e-mail addresses)
          LOOP AT gt_real_recipients INTO gs_real_recipients.
    Create recipient
            lv_receiver_email_address = gs_real_recipients-receiver.
            CHECK lv_receiver_email_address IS NOT INITIAL.
            recipient = cl_cam_address_bcs=>create_internet_address(
                                              lv_receiver_email_address ).
    Add recipient with its respective attributes to send request
            CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient  = recipient
                i_express    = 'X'
                i_blind_copy = gs_real_recipients-blind_copy.
          ENDLOOP.
    Send document
          CALL METHOD send_request->send(
            EXPORTING
              i_with_error_screen = 'X'
            RECEIVING
              result              = gv_sent_to_all ).
    Exception handling
        CATCH cx_bcs INTO bcs_exception.
          WRITE: text-001 , bcs_exception->error_type.
          EXIT.
      ENDTRY.
      COMMIT WORK.
    ENDFORM.                    " send_data_via_email
    I am not using the add_attachment method as the normal document create automatically creates the attachment.  Would using this method be critical?
    Kind Regards
    Gustav

  • Schema Validation with Java and Document object

    Hi, I am working on a project that will validate an xml Document object from a child class. I seem to have completed XSD validation with new DOMSource(doc) and using schema factory, which doesn't support DTD validation. And now I am attempting to validate the DTD. It seems like all the examples I've seen are trying to parse files, and I am struggling with finding a way to validate it directly against the document object.
    The child class creates the xml document which is passed back to the parent class, and I need to do the validation in the parent class, so I need away to validate against the document object. This will be an assertion in Fitnesse if anyone is familar with it.
    private void doSchemaValidationCommand(int rowCount, Document doc, String xpathExpression)
             String validationPath = getText(rowCount,1);
             String extensionSeparator = ".";
             Boolean error = false;
             String ext = null;
             try
             int dot = validationPath.lastIndexOf(extensionSeparator);
            ext = validationPath.substring(dot + 1);
             catch(Exception e)
                  this.wrong(rowCount, 1, e.getMessage());
             if (ext.equalsIgnoreCase("xsd"))
             try {
             SchemaFactory factory =
                SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            File schemaLocation = new File(validationPath);
            Schema schema = factory.newSchema(schemaLocation);
            Validator validator = schema.newValidator();
            try {
                validator.validate(new DOMSource(doc));
            catch (SAXException ex) {
                this.wrong(rowCount, 1, ex.getMessage());
                error = true;
            catch (IOException ex)  {
                 this.wrong(rowCount, 1, ex.getMessage());
                 error = true;
           catch (SAXException ex) {
               this.wrong(rowCount, 1, ex.getMessage());
               error = true;
           catch (Exception ex){
                this.wrong(rowCount, 1, ex.getMessage());
                error = true;
             else if (ext.equalsIgnoreCase("dtd"))
                  try {
             }

    I tried this but it doesn't give me any validation of whether or not it was completed successfully, it just adds a tag for the dtd to the xml and doesn't seem to do anything further with it, am I missing any steps?
    else if (ext.equalsIgnoreCase("dtd"))
                  try {
                       DOMSource source = new DOMSource(doc);
                       StreamResult result = new StreamResult(System.out);
                       TransformerFactory tf = TransformerFactory.newInstance();
                       Transformer transformer = tf.newTransformer();
                       transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, validationPath);
                       transformer.transform(source, result);
                  catch(Exception e)
                       this.wrong(rowCount, 1, e.getMessage());
                       error = true;
             }Edited by: sarcasteak on Apr 13, 2009 1:33 PM

  • ORA-00600: inserting xml document

    I am getting an this error when inserting an xml document into Oracle.
    The schema below and sample xml document reproduce the problem.
    If I move the element named "theID" from the type "BaseObjectType"
    to "NextObjectType" and remove the extension declaration in this type
    all works ok. complete error is:
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [],
    Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    targetNamespace="http://www.x.com/test"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tes="http://www.x.com/test">
    <xs:complexType name="BaseObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:complexContent>
    <xs:extension base="tes:BaseObjectType">
    <xs:sequence>
    <xs:element name="title" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RBaseType" abstract="true">
    <xs:complexContent>
    <xs:restriction base="tes:NextObjectType">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:restriction>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RType">
    <xs:complexContent>
    <xs:extension base="tes:RBaseType">
    <xs:sequence>
    <xs:element name="theName" type="xs:string">
    </xs:element>     
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="RObject" type="tes:RType"/>
    </xs:schema>
    Sample xml document:
    <?xml version="1.0" encoding="UTF-8"?>
    <RObject xmlns="http://www.x.com/test"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8080:/test.xsd">
    <theID xmlns="">123</theID>
    <title xmlns="">title</title>
    <theName xmlns="">name</theName>
    </RObject>
    Register Schema call:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://localhost:8080/test.xsd',
    SCHEMADOC => bfilename('TMP3','test.xsd'),
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    END;
    Insert xml document call:
    insert into "RObject566_TAB" values
    (XMLType(bfilename('TMP3','test.xml'),nls_charset_id('AL32UTF8')));
    Changing NextObjectType to this gets insert to work:
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    Anyone else seen this?
    jcl.

    BTW: This is with Oracle 10.2.0

  • How To Store dom4j.Document Object in MySQL Database?

    Hi Everyone, i am currently using dom4j to create an xml document object i wish to hold the object in a mysql database using jdbc, however the document object does not implement serializable, i am having difficulty in storing the document object as a BLOB object within the database, any suggestions?
    any help or advice would be greatly appreciated
    Thanks

    Convert the Document object to String and store the XML string in MySQL database.

  • No posted XML document?

    I tried pass parameter to my stylesheet.
    but I have gotted error message.(No posted XML document)
    Where is problem my code?
    please, let me know.
    Here, my xsql file :
    <?xml version="1.0"?>
    <page connection="sfa" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-request-params xmlns:xsql="urn:oracle-xsql"/>
    <xsql:update-request table="customer" transform="request-to-i_cust_info.xsl"
    key-columns="cust_no"
    columns="store_nm"/>
    </page>
    and my stylesheet :
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="/request/parameters">
    <ROW>
    <CUST_NO><xsl:value-of select="cust_no"/></CUST_NO>
    <STORE_NM><xsl:value-of select="cust_nm"/></STORE_NM>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    I can see the response like bellow
    <?xml version="1.0" ?>
    - <page>
    - <request>
    - <parameters>
    <cust_no>test</cust_no>
    <cust_nm>store</cust_nm>
    </parameters>
    <session />
    <cookies />
    </request>
    <xsql-status action="xsql:update-request" result="No posted document to process" />
    </page>
    null

    It seems that you <request> element will be under the <page> element.
    Can you try "/page/request/parameters"?
    Or can you check/show the XML result of the XSQL page without the XSLT transformation?
    null

  • Problem in inserting XML document

    Give XML DTD :
    <!ELEMENT a (b, c)>
    <!ELEMENT b (#PCDATA)>
    <!ELEMENT c (d, e)>
    <!ELEMENT d (#PCDATA)>
    <!ELEMENT e (#PCDATA)>
    I made schema at Oracle8i as this:
    create type c_t
    as object (d varchar2(3),
    e varchar2(3));
    create table a (
    b varchar2(3),
    c c_t,
    constraint b_pk primary key (b));
    And the XML document to insert into DB is as this:
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <b>"100"</b>
    <c><d>"aaa"</d><e>"abc"</e></c>
    </ROW>
    <ROW>
    <b>"200"</b>
    <c><d>"bbb"</d><e>"def"</e></c>
    </ROW>
    </ROWSET>
    Using Oracle8i's XML-JAVA library interface,
    I tried to insert the XML document into the DB table, but JAVA runtime exception occurred says "java.lang.NoSuchMethodError: oracle.jdbc.oci8.OCIDBAccess: method initObjectFields(Loracle/jdbc/dbaccess/DBColumn;[BI)V not found".
    How can I solve this problem?
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    try calling dbms_xmlgen.setrowsettag(qryctx,'siteMap') ;
    before retrieving the result with DBMS_XMLGEN.getxmltype (qryctx);

Maybe you are looking for