Adding hyperlinks to xml document

Hi
I've built a movie in Flash CS3, which calls in both its
images and text from an xml file. The one thing I'm having a
problem with, is getting some of that text (usually just a url) to
function as a hyperlink. Can I code the text within the xml file to
include hyperlinks? As an example, this is how one image and
accompanying text would look in my xml file;
quote:
<image>
<id>1</id>
<title>Image 1 heading</title>
<description>Image 1 text.</description>
<imageurl>IMAGES/image5.jpg</imageurl>
</image>
Many thanks for any help.

Hi Ned
Thanks for your reply. I'm slightly confused, however. The
code that attaches to the Flash document - textfield.htmlText =
yourLinkext; - the same picture box calls in the text, so how can I
specify the link text? There's quite a lot of text which breaks
down into sections, depending on which image you click (when you
click on the image, it turns around to reveal the text on the
back). Each image, or section of text, will have its own url, but
all of the text runs into the same picture box. I'm also not clear
what/where I need to attach the code in Flash.
Apologies if I didn't make things clear enough in my first
post or if I'm misunderstanding your instructions (which I probably
am!).
Thanks again.
Paul

Similar Messages

  • Adding DOCTYPE to xml document

    Hi,
    I'm trying to create an XML document using JAXP APIs. But I could not find a way to add the DocType element with the Document. I read somewhere that DocType is a read only value. That means there is no way to associate it with a Document.?? Any help will be greatly appreciated as I'm urgent need of this.
    Thanks in advance

    Thank you so much for the help. Actually I was trying the same. But the issue was that I was trying to add the elements to the document object returned by the createDocument method. And that was giving me error. Now when I used getDocumentElement(); it is working.
    Now other issue is that I'm using the following piece of code to save the document.
    TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer t = tf.newTransformer();
                   t.transform(new javax.xml.transform.dom.DOMSource(rootDoc),new javax.xml.transform.stream.StreamResult("c:/text.xml"));This does not write the DocType element to the xml file. I tried to open an xml file and tried to save the same document. Then also doctype element is not written to the file.
    Is it an issue withe serialization of the document using TransformerFactory ??
    Thanks in advance

  • Last Row not added to XML Document

    Hi,
    I've created a transaction extracting data from SAP, trying to convert the data into a MII XML Document. But when i try to add the rows with the repeater block, it does not include the last record from the extracted SAP data.
    Description of the transaction:
    SAP function call
    MII XML Document
    Repeater (repeats on all items in the SAP output)
    ->MII XML Row
    ->Assign data to MII XML Row
    Assing XML Document to Transaction output property
    I have inserted a logger at the assignment action block, and the last SAP record is treated by the repeater block, but when i do a count on the SAP item elements and the converted Rows in the MII XML Document there is missing one record..
    Has any body had a similar problem and solved it some how??
    BR
    Jens

    Hi
    I think it is something to do with the technique you are using to add the rows.
    What you are doing is adding a blank row to the document, then populating the row action block (NOT the row in the document) with the first row from your repeater.
    You then run the row action block the second time, it has the data from the first repeater row, and then you populate the row action block with the second repeater row.
    So at the end you will have a rowset with 1 empty row and all but the last populated row from your repeater, plus a Row action populated with the last row from the repeater, but not added to your document.
    What you can do is either - move all your assignments into the Row object (definitely recommend this), or append the final row object to the document rowset before you assign it to your output.
    Hope this makes sense!
    Nick

  • Adding attachments to xml dom generated documents

    Hello All,
    I am trying to add an attachment to a DOM generated XML document, does anyone have any idea as to how I amy be able to do this.

    Hi
    Happen to see your posting. Did you get any response for your question. I have a similar requirement. If you have any pointers, please let me know. Thanks for your help in advance.
    Regards
    Sri

  • Adding javascript to an XML document???

    I want to add this javascript to an xml document I made, but so far I can't figure out how to.

    Try using a CDATA section.

  • 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

  • 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.

  • Hyperlinks in pdf documents created from Keynote

    For some reason the hyperlinks I've recently added to a keynote document are not active when I convert it to a pdf document. Neither Preview nor Adobe recognise them as hyperlinks.
    I've made the hyperlinks active using the inspector, and give the full url, including the http://. Can anybody help?

    Bernd Alheit, thanks for your answer. We print the pdf document from visio 2007 and then we read it in adobe reader 9. The relative hyperlinks work fine in visio 2007, but they change to absolute ones in the pdf document.

  • UTL_DBWS, XML Document as a parameter

    I'm struggling with using a fully formed xml document as a parameter to a web service.
    Using this code I'm able to connect to the web service and sans the arg1 argument everything works.
    When I as in the code below use xmltype.toStringValue() or xmltype.toClobValue() charachters like < and > is replaced with the html encoded version (&lt; and &gt;) which does'nt work very well with the recieving web service.
    All three parameters is defined as string on the recieving web service.
    I've been searching this forum and using google, but can't find any examples doing something like this.
    Any help or pointers appreciated.
    procedure forwardToQueue is
    svc_ sys.utl_dbws.service;
    call_ sys.utl_dbws.call;
    svc_qname sys.utl_dbws.qname;
    response sys.xmltype;
    request sys.xmltype;
    utMelding sys.xmltype;
    t1 sys.xmltype;
    t2 sys.xmltype;
    doc xmldom.DomDocument;
    fListe xmldom.DOMNodeList;
    tmpL xmldom.DOMNodeList;
    fElement xmldom.domNode;
    tmp xmldom.domNode;
    meldingId strliten;
    arg0_node xmldom.domnode;
    arg0_elmt xmldom.domelement;
    arg0_text xmldom.domtext;
    arg1_node xmldom.domnode;
    arg1_elmt xmldom.domelement;
    arg1_text xmldom.domtext;
    arg2_node xmldom.domnode;
    arg2_elmt xmldom.domelement;
    arg2_text xmldom.domtext;
    child_doc xmldom.domdocument;
    main_node xmldom.domnode;
    root_node xmldom.domnode;
    root_elmt xmldom.domelement;
    x sys.xmltype;
    c varchar2(32000);
    bs_chr strmax;
    l_service sys.UTL_DBWS.service;
    l_call sys.UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url strmax := 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean?wsdl';
    l_namespace strmax := 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean';
    l_service_qname sys.utl_dbws.qname;
    begin
    procName := 'hentQueue';
    pl('*************** '||procName||' ***************');
    svc_qname := sys.utl_dbws.to_qname(null, 'SIMSFacadeBeanService');
    svc_ := sys.utl_dbws.create_service(svc_qname);
    call_ := sys.utl_dbws.create_call(svc_);
    sys.utl_dbws.set_target_endpoint_address(call_, 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_URI', 'sendMessage');
    sys.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'document');
    x := genererSvar;
    doc := xmldom.newDOMDocument;
    main_node := xmldom.makeNode(doc);
    root_elmt := xmldom.createelement(doc, 'q0:sendMessage');
    xmldom.setattribute(root_elmt, 'xmlns:q0', 'si.sims.intern.service');
    root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
    -- Adding arg 0 as a string
    arg0_elmt := xmldom.createelement(doc, 'arg0');
    arg0_node := xmldom.appendchild(root_node, xmldom.makenode(arg0_elmt));
    arg0_text := xmldom.createtextnode(doc, '2');
    arg0_node := xmldom.appendchild(arg0_node, xmldom.makenode(arg0_text));
                   -- Adding arg 1 as a string
    arg1_elmt := xmldom.createelement(doc, 'arg1');
    arg1_node := xmldom.appendchild(root_node, xmldom.makenode(arg1_elmt));
    arg1_text := xmldom.createtextnode(doc, x.getClobVal());
    arg1_node := xmldom.appendchild(arg1_node, xmldom.makenode(arg1_text));
    -- Adding arg 2 as a string
    arg2_elmt := xmldom.createelement(doc, 'arg2');
    arg2_node := xmldom.appendchild(root_node, xmldom.makenode(arg2_elmt));
    arg2_text := xmldom.createtextnode(doc, 'false');
    arg2_node := xmldom.appendchild(arg2_node, xmldom.makenode(arg2_text));
    request := xmldom.getxmltype(doc);
    pl('Request:');
    pl(request.getStringVal());
    response := sys.utl_dbws.invoke(call_, request);
    pl('Showing respons');
    pl(response.getStringVal());
    doc := DBMS_XMLDOM.newDomDocument(response);
    sys.utl_dbws.release_call(call_);
    sys.utl_dbws.release_service(svc_);
    end forwardToQueue;

    Is the Document well defined via schema? You might be able to use the autotype
    ant task to generate a serializer.
    Otherwise, serialize the document to a string, then wrap it in <[CDATA[...]]>
    on the return. The calling app will need to understand that the string is xml,
    and then desrailize it manually.
    Mike
    "Surya" <[email protected]> wrote:
    >
    I have web service which has to retuen an XML document (org.w3c.dom.Document)
    as
    a paramter. Since this is not a supported data type for in-out paramaters,
    I will
    have to serialize and write my own converter. What is the best solution?
    Is there
    any class/library that can convert the document into String which I can
    return
    as a parameter and again get create a XML document in the client side.
    Thanks -Surya

  • How do I add (or insert) a node into an XML document with JSTL?

    Dear all,
    I am trying to use JSTL to store some data from a form into XML. However, I have read many articles in JSTL and only found that it can only be, as far as those articles are concerned, used to "read" data from XML files, but not "write" to them.
    Am I missing something in JSTL? Or, if I want to write to an XML file (e.g., insert a new node, or modify a node's data), will I have to write my own bean and then use <c:usebean />?
    Thanks very much in advance.
    Regards,
    Robert

    JSTL is not a programming language in and of itself. It is intended to help you to write scriptlet free JSPs.
    JSP pages (by one school of thought) are intended to function as the "View" in a Model-View-Controller architecture.
    Being a view, JSP pages should be able to look at things - but not touch.
    The standard pattern is to go to a servlet first, which invokes the logic, and then forwards to a JSP for rendering.
    Editing XML by adding new nodes etc etc is thus a function of the java code layer - servlet/action whatever you want to call it.
    Giving you the power to edit XML documents via JSTL (ie on a JSP page) takes away from purity of the MVC design.
    Hence why they don't provide the tags for manipulating XML, and only provide the database tags with a disclaimer that they should only be used for prototypes/trivial apps!
    JSTL is designed to replace scriptlet code on a JSP page.
    It can replace 99% of scriptlet code. The other 1% shouldn't be on the JSP in the first place :-)
    cheers,
    evnafets

  • Inserting an element into an XML document

    I am simply looking insert a new element into an existing XML Document using JDOM. Here is my code so far:
    public class UserDocumentWriter {
         private SAXBuilder builder;
         private Document document;
         private File file = new File("/path/to/file/users.xml");
         private Element rootElement;
         public UserDocumentWriter() {
              builder = new SAXBuilder();
              try {
                   document = builder.build(file);
                   rootElement = document.getRootElement();
              } catch (IOException ioe) {
                   System.err.println("ERROR: Could not build the XML file.");
              } catch (JDOMException jde) {
                   System.err.println("ERROR: " + file.toString() + " is not well-formed.");
         public void addContact(String address, String contact) {
              List contactList = null;
              Element contactListElement;
              Element newContactElement = new Element("contact");
              newContactElement.setText(contact);
              List rootsChildren = rootElement.getChildren();
              Iterator iterator = rootsChildren.iterator();
              while (iterator.hasNext()) {
                   Element e = (Element) iterator.next();
                   if (e.getAttributeValue("address").equals(address)) {
                        contactListElement = e.getChild("contactlist");
                        contactListElement.addContent(newContactElement);
                        writeDocument(document);
         public void writeDocument(Document doc) {
              try {
                   XMLOutputter output = new XMLOutputter();
                   OutputStream out = new FileOutputStream(file);
                   output.output(doc, out);
              } catch (FileNotFoundException ntfe) {
                   System.err.println("ERROR: Output file not found.");
              } catch (IOException ioe) {
                   System.err.println("Could not output document changes.");
         }However, the problem is, the newly added element will always be appended to the end of the last line, resulting in the following:
    <contactlist>
                <contact>[email protected]</contact><contact>[email protected]</contact></contactlist>Is there anyway in which I can have the newly added element create it's own line for the purpose of tidy XML? Alternatively is there a better methodology to do the above entirely?

    Your question is not very clear.
    Do you want to know How to insert an element into an XML document?
    Answer: I can see you already know how to do it. You have added the element using addContent()
    or do you want to know How to display the XML in a tidy format?
    Answer: to view the XML in a properly formatted style you can you the Format class. A very basic way of viewing the XML would be:
       * Prints the Document to the specified file.
       * @param doc
       * @param filename
       * @param formatting
      public static void printDocToFile(Document doc, String strFileName,
          boolean formatting)
        XMLOutputter xmlOut = null;
        if (!formatting)
          xmlOut = new XMLOutputter();
        } else
          Format prettyFormat = Format.getPrettyFormat();
          prettyFormat.setOmitEncoding(false);
          prettyFormat.setOmitDeclaration(false);
          xmlOut = new XMLOutputter(prettyFormat);
        try
          if (doc != null)
            FileWriter writer = new java.io.FileWriter(strFileName, true);
            xmlOut.output(doc, writer);
            writer.flush();
            writer.close();
          } else
            System.out.println("Document is null.");
        catch (Exception ex)
          System.out.println(ex);
      }

  • Add a hyperlink to another document? CS4

    Hi,
    How would one add a hyperlink to a document that refers to another document?
    The basic is:
    myDoc.hyperlinks.add(myHyperlinkTextSource, myHyperlinkTextDestination);
    How do I get "myHyperlinkTextDestination" if it exists in another, unopened InDesign document?
    I suppose I could open the document, get the Hyperlink destination, and then close it again, but in the UI this is not necessary (you simply browse to the required file and can then choose from a list of hyperlink destinations in that file). So how is this scripted?
    Thanks,
    Ariel

    Next, I tried this:
    I opened the document and got it's HyperlinkTextDestination.
    Then I used it when adding the hyperlink to the main document:
    app.activeDocument.hyperlinks.add(mySource, myDestination) //myDestination is a hyperlink destination in another document.
    And I get the following error message:
    Cannot set this property to an object in another document.
    So I'm clearly on a wild goose chase here.
    But obviously this is possible since it is doable in the UI.
    Any and all help appreciated!
    Ariel

  • Unable to find XML document from class path resource

    Hi,
    I am trying to learn spring and wrote my first class today. I added all the jar files to the lib folder and created all the classes. When I try to run the client program I get
    [INFO] XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [MorningGreeting.xml]
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [MorningGreeting.xml]; nested exception is java.io.FileNotFoundException: class path resource [MorningGreeting.xml] cannot be opened because it does not exist
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:180)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
         at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
         at com.training.spring.greetCustomers.EnterTraining.main(EnterTraining.java:22)
    Exception in thread "main"
    I have my client, interface, XML file all in the same package com.training.spring.greetCustomers. I could not understand what I am doing wrong?? Can you please help me.

    congratulations on deciding to learn spring. that's a smart thing to do.
    stop assuming that you did it correctly. the xml file is not in the classpath. when you get it there correctly, spring will find it.
    you have the source files and xml in that directory, but where do the .class files end up when you run them? does the xml config end up there, too?
    remember, the xml config should be in the directory where the root of the package hierarchy begins, not down where the .class files are.
    %

  • How to parse XML document returned by webservices

    Hi,
    I have a form (version 10.1.2.0) which has to display the credit card types using webservices. I created the webstub and jar file through jdeveloper and then after adding the jar files in the respective classpaths, I import it in the forms. I write the code in when-button-pressed and it gives the result in xml document like this:
    <?xml version="1.0" encoding="UTF-8"?><WSAnswerTO><error>false</error><errorMessage></errorMessage><
    results><CardTypeTO><carTypId>3</carTypId><type>AMERICAN
    EXPRESS</type><numLength>15</numLength><cvvLength>4</cvvLength><comments>1 800-639-0002</comments></CardTypeTO><CardTypeTO><carTypId>4</carTypId><type>DISCOVER</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-347-2683</comments></CardTypeTO><CardTypeTO><carTypId>1</carTypId><type>MASTERCARD</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-633-7367</comments></CardTypeTO><CardTypeTO><carTypId>2</carTypId><type>VISA</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-945-2000</comments></CardTypeTO></results></WSAnswerTO>
    From the above xml document, I only need to display the type (such as AMERICAN EXPRESS, VISA, ETC) in my forms. Can somebody please tell me how to do it. Do I need to store the values in a table first and then retrieve it. Please advise. I have already read a otn document in xml parsing but I didnt understand anything from it.
    Please help. Thanks in advance.

    Hello,
    It probably exists a database package/function to parse this kind of stuff.
    If you want to keep the process into the Forms, here is a PL/SQL package you can use:
    CREATE OR REPLACE PACKAGE Pkg_Tools AS
      --  Types  --
      -- table of strings --
      TYPE TYP_TAB_CHAR IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;
      --  Methodes   --
      -- function that return all contents for a given XML tag --
      FUNCTION Get_Xml_Tag
         PC$XmlContent  IN VARCHAR2,                 -- XML string
         PC$Tag         IN VARCHAR2,                 -- searched tag
         PC$NewLine     IN VARCHAR2 DEFAULT CHR(10)  -- defaull NL character
      RETURN TYP_TAB_CHAR ;
    END Pkg_Tools;
    CREATE OR REPLACE PACKAGE BODY Pkg_Tools
    IS
      -- fonction de retour du contenu d'une balise XML  --
      FUNCTION Get_Xml_Tag
         PC$XmlContent  IN VARCHAR2,                 -- contenu XML
         PC$Tag         IN VARCHAR2,                 -- tag recherche
         PC$NewLine     IN VARCHAR2 DEFAULT CHR(10)  -- defaull NL character
      RETURN TYP_TAB_CHAR
      IS
       TC$Table      TYP_TAB_CHAR ;
       LC$Ligne      VARCHAR2(32000) ;
       LC$Xml        VARCHAR2(32000) ;
       LN$INDEX      PLS_INTEGER := 0 ;
       LN$TagDeb     PLS_INTEGER ;
       LN$TagFin     PLS_INTEGER ;
       LN$TagLength  PLS_INTEGER ;
       LN$LigLength  PLS_INTEGER ;
       LN$Occur      PLS_INTEGER := 1 ;
      BEGIN
        IF ( PC$XmlContent IS NOT NULL AND PC$Tag IS NOT NULL ) THEN
          LC$Xml := REPLACE( PC$XmlContent, CHR(13), '' ) ;
          LN$TagLength := LENGTH( PC$Tag ) ;
           LOOP
          LN$TagDeb := INSTR( LC$Xml, PC$Tag, 1, LN$Occur ) ;
          LN$TagFin := INSTR( LC$Xml, '</' || SUBSTR(PC$Tag,2, 256), 1, LN$Occur ) ;
          LN$LigLength := (LN$TagFin - ( LN$TagDeb + LN$TagLength ) ) ;
          IF (LN$TagDeb > 0 AND LN$TagFin > 0 ) THEN
             LN$Occur := LN$Occur + 1 ;
             LC$Ligne := SUBSTR( LC$Xml, LN$TagDeb + LN$TagLength, LN$LigLength ) ;
             LOOP
               LN$INDEX := LN$INDEX + 1 ;
               LN$TagDeb := INSTR( LC$Ligne, PC$NewLine ) ;
               IF LN$TagDeb > 0 THEN
                 IF Trim( SUBSTR( LC$Ligne, 1, LN$TagDeb - 1 )) IS NOT NULL THEN
                   TC$Table(LN$INDEX) := SUBSTR( LC$Ligne, 1, LN$TagDeb - 1 ) ;
                 ELSE
                   LN$INDEX := LN$INDEX - 1 ;
                 END IF ;
                 LC$Ligne := SUBSTR( LC$Ligne, LN$Tagdeb + LENGTH( PC$NewLine ), 30000 ) ;
               ELSE
                 IF Trim(LC$Ligne) IS NOT NULL THEN
                    TC$Table(LN$INDEX) := LC$Ligne ;
                 END IF ;
                 EXIT ;
               END IF ;
             END LOOP ;
          ELSE
              EXIT ;
          END IF ;
           END LOOP ;
        END IF ;
        RETURN TC$Table ;
      END Get_Xml_Tag ;
    END Pkg_Tools;
    /Then the call:
    DECLARE
       LC$t  VARCHAR2(2000);
       LT$Table Pkg_Tools.TYP_TAB_CHAR ;
    BEGIN
       lc$t := '<?xml version="1.0" encoding="UTF-8"?><WSAnswerTO><error>false</error><errorMessage></errorMessage><results>'
    ||'<CardTypeTO><carTypId>3</carTypId><TYPE>AMERICAN EXPRESS</TYPE><numLength>15</numLength><cvvLength>4</cvvLength>'
    ||'<comments>1 800-639-0002</comments></CardTypeTO><CardTypeTO><carTypId>4</carTypId><TYPE>DISCOVER</TYPE>'
    ||'<numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-347-2683</comments></CardTypeTO>'
    ||'<CardTypeTO><carTypId>1</carTypId><TYPE>MASTERCARD</TYPE><numLength>16</numLength><cvvLength>3</cvvLength>'
    ||'<comments>1 800-633-7367</comments></CardTypeTO><CardTypeTO><carTypId>2</carTypId><TYPE>VISA</TYPE>'
    ||'<numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-945-2000</comments></CardTypeTO></results></WSAnswerTO>' ;
       LT$Table := Pkg_Tools.Get_Xml_Tag(LC$T,'<TYPE>') ; 
       IF LT$Table.COUNT > 0 THEN
         FOR i IN LT$Table.First .. LT$Table.Last LOOP
            dbms_output.put_line( 'Table(' || i || ')=' || LT$Table(i) ) ;
         END LOOP ;
       ELSE
         dbms_output.put_line( 'tag xml not found' ) ;
       END IF ;
    END;Francois

  • Reading UTF-7 XML document in Java

    I have an XML document and I want to add PrcessingInstruction to it.
    <?xml version="1.0" encoding="UTF-7" ?>
    <root_element>
    <sections>
    <section_introduction>
    <order-no>108800674</order-no>
    <order-type>219</order-type>
    <created-date>5. november 2008</created-date>
    when trying to parse it like
    File tmpFile = new File("C:\\ProvisioningEventError58412.xml");
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(false);
    Document doc = factory.newDocumentBuilder().parse(tmpFile);
    System.out.println("end");
    I get an exception on Document doc = factory.newDocumentBuilder().parse(tmpFile);
    org.xml.sax.SAXParseException: Invalid encoding name "UTF-7".
    [Fatal Error] ProvisioningEventError58412.xml:1:40: Invalid encoding name "UTF-7".
    Is it possible to set encoding on DocumentBuilder, so it can work with UTF-7 or is there any other was to parse it for adding ProcessingInstruction. Actually I want to add a CSS/XSL file for formatting the XML File.
    Edited by: aamaam on Jul 15, 2009 5:18 AM

    As you will see from [this Supported Encodings document|http://java.sun.com/javase/6/docs/technotes/guides/intl/encoding.doc.html], it's Java which doesn't support UTF-7, not just DocumentBuilder.
    So you have a couple of options. You could send the document back to whoever produced it and tell them that you can't process it the way it is. That's a legitimate thing to do because [the XML Recommendation|http://www.w3.org/TR/REC-xml/] only requires parsers to support UTF-8 and UTF-16. Support for other encodings is optional.
    Or you could write your own subclass of InputStreamReader which converts a stream of UTF-7 bytes into a stream of chars, and use that as a Reader which you pass to the parser. Somebody may even have done that already and posted it on the web somewhere.

Maybe you are looking for

  • Can you help me understand this sentence about Maser data/routine?

    Hi, I read the following statement from this forum: “… if u add an attribute to master data and that field is not getting populated from source system and you want to get it populated dynamically we can write look up code in routine such as getting d

  • Error in GR/IR - Tax relevancy

    We are implementing SAP ECC6 in a country where there is no tax.  But during the settings, settings requires to assign a tax procedure and for posting certain accounts like GR/IR clearing, tax relevant setting is required as a mandatory from the syst

  • My clock is changing after every start of OSX Or WINXP. What is it?

    I had a problem in the beginning with my iMac: It didn't shut down correctly and made weird thinks. I brought is to the Apple Centre and they said that could be a hardware problem. After the inspection they said that every part is OK. Then I had to p

  • OBIEE 11.1.1.6 HELP

    I HAVE SOME VALUES IN COLUMNS CONSIDER NUM DENO product 1 10 20 product 1 20 30 IN REPORT I HAVE TO SHOW NUM/DENO PRODUCT 1 30/50 I HAVE SUMMED NUM AND DENO BUT HOW TO SHOW THEM AS NUM/DENO ANY HELP

  • Music skipping over wireless network.

    This has not happened before. I just had to reset the network, but now all of the music played over airtunes skips and sounds terrible. I have an airport extreme base station extended by two airport expresses. It happens when it is played from any co