Preload an xml document

Hi!
I've managed to preload an image with getBytes.../...total
properties but what about my XML document. Can I get statusinfo
while it loads into FlashPlayer?!?
PS I'm publishing to AS2.
Thanks

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sudip Karnavat ([email protected]):
I need to parse an XML document consisting of metadata and actual content and load the same into database columns with the body content into a CLOB.
e.g.
<AUTHOR> Mike <AUTHOR>
<HEADLINE> About XML </HEADLINE>
<DOCUMENT>
This document outlines the details of the XML parser for PL/SQL .........
</DOCUMENT>
I need to load the author and headline fields to author and headline fields in the database and DOCUMENT field to a CLOB column.
What approach should I follow? Should I use the XML Parser for PL/SQL ? Are there any sample examples.
Thanks
Sudip<HR></BLOCKQUOTE>
Sudip,
I forgot to add that really what you need to
do is write a transformation using XSLT and
only pick the information you need to store.
If you want just e-mail me the xml file and I
will do that-:)

Similar Messages

  • CDATA links in xml document

    Hello all,
    I am trying to add an html link inside a parapgraph of text that is loaded through an xml document. I have done some research and it appears I need to set my actionscript to read the html. When I add the href in the text it reads literally as the code instead of creating a hyperlink in the paragraph. My problem is I did not set up the original flash document and I anot sure where to add the htmlText=true; and so on.
    Here is the link. The problem is in the "press" section. last line in the paragraph of text. You can see the aref code not working.
    http://atelierdelalain.com/index_test.html
    Thanks in advance for any help!
    Sandra
    XML data:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
            <pic>
            <image>http://atelierdelalain.com/press/01.jpg</image>
            <title><![CDATA[WHAT IS JAMES WEARING?]]></title>
            <desc><![CDATA[As you know by now, I love to incorporate the work of fine artisans and crafts people into the interiors I create for both myself and my clients; an individually handcrafted object really can make a space.
    This brings me to furniture maker Emmanuel Delalain and his company Atelier Delalain who are doing the most marvelous things in wood and metal. With clean elegant lines, highly considered functionality, and a rich sensual poetry to his work, it didn't surprise us to learn that Delalain honed his craft as a young man in the Southern French coastal workshop of his father and grandfather building sailboats.
    To view full article click here.<a href="http://www.strutdenver.com" target="_blank">Strut</a>]]></desc>
            <dims><![CDATA[]]></dims>
            <note><![CDATA[]]></note>
            <thumbnail>http://atelierdelalain.com/press/thumbs/01.jpg</thumbnail>
            <width>600</width>
            <thumbwidth>47</thumbwidth>
        <subpics>
        </subpics>
        </pic>
    </images>
    Actionscript Code:
    import mx.transitions.*;
    import mx.transitions.easing.*;
    displayWidth = Stage.width;
    function loadXML(loaded) {
        if (loaded) {
            xmlNode = this.firstChild;
            image = [];
            title = [];
            desc = [];
            dims = [];
            note = [];
            thumbnails = [];
            imageW = [];
            subimage = [];
            subthumb = [];
            subW = [];
            subArray = new Array();
            total = xmlNode.childNodes.length;
            for (i=0; i<total; i++) {
                image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
                title[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
                desc[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
                dims[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
                note[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
                thumbnails[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
                imageW[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
                if (i == 0) {
                    thisX = 0;
                    w = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
                } else {
                    thisX = Number(w)+Number(2);
                    thisW = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
                    w = Number(thisX)+Number(thisW);
                //number of subpics
                total_subpics = xmlNode.childNodes[i].childNodes[8].childNodes.length;
                if (total_subpics != undefined) {
                    subArray[i] = new Array();
                    for (x=0; x<total_subpics; x++) {
                        subArray[i][x] = new Array();
                        subArray[i][x][0] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[0].firstChild.nodeValue;
                        subArray[i][x][1] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[1].firstChild.nodeValue;
                        subArray[i][x][2] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[2].firstChild.nodeValue;
                        subArray[i][x][3] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[3].firstChild.nodeValue;
                thumbnails_fn(i, thisX);
            firstImage();
        } else {
            content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("flash/press.xml");
    listen = new Object();
    listen.onKeyDown = function() {
        if (Key.getCode() == Key.LEFT) {
            prevImage();
        } else if (Key.getCode() == Key.RIGHT) {
            nextImage();
    Key.addListener(listen);
    previous_btn.onRelease = function() {
        prevImage();
    next_btn.onRelease = function() {
        nextImage();
    p = 0;
    this.onEnterFrame = function() {
        filesize = picture.getBytesTotal();
        loaded = picture.getBytesLoaded();
        preloader._visible = true;
        if (loaded != filesize) {
            preloader.preload_bar._xscale = 100*loaded/filesize;
        } else {
            preloader._visible = false;
            if (picture._alpha<100) {
                picture._alpha += 10;
                subHolder._alpha += 10;
    function nextImage() {
        if (p<(total-1)) {
            p++;
            if (loaded == filesize) {
                ///////////// sub thumbs ////////////
                subHolder.removeMovieClip();
                if (subArray[p] != undefined) {
                    createEmptyMovieClip("subHolder", 10);
                    subHolder._x = 800;
                    for (z=0; z<subArray[p].length; z++) {
                        subthumbs_fn(p, z);
                    createEmptyMovieClip("Line", 1);
                    lineLen = z*60+z*5;
                    Line.lineStyle(1, 0x492F92, 100);
                    Line.moveTo(795, 0);
                    Line.lineTo(795, lineLen);
                    createEmptyMovieClip("Line2", 2);
                    Line2.lineStyle(1, 0x492F92, 100);
                    Line2.moveTo(895, 0);
                    Line2.lineTo(895, lineLen);
                } else {
                    Line._alpha = 0;
                    Line2._alpha = 0;
                subHolder._alpha = 0;
                ///////////// end sub thumbs ////////////
                picture._alpha = 0;
                picture.loadMovie(image[p], 1);
                //displayWidth = Stage.width;
                imageWidth = imageW[p];
                res = displayWidth-imageWidth;
                place = res/2;
                picture._x = place;
                title_txt.htmlText = true;
                title_txt.htmlText = title[p];
                desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
                picture_num();
    function prevImage() {
        if (p>0) {
            p--;
            ///////////// sub thumbs ////////////
            subHolder.removeMovieClip();
            if (subArray[p] != undefined) {
                createEmptyMovieClip("subHolder", 10);
                subHolder._x = 800;
                for (z=0; z<subArray[p].length; z++) {
                    subthumbs_fn(p, z);
                createEmptyMovieClip("Line", 1);
                lineLen = z*60+z*5;
                Line.lineStyle(1, 0x492F92, 100);
                Line.moveTo(795, 0);
                Line.lineTo(795, lineLen);
                createEmptyMovieClip("Line2", 2);
                Line2.lineStyle(1, 0x492F92, 100);
                Line2.moveTo(895, 0);
                Line2.lineTo(895, lineLen);
            } else {
                Line._alpha = 0;
                Line2._alpha = 0;
            subHolder._alpha = 0;
            ///////////// end sub thumbs ////////////
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            //displayWidth = Stage.width;
            imageWidth = imageW[p];
            res = displayWidth-imageWidth;
            place = res/2;
            trace("dW:"+displayWidth+"iW:"+imageWidth+"x:"+place);
            picture._x = place;
            title_txt.htmlText = true;
            title_txt.htmlText = title[p];
            desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
            picture_num();
    function firstImage() {
        if (loaded == filesize) {
            ///////////// sub thumbs ////////////
            subHolder.removeMovieClip();
            if (subArray[p] != undefined) {
                createEmptyMovieClip("subHolder", 10);
                subHolder._x = 800;
                for (z=0; z<subArray[p].length; z++) {
                    subthumbs_fn(p, z);
                createEmptyMovieClip("Line", 1);
                lineLen = z*60+z*5;
                Line.lineStyle(1, 0x492F92, 100);
                Line.moveTo(795, 0);
                Line.lineTo(795, lineLen);
                createEmptyMovieClip("Line2", 2);
                Line2.lineStyle(1, 0x492F92, 100);
                Line2.moveTo(895, 0);
                Line2.lineTo(895, lineLen);
            } else {
                Line._alpha = 0;
                Line2._alpha = 0;
            subHolder._alpha = 0;
            ///////////// end sub thumbs ////////////
            picture._alpha = 0;
            picture.loadMovie(image[0], 1);
            //displayWidth = Stage.width;
            imageWidth = imageW[0];
            res = displayWidth-imageWidth;
            place = res/2;
            picture._x = place;
            title_txt.htmlText = true;
            title_txt.htmlText = title[p];
            desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
            picture_num();
    function picture_num() {
        current_pos = p+1;
        pos_txt.text = current_pos+" / "+total;
    function thumbNailScroller() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        scroll_speed = 10;
        tscroller.onEnterFrame = function() {
            if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
                if ((_root._xmouse>=(hit_right._x-60)) && (thumbnail_mc.hitTest(hit_right))) {
                    thumbnail_mc._x -= scroll_speed;
                } else if ((_root._xmouse<=(hit_left._x+60)) && (thumbnail_mc.hitTest(hit_left))) {
                    thumbnail_mc._x += scroll_speed;
            } else {
                delete tscroller.onEnterFrame;
    function thumbnails_fn(k, xpos) {
        thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
        tlistener = new Object();
        tlistener.onLoadInit = function(target_mc) {
            target_mc._x = xpos;
            target_mc.pictureValue = k;
            target_mc.onRelease = function() {
                p = this.pictureValue-1;
                nextImage();
            target_mc.onRollOver = function() {
                this._alpha = 80;
                thumbNailScroller();
            target_mc.onRollOut = function() {
                this._alpha = 100;
        image_mcl = new MovieClipLoader();
        image_mcl.addListener(tlistener);
        image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
    function scrollLeft() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        if (thumbnail_mc.hitTest(hit_right)) {
            thisX = thumbnail_mc._x;
            dist = hit_right._x-thumbnail_mc._x;
            r = thumbnail_mc._width-dist;
            if (r>=200) {
                newX = thumbnail_mc._x-200;
            } else {
                newX = thumbnail_mc._x-r;
            new Tween(thumbnail_mc, "_x", Regular.easeOut, thisX, newX, .5, true);
    function scrollRight() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        if (thumbnail_mc.hitTest(hit_left)) {
            thisX = thumbnail_mc._x;
            dist = hit_left._x-thumbnail_mc._x;
            if (dist>=200) {
                newX = thumbnail_mc._x+200;
            } else {
                newX = thumbnail_mc._x+dist;
            new Tween(thumbnail_mc, "_x", Regular.easeOut, thisX, newX, .5, true);
    buttonRight.onRelease = function() {
        scrollLeft();
    buttonLeft.onRelease = function() {
        scrollRight();
    function subthumbs_fn(p, z) {
        subHolder.createEmptyMovieClip("sub"+z, subHolder.getNextHighestDepth());
        sublistener = new Object();
        sublistener.onLoadInit = function(targ_mc) {
            //targ_mc._x = 800;
            targ_mc._y = 60*z+5*z;
            thumbWidth = subArray[p][z][3];
            thumbRes = 90-thumbWidth;
            thumbPlace = thumbRes/2;
            targ_mc._x = thumbPlace;
            trace(targ_mc._x);
            targ_mc.onRelease = function() {
                //p = this.pictureValue-1;
                //nextImage();
                picture._alpha = 0;
                picture.loadMovie(subArray[p][z][0], 1);
                //displayWidth = Stage.width;
                imageWidth = subArray[p][z][2];
                res = displayWidth-imageWidth;
                place = res/2;
                picture._x = place;
                this._alpha = 30;
                //picture_num();
            targ_mc.onRollOver = function() {
                targ_mc._alpha = 80;
                trace(targ_mc);
            targ_mc.onRollOut = function() {
                this._alpha = 100;
        sub_mcl = new MovieClipLoader();
        sub_mcl.addListener(sublistener);
        sub_mcl.loadClip(subArray[p][z][1], "subHolder.sub"+z);

    Thank you for your replies
    I tried adding the code mentioned, but I still can't get it to work. I added:
    title_txt.htmlText = true;
    title_txt.htmlText = title[p];
    desc_txt.htmlText = true;
    desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
    Am I adding in the wrong place? The text box that has the html in it is the "desc_txt" box. Any clues as to where the code would go in relation to the above code listed?
    Again... thank you for all of your help. Really appreciated! 
    Sandra

  • Error while loading an XML document using a structured application

    Hi,
    I try to load an XML document using a structured application defined in the default structapps.fm
    My code is shown down, extracted from the FDK API code sample.
    Problem, I always have the same message :
    "Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "
    Where "e:\xml\AdobeFrameMaker10\" is my install directory.
    So I assume that frame try to find the structapps.fm file but does not find it.
    What else can it be ?
    Does anyone knowns how to achieve this simple task using extendScript ?
    Thanks for any comments, Pierre
    function openXMLFile(myLastFile) {
        var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
        if (filename != null) {
            /* Get default open properties. Return if it can’t be allocated. */
            var params = GetOpenDefaultParams();
            /* Set properties to open an XML document*/
            /*Specify XML as file type to open*/
            var i = GetPropIndex(params, Constants.FS_OpenAsType)
            params[i].propVal.ival = Constants.FV_TYPE_XML;
            /* Specify the XML application to be used when opening the document.*/
            i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)
            params[i].propVal.sval = "myApp";
            i = GetPropIndex(params, Constants.FS_FileIsOldVersion)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FileIsInUse)
            params[i].propVal.ival = Constants.FV_DoCancel
            i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)
            params[i].propVal.ival = Constants.FV_DoCancel
            /*The structapps.fm file containing the specified application must have
            already been read. The default structapps.fm file is read when FrameMaker is
            opened so this shouldn't be a problem if the application to be used is
            listed in the structapps.fm file.*/
            var retParm = new PropVals()
            var fileObj = Open(filename, params, retParm);
            return fileObj
        } else {
            return null;

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • Problem replacing Null nodes with real values in XML documents...

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    Our friends in Java land are insisting on passing data between Java and PL/SQL using fairly small XML documents (don't ask). I then need to extract the input parameter values and pass them, on to the stored procedures that actually do the work. These return a result which needs to be returned to the java layer in the output XML document.
    Here is a cut down version of the input XML...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    <Parameter>
    <Id>2</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    and this is an example of what I am expected to return...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    <Parameter>
    <Id>2</Id>
    *<Result>WARNING</Result>*
    </Parameter>
    </ParameterList>
    i.e. I am expected to replace the value of the Result node with a string indicating the succes or otherwise of the underlying PL/SQL process.
    I am extracting the input values using the DBMS_XMLDOM functions and naively assumed that DBMS_XMLDOM.SETNODEVALUE could be used to update the value in the Result node - It didn't work so I resorted to reading the documentation which revealed that it will not work for a null node.
    Am I going to have to use XSLT to generate the output XML from the Input and incorprate the result? Or is there a simpler way?
    I have used XSLT in Oracle before and still have the nervous tick...

    Thanks A Non,
    With your suggestion and a bit of help from the w3schools.com xml dom tutorial I eventually managed to work out how to do this.
    Here is the code (with all my debug stuff in so it looks worse than it is...)
    create or replace
    PROCEDURE ExtractXMLValues (p_inXml IN CLOB ) IS
    l_string VARCHAR2(4000);
    l_value VARCHAR2(4000);
    l_DOM_doc dbms_xmldom.DOMDocument;
    l_DOM_node dbms_xmldom.DOMNode;
    l_new_DOM_node dbms_xmldom.DOMNode;
    l_new_element dbms_xmldom.DOMElement;
    l_new_DOM_nodevalue dbms_xmldom.DOMNode;
    l_value_Node dbms_xmldom.DOMNode;
    l_parameter_Node dbms_xmldom.DOMNode;
    --l_DOM_nodelist    dbms_xmldom.DOMNodeList;
    l_Result_DOM_node dbms_xmldom.DOMNode;
    BEGIN
    l_DOM_doc := dbms_xmldom.newDomDocument(p_inXml);
    l_DOM_node := dbms_xmldom.makeNode(l_DOM_doc);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('1 ' || l_string);
    l_parameter_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Parameter');
    -- get the current values in the XML document for Id and Result
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Id');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('2 ' || l_string || ' : ' || l_value);
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Result');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('3 ' || l_string || ' : ' || l_value);
    -- create new Result node
    l_new_DOM_node      := dbms_xmldom.makenode(dbms_xmldom.createElement(l_DOM_doc, 'Result'));
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('4 New node : ' || l_string);
    -- create a value for it
    l_new_DOM_nodevalue := dbms_xmldom.makenode(dbms_xmldom.createtextnode(l_DOM_doc, 'SUCCESS'));
    dbms_xmldom.writeToBuffer(l_new_DOM_nodevalue, l_string);
    dbms_output.put_line('5 New node value : ' || l_string);
    -- add the value to the new Result node
    l_new_DOM_nodevalue := dbms_xmldom.appendchild(l_new_DOM_node,  l_new_DOM_nodevalue);
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('6 New node : ' || l_string);
    -- replace the old node with the new one
    l_Result_DOM_node := dbms_xmldom.replaceChild(l_parameter_node, l_new_DOM_node, l_Result_DOM_node);
    dbms_xmldom.writeToBuffer(l_parameter_node, l_string);
    dbms_output.put_line('6 parameter node : ' || l_string);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('7 Updated document ' || l_string);
    dbms_xmldom.freeDocument(l_DOM_doc);
    END ExtractXMLValues;
    and the output...
    1 <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    2 <Id>1</Id> : 1
    3 <Result xsi:nil="true"/> :
    4 New node : <Result/>
    5 New node value : SUCCESS
    6 New node : <Result>SUCCESS</Result>
    6 parameter node : <Parameter>
    <Id>1</Id>
    <Result>SUCCESS</Result>
    </Parameter>
    7 Updated document <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    </ParameterList>
    One question, why do the dbms_xmldom functions return the Old value? I was expecting the returned value to be the updated node.
    Edited by: Lone voice on May 14, 2009 11:24 AM

  • 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

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

  • Display xml documents - how to submit a feature request?

    Safari is useless when it comes to render raw xml documents. You have to view the actual source to see the xml.
    Is there an official way to submit a feature request for safari to apple? I would love to see something similar to what firefox does with xml. Safari is such a fast and nice browser, if it only could handle text/xml better...

    As you said Safari simply shows all xml element content concatenated together. But no tags or attribute values. If the ContentType in the http header is set to text/xml Firefox shows an xml tree that you can nicely browse. I think IE5+ and Opera do that too. It is important to set the right content type though. Here is an example that shows nice in FF, but is unreadable in Safari:
    http://ww3.bgbm.org/biocase/pywrapper.cgi?dsa=Herbar
    Sure you can look at the source code, but the xml might not be pretty printed.

  • Displaying XML Document in new browser window

    Hi,
    I have a hyperlink on my page. When I click on it, it will open a new IE window and display xml document.
    The new window is displaying some of the xml and at the end displaying the following:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    End element was missing the character '>'. Error processing resource 'http://localhost:28080/benchmark/faces/displayXMLDocu...
    However, I cut and paste the xml String where I write it to the HTTPServletResponse to XMLSPY and it displays correctly.
    Please let me know.
    Rgrds

    Here are the steps:
    1. I created page1 that has a hyperlink.
    2. Hyperlink property are set to display page2 in a new window. (popup).
    3. page2.prerender() method, I set the response to the following:
    public void prerender() {
    javax.faces.context.ExternalContext ec = this.getExternalContext();
    HttpServletResponse response = (HttpServletResponse)ec.getResponse();
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.setHeader("Cache-Control","must-revalidate");
    response.setHeader("Cache-Control","max-age=0");
    response.setHeader("Pragma","no-cache");
    response.setHeader("Expires","0");
    response.setContentType("text/xml");
    response.setBufferSize(5000);
    String xmlString = getRequestBean1().getBookingPnrDetailsXML();
    try{
    xmlString="<?xml version=\"1.0\" encoding=\"UTF-8\"?><root><test1>this is a test</test1><victor>Hello Victor</victor></root>";
    PrintWriter out = new PrintWriter(response.getOutputStream());
    log(xmlString);
    out.print(xmlString);
    }catch(IOException io){
    System.out.println("" + io.getMessage());
    io.printStackTrace();
    4.page2.jsp code is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/xml;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view/>
    <ui:page binding="#{displayXMLDocument.page1}" id="page1"/>
    <ui:html binding="#{displayXMLDocument.html1}" id="html1"/>
    <ui:head binding="#{displayXMLDocument.head1}" id="head1"/>
    <ui:link binding="#{displayXMLDocument.link1}" id="link1"/>
    <ui:body binding="#{displayXMLDocument.body1}" id="body1"/>
    <ui:form binding="#{displayXMLDocument.form1}" id="form1"/>
    </jsp:root>
    please let me know.
    Rgrds.

  • Error: No valid XML document received*_

    Hi All,
    We are connecting our CCMS system to NetWeaver J2EE engine on which E-Sourcing is running.
    For this we registered java component and hosts in cen.
    But we are getting error as : No valid XML document received
    Please can anyone tell me how to overcome this error.
    Thank you .
    Regards
    Mahesh

    Hi,
    Please re-read the answer from Marc carefully.  He was in the exact same situation as yours: 
    - Monitored system: NW CE 7.1
    - CEN: NW 7.01 (same as NW 7.0 EhP1)
    The link you posted is for CEN with NW 7.3 and monitored systems from NW 7.02 (and up).  Read the paragraph below the Caution sign:
    If you want to centrally monitor any system with a central monitoring system with release SAP NetWeaver 7.0, this procedure is not applicable. In this case, follow the procedure described in the newest Monitoring Setup Guide for SAP NetWeaver 7.0 instead. You can obtain the Monitoring Setup Guide at the Internet address service.sap.com/operationsnw70 in the Monitoring area.
    You should look for (and follow) the right Monitoring Setup Guide as mentioned.
    Regards,
    Dao
    Edited by: Dao Ha on Sep 19, 2011 10:38 AM

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • 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

  • The size of a XML document stored in a XMLType table

    Is there a way to find out (via SQL) the size of a XML document stored in a XMLType table or XMLType column (storage OR based)?
    For instance in the way you could it retrieve if the XML document was stored in an XMLType column (CLOB based)
    SQL> r
    1 select dbms_lob.getlength(t.gegevens.getclobval()) "SIZE"
    2 from hgo.hgo010_detam t
    3* where rownum < 2
    SIZE
    2750

    Is there a way to find out (via SQL) the size of a XML document stored in a XMLType table or XMLType column (storage OR based)?
    For instance in the way you could it retrieve if the XML document was stored in an XMLType column (CLOB based)
    SQL> r
    1 select dbms_lob.getlength(t.gegevens.getclobval()) "SIZE"
    2 from hgo.hgo010_detam t
    3* where rownum < 2
    SIZE
    2750

  • How to save sections of a single XML Document to multiple tables ?

    Firstly, I apologise for the long e-mail but I feel it's necessary in order to clarify my problem/question.
    The XML document representation below stores information about a particular database. From the information in the XML document you can tell that there is a single database called "tst" which contains a single table called "tst_table". This table in turn has two columns called "CompanyName" & "Country".
    I want to use Oracle's XML SQL Utility to store this information into three seperate database tables. Specifically, I want to store the information pertaining to the database (i.e. name etc.) in one table, the information pertaining to the table (name, no. of columns etc.) in another and the information pertaining to the columns (name, type etc.) in yet another table.
    I have seen samples where an entire XML Document is saved to a database table but I cannot find any examples where different sections of a single XML Document are saved into different database tables using the XML SQL Utility.
    Can you please tell me the best approach to take in order to accomplish this . Does it involve creating an XMLDocument and then extracting the relevant sections as XMLDocumentFragment's, retrieving the String representations of these XMLDocumentFragment's and passing these strings to the OracleXMLSave.insertXml() method.
    Is this the best approach to take or are there any other, perhaps more efficient or elegant, ways of doing this ?
    Thanks in advance for your help
    - Garry
    <DATABASE id="1" name="tst">
    <TABLES>
    <TABLE name="tst_table">
    <NAME>Customers</NAME>
    <COLUMNS>
    <COLUMN num="1"> <COLID>2</COLID>
    <COLNAME>CompanyName</COLNAME>
    <COLTYPE>Text</COLTYPE>
    </COLUMN>
    <COLUMN num="2">
    <COLID>3</COLID>
    <COLNAME>Country</COLNAME>
    <COLTYPE>Text</COLTYPE>
    </COLUMN>
    </COLUMNS>
    </TABLE>
    </TABLES>
    </DATABASE>
    null

    See this thread;
    {thread:id=2180799}
    Jeff

  • SSRS Reports getting error in XML document (1, 6110).

    Hi,
    SCCM 2012 R2  Query reports opening error it shows below errors few reports only open properly.
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    System.InvalidOperationException
    There is an error in XML document (1, 6648).
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    System.Xml.XmlException
    '', hexadecimal value 0x1F, is an invalid character. Line 1, position 6648.
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    Kiran

    This has already been discussed and solved, please use the search funtion:
    http://social.technet.microsoft.com/Forums/en-US/home?category=systemcenter2012configurationmanager&sort=relevancedesc&brandIgnore=True&searchTerm=There+is+an+error+in+XML+document+
    Torsten Meringer | http://www.mssccmfaq.de

Maybe you are looking for

  • Urgent Advice Needed Re Slow BB Speeds & Intermitt...

    I'm in urgent need of advice please re my intermittent broadband problems For the past week now I've been getting very slow speeds and occasionally the broadband disappears altogether. When it disappears, my phone line goes out too, so I'm convinced

  • TimeStamp to To_date format

    Hi,   I am having the data like 09/09/2012 00:00:000 AM from the db itself, But i need to display only Date(mm/dd/yyyy) in report level. Is there any cast function to change to Date format or it can be achieved  only through in database. Regards, Gur

  • [SOLVED] Install a single program

    Hello to everyone and sorry for my poor english. I want to install "dig" package but I don't need the entire "dnsutils" group. It's possible? And another question, how can I see all "dnsutils" packages? With another group, for example "kde", I can wr

  • Database import utility wizrd

    I have a need to move the data from certain tables(of schema A) to schema B.I would be moving only tables and no other objects.I am using oracle sql developer and thought there are 2 options: 1.database copy  2.datapump I have few questions: 1.Datapu

  • ZBF commands to open OpenVPN port in on Cisco 1812

    Hello, I am running an OpenVPN server on an internal private network on port 1194/UDP and would like to open this port for the internet on a Cisco 1812 router (this router uses Zone based firewall). For that purpose I have added the following configu