UCCX Modifying XML document in repository programatically

Hi,
I'm trying to write a web application that so that our non-admin users can have the ability to add holidays, turn on outage messages etc. The files that I need to manipulate are XML files that reside in the document repository.
I had originally planned on placing the XML files on a remote web server and then have the uccx scripts reference the XML files like http://servername/holidaydates.xml and I would just have the program that I write manipulate the xml files accordingly.
When I ran this past one of our consultants they said that this would add a lot of complexity. I'm not sure what he's talking about since I had it working in about 30 minutes.
Anyways, I thought that another method that might be good is if I could download the xml files from the document repository, modify them locally, and then upload them. That way there isn't a web server in the mix.
Is there a way to programatically download/upload files to the document repository?
Thanks!

I figured out what the issue was with my scipt and I have resolved it.

Similar Messages

  • Write & Modify XML Document on Midlet

    please help me, how to write & modify xml document on Midlet????
    I use KXML1.2 but it can't do write & modify. I read this documentation.... KXML just only read XML document....
    so everybody can help me.....
    please send your comment on my email... because my internet bandwith is so low. It's long time when I open this forum.
    thanks very much

    Check out with kXML 2
    Cheers,
    Rohan Chandane

  • UCCX GET XML Document data - how to force language path

    Hi,
    I saw that with UCCX, If the trigger have is language FR_CA, when I will use the Get XML Document Data (docTemp, etc,etc )
    It will get the value of the file located in the path of  FR_CA in the document management.
    Lets say, If the trigger language is FR_CA, Is there any way I can use the GET XML Document to open a file in the EN_CA in the document management ?
    How can I do that ?
    ps : The upload document have this function, we can force a language but I have no idea how to handle this with the Get XML Document.
    Thanks

    I will attach a screenshot of how you can specify the language folder that the Document lives in, regardless of the language of the Trigger or Contact.
    Notice that in the variable I am simply referencing the Document filename.  This will assume the language of the Contact.
    But also notice that within the step, I am saying that the Source document should be found in the L[en_CA] language folder. This does not change the language of the Contact; it simply tells the system to look in a different folder for the file.
    Of course, if your Document is not language specific, you could always put it in the Default language folder and then it will be available to all Contacts regardless of Language setting.
    Anthony Holloway
    Please use the star ratings to help drive great content to the top of searches.

  • Modifying XML files with JDOM

    Hi:
    I've been trying to get up to speed with JDOM, and while it seems pretty intuitive, I've been having a problem w/ modifying XML documents.
    Namely, once I get a Document object from a (skeleton) XML file, do changes made to the Document object through, say, addContent() propagate to the original file? My gut feeling is no, although this was certainly what I had expected initially.
    Here's a code fragment of what I had tried to do to populate a barebones XML file:
                   Document doc = builder.build(output);
              // add 100 elements, all the same
              for (int count = 0; count < 100; count++)
                   Element curr = new Element("book");
                   // create child nodes for book
                   Element title = new Element("title");
                   title.addContent("Book " + (count + 1));
                   Element author = new Element("author");
                   author.addContent("Author " + (count + 1));
                   Element price = new Element("price");
                   price.addContent("Price " + (count + 1));
                   curr.addContent(title);
                   curr.addContent(author);
                   curr.addContent(price);
                   doc.getRootElement().addContent( curr );
              }

    Mikael,
    This sounds like one of the many quirks (perhaps bugs) related to how FrameMaker handles non-FM files in books. The current book model doesn't play well with XML files as chapters and this seems like yet another problem. Apparently, if an xref does not target another .fm file in the book, Frame assumes that the target file is not in the book and therefore will not be in the book PDF.
    There have been discussions here about this in the past. The solution that I use is to run an API client before publishing that converts all XML files to .fm files, and redirect all xrefs appropriately. Then, book features work as expected and PDFs come out as normal. This is not feasible, however, without the automation from the API client.
    There may be some who would say that the best approach is to use XML and books the way that the designers did account for... that is, the whole book becomes an XML document with entity references to the separate chapters. In my work, though, this model was not appropriate... rather, I needed a binary FM book to act like a book, except with XML files as chapters. So, I think I understand your situation.
    Is API programming or FrameScript an option for you? I think it may be the only way to get what you are looking for.
    Russ

  • 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 + "]"

  • Cisco UCCX 10.6 Get XML Document Data XPath count() function

    Hi
    I'd like to retrieve the number of XML nodes in a document to make a script more efficient.
    e.g. with this XML, I'd like to know how many <message> nodes there are:
    <messages>
    <message>contentA</message>
    <message>contentA</message>
    <message>contentA</message>
    </messages>
    I've tried iNodeCount = Get XML Document Data (inputXMLfile, "count(//messages/message)")
    If I try this in an XPath expression tester then I get the result I'm expecting - an integer of 3. However, in UCCX this produces the error "Can not convert #NUMBER to a NodeList!"... What am I doing wrong?
    Thanks

    Hi, 
    you may want to use a Set or a Do step to execute Java code. 
    First, reference the XML file (within the repository) by calling DOC[myFile.xml] and of course, assigning this value to a Document type variable, e.g.: 
    Set myDocument = DOC[myFile.xml]
    Then add a Do step that actually does the XPath part of the job. 
    There's a nice step by step explanation of it here: http://viralpatel.net/blogs/java-xml-xpath-tutorial-parse-xml/
    Remember, you can get the Inputstream object of the myDocument variable using the getInputStream() method on it.
    G.

  • Is there a way to modify the style sheet so that it transforms an XML document with empty tags as tag / ?

    I have extracted some code from codeproject to
    reindent an XML document. Does anyone know how I can modify the stylesheet to make it so that the transform of an XML file will result in empty tags showing up as <tag /> instead of <tag></tag>?
    // http://www.codeproject.com/Articles/43309/How-to-create-a-simple-XML-file-using-MSXML-in-C
    MSXML2::IXMLDOMDocumentPtr FormatDOMDocument(MSXML2::IXMLDOMDocumentPtr pDoc)
    LPCSTR const static szStyleSheet =
    R"!(<?xml version="1.0" encoding="utf-8"?>)!"
    R"!(<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">)!"
    R"!( <xsl:output method="xml" indent="yes"/>)!"
    R"!( <xsl:template match="@* | node()">)!"
    R"!( <xsl:copy>)!"
    R"!( <xsl:apply-templates select="@* | node()"/>)!"
    R"!( </xsl:copy>)!"
    R"!( </xsl:template>)!"
    R"!(</xsl:stylesheet>)!";
    MSXML2::IXMLDOMDocumentPtr pXmlStyleSheet;
    pXmlStyleSheet.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    pXmlStyleSheet->loadXML(szStyleSheet);
    MSXML2::IXMLDOMDocumentPtr pXmlFormattedDoc;
    pXmlFormattedDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    CComPtr<IDispatch> pDispatch;
    HRESULT hr = pXmlFormattedDoc->QueryInterface(IID_IDispatch, (void**)&pDispatch);
    if (SUCCEEDED(hr))
    _variant_t vtOutObject;
    vtOutObject.vt = VT_DISPATCH;
    vtOutObject.pdispVal = pDispatch;
    vtOutObject.pdispVal->AddRef();
    hr = pDoc->transformNodeToObject(pXmlStyleSheet, vtOutObject);
    //By default it is writing the encoding = UTF-16. Let us change the encoding to UTF-8
    // <?xml version="1.0" encoding="UTF-8"?>
    MSXML2::IXMLDOMNodePtr pXMLFirstChild = pXmlFormattedDoc->GetfirstChild();
    // A map of the a attributes (vesrsion, encoding) values (1.0, UTF-8) pair
    MSXML2::IXMLDOMNamedNodeMapPtr pXMLAttributeMap = pXMLFirstChild->Getattributes();
    MSXML2::IXMLDOMNodePtr pXMLEncodNode = pXMLAttributeMap->getNamedItem(_T("encoding"));
    pXMLEncodNode->PutnodeValue(_T("UTF-8")); //encoding = UTF-8
    return pXmlFormattedDoc;
    Or, if there is some other method for reindenting a MSXML2::IXMLDOMDocumentPtr object where I can specify how I want empty tags to be stored, that would be great too.  However, I don't want it to lose its status of an MSXML2::IXMLDOMDocumentPtr object.
     I.e. I would like to still perform operations on the result as if it was still an MSXML2::IXMLDOMDocumentPtr object.
    Thanks,
    A
    Adrian

    If anyone is interested, I got an answer on StackOverflow
    here.
    Adrian

  • Got error message when store XML documents into XML DB repository, via WebD

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

    Hi experts,
    I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    I got error message when store XML documents into XML DB repository, via WebDAV.
    I have successfully registered 5 related schemas and generated 1 table.
    I have inserted 40 .xml files into this auto generated table.
    using these data I created relational view successfully.
    but since I couldn't store XML documents into XML DB repository, via WebDAV
    when I query using below code:
    SELECT rv.res.getClobVal()
    FROM resource_view rv
    WHERE rv.any_path = '/home/DEV/messages/4fe1-865d-da0db9212f34.xml';
    I got nothing.
    My ftp code is listed below:
    ftp> open localhost 2100
    Connected to I0025B368E2F9.
    220- C0025B368E2F9
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 I0025B368E2F9 FTP Server (Oracle XML DB/Oracle Database) ready.
    User (I0025B368E2F9:(none)): fda_xml
    331 pass required for FDA_XML
    Password:
    230 FDA_XML logged in
    ftp> cd /home/DEV/message
    250 CWD Command successful
    ftp> pwd
    257 "/home/DEV/message" is current directory.
    ftp> ls -la
    200 PORT Command successful
    150 ASCII Data Connection
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 .
    drw-r--r-- 2 FDA_XML oracle 0 DEC 17 19:19 ..
    226 ASCII Transfer Complete
    ftp: 115 bytes received in 0.00Seconds 115000.00Kbytes/sec.
    250 SET_CHARSET Command Successful
    ftp> put C:\ED\SPL\E_Reon_Data\loaded\4fe1-865d-da0db9212f34.xml
    200 PORT Command successful
    150 ASCII Data Connection
    550- Error Response
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [], [], [], [], [], [], [], []
    550 End Error Response
    ftp: 3394 bytes sent in 0.00Seconds 3394000.00Kbytes/sec.
    I have tried all suggestion from another thread such as:
    alter system set events ='31150 trace name context forever, level 0x4000'
    SQL> alter system set shared_servers = 1;
    but failed.
    is there anyone can help?
    Thanks.
    Edited by: Cow on Mar 29, 2011 12:58 AM

  • Trying to store XML documents in Oracle XML repository using Java

    Hi,
    I am trying to store XML documents in Oracle XML Repository using a Java program. i just need a functionality to be able to store XML files and retrieve them.
    Can anybody PLEASE provide me some sample code.
    Thanks in Advance
    Sasha

    Did you ever get any samples on doing this and if so could you pass it on to me.
    Thanks

  • UCCX XPath on Get XML Document Data Step always returns null

    Hello,
    Can someone tell whats wrong with my XPath, because it always returns null. I have tried different variations and nothing. I'm using UCCX 7.0
    XML
    <?xml version="1.0" encoding="utf-8" ?>
    <GetManagersResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.labdomain.com/">
      <ClaimManagersList>
        <X_CLAIM_MANAGER>
          <ClaimManagerUserName>test</ClaimManagerUserName>
        </X_CLAIM_MANAGER>
      </ClaimManagersList>
    </GetManagersResult>
    XPATH
    "/descendant::GetManagersResult/child::ClaimManagersList/child::X_CLAIM_MANAGER/child::ClaimManagerUserName"
    During debug, this is the value of the xml document when it reaches the Get XML Document Data step:
    TEXT[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<GetManagersResult xmlns=\"http://www.labdomain.com/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n  <ClaimManagersList>\r\n    <X_CLAIM_MANAGER>\r\n      <ClaimManagerUserName>test</ClaimManagerUserName>\r\n    </X_CLAIM_MANAGER>\r\n  </ClaimManagersList>\r\n</GetManagersResult>]

    It's your XML namespace in the root element.
    First off, I have never seen the CRS Editor play nice when XML namespaces are involved.
    Secondly, with your namespace in place, not even a generic xpath expression tester can find your data.  See attachements.
    I think that if you find a way to either: not send, or remove the namespace from your document, your xpath expression will work.
    With Namespaces
    Without Namespaces

  • UCCX Reading XML file hosted on IIS web server

    hi guys,
    i have a customer on CCX 8.5 environment and they have a .NET application running on an IIS web server. As part of this .NET application, the app produce an XML file.
    My questions is
    "Can CCX read XML file that is hosted externally on IIS web server rather than parsing the XML file on CCX document repository?"
    All of the examples of XML parsing points to the XML file in document repository.
    Any pointers to links and documentation/example on how to do this would be greatly appreciated.
    If this is not achievable, if you could kindly suggest a different way of doing it too would be greatly appreciated.
    Thanks in advance,
    Daniel

    Hi,
    to be quite honest with you, I don't know anything about Sharepoint - so I am afraid I cannot help you with its XML editing capabilities. XML is just a well formed text file that follows some logical rules, so no additional application is required for editing, in fact, I always encourage everybody to use Notepad/Textpad/ to read and edit XML files. Of course, if it's not possible, you will find a great number of various user friendly XML editing applications.
    A UCCX script will normally access an XML using the Create URL Document step and then, using the Get XML Document data step with the help of an XPath expression, will filter out the necessary information from the XML document.
    The protocols used are standard and well known, including HTTP and XPath (and XML itself). So it does not really matter what kind of HTTP server serves the XML file, IIS is just an option.
    Examples may be found in the Scripting guides for your particular UCCX version.
    HTH
    G.

  • Large XML Document Error

    We are using Oracle's XSQL servlet engine 9.0.2.0.0A to query an Oracle Database using xsql:include-owa. This xsql document uses a custom serializer to write the resulting XML to a file on the webserver. We have run into a problem with writing XML documents larger than approximatly 7MB. The file is written but just contains a Malformed XML Document error. We have tried tracking down the problem and it seems to be occuring before the custom serializer is given control of the document. Attached below is the xsql document and the Java source of our serializer if it would be of any help.
    -Eric Dalquist
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="simple_transform_xml.xsl" serializer="XMLWriter"?>
    <BASE_TAG connection="XXXXXXXX" xmlns:xsql="urn:oracle-xsql">
        <xsql:set-page-param name="save-file" value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/applInfo.xml"/>
        <xsql:include-owa >
            STUDEV.STUADMSDSET.P_GET_RECRUIT_INFO('A','C');
        </xsql:include-owa>
    </BASE_TAG>-----------------------------------------
    * Author:        Eric Dalquist
    * E-Mail:        [email protected]
    * Date Created:  10-03-2001
    * Last Modified: 10-03-2001
    * Modified By:   Eric Dalquist
    * Description:   This class writes out the contents of the final document produced by the xsql servlet.
    package com.mtu.XSQLSerializers;
    import java.io.FileOutputStream;
    import oracle.xml.xsql.*;
    import oracle.xml.parser.v2.XMLDocument;
    import org.w3c.dom.Document;
    * <P>
    *    XMLWriter is an implementation of the abstract XSQLDocumentSerializer class. It is passed a refrence to a DOM Document
    *    and the servlet environment. The XMLWriter takes the document and writes it out to the servlet's output stream. There
    *    is also the option that the saveFile xsql page parameter can be set to a fully qualified path and file name to write the
    *    document to.
    * </P>
    * <P>
    *    Here is an example of setting the saveFile page paramter. This line would be the first tag inside the root xsql servlet tag.
    * </P>
    * <PRE>
    *    &#060;xsql:set-page-param name="save-file" value="/u01/oracle/ias10210/xdk/java/xsql/Repository/Course_List/XMLDocument.xml"/&#062;
    * </PRE>
    * @author  Eric B. Dalquist
    * @version 1.0 10/03/2001
    public class XMLWriter implements XSQLDocumentSerializer
        /** the header we send if we are returning XML */
        private static final String MIME_XML = "text/xml";
        /** the name of the page parameter we look for to get the path and name to save the XML document to */
        private static final String ATTR_FILE = "save-file";
         * The serialize is called by the servlet engine and is passed the DOM Docuement result
         * from the XSLT transformation if there was one and a refrence to the XSQL servlet environment
         * @param doc The document representation of the XML output of the xsql servlet.
         * @param env A refrence to the servlet's environment.
         * @throws Throwable Any unhandled error is handled by the servlet by default.
        public void serialize(Document doc, XSQLPageRequest env) throws Throwable
            System.out.print("start ... ");
            FileOutputStream fos = null;
            String reqType = env.getRequestType();
            String saveFile = env.getParameter(ATTR_FILE);
            if (!reqType.equals("Command Line"))
                env.setContentType(MIME_XML);
                ((XMLDocument)doc).print(env.getOutputStream());
                env.getOutputStream().close();
            if (saveFile != null && !saveFile.equals("") && saveFile.indexOf("..") == -1 && saveFile.indexOf("~") == -1)
                fos = new FileOutputStream(saveFile);
                ((XMLDocument)doc).print(fos);
                fos.close();
            System.gc();
            System.out.println("end");
    }

    Technically DBMS_XMLSAVE and it's alter ego DBMS_XMLQUERY are not considered part of XML DB. DBMS_XMLSAVE and DBMS_XMLQUERY are legacy Java implementations.
    In 9.2.x these routines were replaced by DBMS_XMLSTORE and DBMS_XMLGEN which are written in 'C' and should be much faster in most cases and address a number of limitations inherant in the older implementations. DBMS_XMLSTORE and DBMS_XMLGEN are part of XML DB and the minimum supported release for XML DB is 9.2.0.3.0.
    DBMS_XMLSAVE issues are addressed in the TECH/XML forum
    http://forums.oracle.com/forums/category.jspa?categoryID=51

  • Performance issues with FDK in large XML documents

    In my current project with FrameMaker 8 I'm experiencing severe performance issues with some FDK API calls.
    The documents are about 3-8 MBytes in size. Fortmatted they cover 150-250 pages.
    When importing such an XML document I do some extensive "post-processing" using FDK. This processing happens in Sr_EventHandler() during the SR_EVT_END_READER event. I noticed that some FDK functions calls which modify the document's structure, like F_ApiSetAttribute() or F_ApiNewElementInHierarchy(), take several seconds, for the larger documents even minutes, to complete one single function call. I tried to move some of these calls to earlier events, mostly to SR_EVT_END_ELEM. There the calls work without a delay. Unfortunately I can't rewrite the FDK client to move all the calls that are lagging to earlier events.
    Does anybody have a clue why such delays happen, and possibly can make a suggestion, how to solve this issue? Thank you in advance.
    PS: I already thought of splitting such a document in smaller pieces by using the FrameMaker book function. But I don't think, the structure of the documents will permit such an automatic split, and it definitely isn't an option to change the document structure (the project is about migrating documents from Interleaf to XML with the constraint of keeping the document layout identical).

    FP_ApplyFormatRules sounds really good--I'll give it a try on Monday. Wonder how I could miss it, as I already tried FP_Reformatting and FP_Displaying at no avail?! By the way, what is actually meant with FP_Reformatting (when I used it I assumed it would do exactly what FP_ApplyFormatRules sounds to do), or is that one another of Lynne's well-kept secrets?
    Thank's for all the helpful suggestions, guys. On Friday I already had my first improvements in a test version of my client: I did some (not all necessary) structural changes using XSLT pre-processing, and processing went down from 8 hours(!) to 1 hour--Yeappie! I was also playing with the idea of writing a wrapper to F_ApiNewElementInHierarchy() which actually pastes an appropriate element created in a small flow on the reference pages at the intended insertion location. But now, with FP_ApplyFormatRules on the horizon, I'm quite confident to get even the complicated stuff under control, which cannot be handled by the XSLT pre-processing, as it is based on the actual formatting of the document at run-time and cannot be anticipated in pre-processing.
    --Franz

  • Append XML elements with same name in an XML document

    Hi,
    I am using Oracle9i XMLDB utilities to modify an XML document stored in the database. I have a sample XML document like this in the database:
    <Person>
    <Address ID="1"> </Address>
    </Person>
    My task is to include a second <Address> element with a different attribute so that my XML document will become
    <Person>
    <Address ID="1"> </Address>
    <Address ID="2"> </Address>
    </Person>
    After creating the second element, I am using the function xmldom.appendChild() or xmldom.insertBefore() but they remove the first <Address> element and replace it with the second one. This is not what I want since I want both <Address> elements to be present.
    Could anyone please advise.
    Thanks.
    A. Dennis

    Please post your question [url http://forums.oracle.com/forums/forum.jsp?forum=154]here for quick response.
    thank you.
    Regards,
    Anupama
    [url http://otn.oracle.com/sample_code/]OTN Sample Code

  • How to retreive the modified XML data?

    Hi..
    i had a problem in retrieving the modified xml data.
    Iam using apache's DOMParser
    In the my class my xml data is stored in a string.so i used following statement to read xml data from that string:
    String abc="<? xml version=... some data goes here"
    InputSource in=new InputSource(new ByteArrayInputStream(abc.getBytes()));
              DOMParser domParser = new DOMParser();
              domParser.parse(in);
              Document doc = domParser.getDocument();
              Element root = doc.getDocumentElement();
    and i did some operations like adding ,removing and replacing elements etc.
    It was fine when the checked the data.
    but..i need my modified xml data as String.
    is there any method to retrieve the modified xml data "as it is" in String?

    You can use XMLSerializer.
    Here is an example that dump your document on the console:
    OutputFormat formatter = new OutputFormat();
    formatter.setPreserveSpace(true);
    XMLSerializer serializer =
    new XMLSerializer(System.out, formatter);
    serializer.serialize(doc);
    where doc is your Document.

Maybe you are looking for

  • Server 2012 R2 Active Directory delegation and access

    May be a simple question... In my company I have installed a backup domain controller on hyper-v for IT administration. All I want the IT admin guy to do is create users, modify their password and join clients to domain. He should not be allowed to c

  • Error building blink Win IoT

    Cannot find forum for Win IoT so added to the closest I could find. Hi anyone experienced this error when building the Blinky example ? 1>------ Build started: Project: Galileo Wiring App1, Configuration: Debug Win32 ------ 1>A task was canceled. 1>A

  • ICloud problems - multiple apple ids, ids in non-email format , bugs

       There is a major bug involving AppleIDs.  I searched the web and contacted tech support and gave up after hours on the phone of them trying things that didn't fix the problem.    The bug has to do with AppleIDs - I had an appleID, "myname" that I

  • Rename a song on my iPad Air

    How can I rename a song on my iPad Air? It just says Track #.

  • Qmaster and Maya... "How to's"

    I am attempting to set up Qmaster to network render my modeler's Maya projects. We've been using mentalray's network renderer, but we need to submit AE and FCP files to the same Xservers as well, so Qmaster seems like the easiest way to manage multip