Problems embedding HTML into XML with CVIXMLSetElementValue - unwanted &lt and &gt

I'm using the CVI XML functions. When I try to insert some pre-exsting HTML as the element value with CVIXMLSetElementValue, it dutifuly converts all the HTMLangle brackets into &lt and &gt, which is NOT what I want.
(I can protect the XML integrity by wrapping it in [CDATA[ ....]] but that does not solve the conversion issue here.)
Any suggestions?
Thanks,
Ian
Solved!
Go to Solution.

To explain a bit further, below is a code snippet and the unwanted result that I see. Does this behavior - even with CDATA - make good design sense?
From my perspective CVIXMLSetElementValue should respect CDATA elements. Am I right? Or just biased?
stat = CVIXMLSetElementValue (test1_element, "Hello");
stat = CVIXMLSetElementValue (test2_element, "<p>Hello</p>");
stat = CVIXMLSetElementValue (test3_element, "<! [CDATA[<p>Hello</p>]] >");
// Problematic Output:
// <?xml version="1.0"?>
// <root>
// <test1>Hello</test1>
// <test2>&lt;p&gt;Hello&lt;/p&gt;</test1>
// <test3>&lt;! [CDATA[&lt;p&gt;Hello&lt;/p&gt;]] &gt;</test1>
// </root>

Similar Messages

  • How to convert HTML into XML

    I know I can parse XML into some HTML, but is there any tools or methods existed to parse HTML into XML?
    I have a not well-formed HTML with a lot data fields, including a lot not closed tags. This HTML is generated by some XML(as I can see), but I can't find a way to reform it into a XML, and eventually stored the data into another database.
    Anyone can help me? I appreciate!
    KIB

    As SAm has told you, you can use jTidy, for the purpose, a sample code , which can convert an html file to xml file is given at following url:
    see the documentation as well.
    http://sourceforge.net/docman/display_doc.php?docid=1298&group_id=13153
    gaurav_k1

  • Embedding HTML in XML CDATA and encoding issues

    Hi all,
    I'm embedding HTML code in a CDATA section. My problem is that, depending on the document, the HTML can be encoded in many formats. I borrowed a piece of code that sniffs that format so i can create String in the "right" encoding (or at least the one that was guessed).
    - If I directly injected those in the CDATA section, i guess they'd be encoded in UTF-8 and some character would be misinterpreted?
    - What if i would transcode the HTML from the sniffed format to utf-8?
    -Are there any issues woth doing this?
    Sorry if this is a dumb question but I'm quite new to that kind of encoding issues.
    BTW i'm using DOM.
    Thanks
    lexo

    I don't know if it's a dumb question. I just don't understand it at all. Encoding issues only arise when you write data from a Java program to an external location, or when you read data from an external location into a Java program. And none of the activities you mentioned there have anything to do with that.
    When you write your XML to an external file, or wherever you write it to, it gets encoded at that moment. The whole thing. Elements, attributes, CDATA sections, the whole thing. Doesn't matter what's in it, the whole thing gets encoded in whatever charset was chosen.
    Does that help?

  • Embeding image into XML document

    Hi,
    I am in need to embed image into XML file so that when somebody else uses the XML file, the image is still there. Is there any way to do this? Is it possible? Please give me some suggestions if you know about.
    Thanks a lot.

    well, the blowup in size from 3MB to 5MB is expected when you do the text encoding, cause you are taking binary data and converting it to a small range of characters. there are alternate algorithms which result in less of a blowup than base64 (like ascii85), see:
    http://en.wikipedia.org/wiki/Category:Binary-to-text_encoding_formats
    most image files use some sort of compression algorithm, which is why your file is much smaller than the image byte[]. you could just stick the file byte[] in the xml, but you might need to add additional attributes to indicate the image encoding (e.g. "gif" or "jpg").
    but, basically, you aren't doing anything "wrong".
    Edited by: jtahlborn on Feb 26, 2008 2:31 PM

  • HT4306 Problem logging into itune with valid apple ID and password

    I am able to loing to my account in apple.com and support site (this site) but cannot login to itune. Why? On accessing the My Account Home page I am presented some support agreement which I no idea what the **** is that.

    Solved the problem. I had to allow cookies for safari and it run - as here: Re: itunes keeps asking for my apple id password. it's NOT entered incorrectly.

  • Problems syncing Apple Lossless Files with iphone 3.0 and 3.1.

    I recently started having problems with syncing apple lossless files with my iPhone 3G. They were recording I made using Logic Pro and the same as have been working with no problem since I got my iPhone last year. Although the songs would play and indicate the correct total time in iTune, on the iPhone they would indicate a total time of over 2 hours even though they were 2-3 minute long. The same files converted to mp3 did not have this problem. Since updating to iTunes 9 and 3.1 on the iPhone, the problem is worse. The Apple Lossless format files do not show up on the iPhone at all even though they are fine in iTunes. mp3 format do not have this problem.
    Anyone else having the same issues?

    Hi Allen,
    I would like to thank you very much for your help with Forte 3.0 and WTK 1.0.1 beta.
    Thank you for the pointing me to the ForteJ2MEGuide.pdf file. It is very useful document.
    However, even following it I did not succeeded in accomplishing my task.
    I was able to follow the instructions and create, compile and run the Hello midlet which
    was generated by the IDE. My previous problem related to the fact that I did not create
    project and midlet suite for the midlet. After doing all of that the generated midlet worked. However, it was not what I wanted.
    First, the instructions in the guide only described how to generate new midlet. I tried
    to add the existing midlet to the current project. Unfortunately, the IDE always picked
    up the generated template, not my code.
    Second, when the generated midlet started to work, it was difficult to debug it. I set
    up the breakpoint, but the IDE did not stop at it. I think the reason is the compiler
    did not have debugging flag set up. Do you know where it is possible to set it up?
    So, at the end I still cannot accomplish very simple task which should not be very
    difficult at all:
    1. Use my own code to create a midlet.
    2. Compile and execute the midlet and see how it runs in emulator.
    3. See step-by-step execution of every line of my code and the value
    of every variable in the code.
    Regards,
    Jacob Nikom

  • Problems embedding html with jquery content

    Hey muse people.
    i'm currently struggling with a very annoying issue:
    I have a piece of html code with jquery bits in it (it's a 360° plugin). For some reason, it doesn't seem to work when i upload to my server and try it.
    I have tried the steps suggested in this thread: HELP! Adding Jquery to Muse! , but whenever i remove parts of the "JS Include" section, i get warnings and errors entering the page. The plugin works, though..
    Does anyone know a workaround on this one?
    Thanks in advance

    Hi Abhishek,
    thank you for looking into it:
    Homepage  <-  this is a simple page from muse with the html code embedded - it does not work (the image should switch when you click the "type" buttons)
    http://www.lichtermeile.de/simple/ <- here i just made an index.html and added the same code i used to embed as html in the muse page above
    It works just fine when i remove parts of the JS Include and fully remove the "Other scripts" section that muse added to the end of each html file .. but i don't know if that's a healthy and compatible way.
    This is the code:
    <html> 
    <script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
        <script src='http://code.vostrel.cz/jquery.reel.js' type='text/javascript'></script>
        <img src="images/bild000.jpg" width="400" height="500"
          class="reel"
          id="image"
          data-images="images/bild###.jpg"
          data-cw="true"
          data-frames="36"
          data-duration="6"
          data-velocity="3"
          data-speed="-0.2"
          data-brake="0.2">
        <p>
          Please choose a product:
          <button id="image1">Type 1</button>
          <button id="image2">Type 2</button>
        </p>
        <script>
          $('#image1').click(function(){
            $('#image').reel('images', 'images/bild###.jpg');
          $('#image2').click(function(){
            $('#image').reel('images', 'images2/neu###.jpg');
        </script>
        <script> $.reel.def.indicator = 5; </script>
    </html>
    Thank you!!!

  • QT Pro - having problems embedding video into html (IE7)

    I have just upgraded to Pro as I need to offer clients some video content on my website. Initially, I want to show still-image slide shows with an audio track. I can make these, and export them for the web no problem. But... I can't get them to work in my html and need some advice.
    The poster embeds fine, but when you 'Click to play movie', the page keeps loading with an error, and the movie won't run (in the html page). The larger [17Mb!!!!] 'source' movie runs fine, but if I click on the 'reference' movie (which is in the same folder as the 'source', and just 1K big), I get an error message (202... something about bad atom!). Could this be the cause, I wonder?
    I have set up a .js file as per the QT help advice, but I just can't seem to crack this one. Anyone got any ideas? Brain's numb now... and I don't really know where else to look!
    Any help would be seriously appreciated... TIA

    http://support.apple.com/kb/HT1014
    Your camera is supported and the Apple "Geniuses" dropped the ball telling you that you needed to make an additional purchase.
    Your camera records in "standard definition" MPEG-2 format.
    I don't know why you're not getting images (or sound, I guess). Try testing the camera under a different User account (helps troubleshooting).

  • Embedding HTML Into Flash?

    Let me start with the fact I only know some AS2. AS3 tends to go over my head. So I'm using Flash 8
    If I need FlashCS5 to do this, then, PLEASE, let me know.
    Here's the situration.
    I manage and build a number of sites. Many are parts of a network. The goal is to join them all as one. Both without using php (don't know php), and without having to leave primary page. A Flash Site is the plan. But that is a TON of work to re-create entire sites flash that are already large and established.
    So I got to thinking. What if I embed the HTML/CSS sites into Flash itself? That way they can still make their changes and it'll effect both the HTML version as well as it's mirror/portal via the Flash site?
    In Short:
    I want to embed this page on one frame in Flash:
    http://www.uga-international.com/About.html
    And place a link to another KeyFrame that has this page/site embeded:
    http://www.melholder.com/MAIN.html
    How would I go about doing this?
    ====
    Then it got me thinking even more. If this works, would it be possible to load a SWF video player (Webstunning FLV Player) into Flash and run it as if it's part of the Flash site?
    I thought the Loader Component would do this for me. But it keeps saying it can't locate the "playList.xml" file. The player has outside files it referances. This eoor prevent the player.swf from playing period.
    So how would I go about getting the loader to player external .SWF files that referance external .XML files?
    Here are two sample pages using different .SWF files that referance external .XML files:
    http://www.melholder.com/index.html
    http://www.dovm.org/TEST1a/Test1a.html
    Thanks in advance.

    Thank you for you help and patience.
    But your last statement "copy and paste your frameset encoding" just got me lost.
    In Flash, I know how to use the "MyLoader" to load an outside file (but loading HTML pages in it does not work) But it only has these Parameter options:
    autoLoad:True
    contentPath: "URL goes here
    autoScale:True
    I also know how to point a button's AS2 to open a URL page.
    on (release) {
    getURL("URL Link Goes Here",_blank);
    Those are the only pointing methods I know.
    Now that I think about it. do I change the "_blank"  part of the AS2 code to the name of the Iframe instead?

  • Drilling into XML with JS

    1. I am using an xml file with the following basic structure:
    <investor level="500">
    <membership>6 month Café
    Membership</membership>
    <perks>
    <perk>Free regular/decaf coffee, tea or café
    Americano everyday for 6 months</perk>
    <perk>One Free baked good every week</perk>
    <perk>1 free drink of choice each month for 6
    months</perk>
    <perk>1 free pound of coffee during the 6
    months</perk>
    </perks>
    </investor>
    etc. (no problem with the xml, etc.)
    2. Am setting the datasource with:
    var dsInvests = new
    Spry.Data.XMLDataSet("Investors/investorPerks.xml",
    "investors/investor");
    Am outputting the various levels and then when click on a
    level, pass the RowNumber to a JS Function. Proper number is being
    passed.
    3. My JS script has 2 functions:
    function handleInvestClick(id) {
    var myData = dsInvests.getData()[id];
    setInfo(myData);
    then
    function setInfo(info) {
    var myInfo = "";
    var infoArea = document.getElementById('investArea');
    var hd = var hd = '($ ' + info['@level'] + ') ' +
    info.membership;
    myInfo += hd;
    infoArea.innerHTML = myInfo;
    The above works fine.
    HOWEVER, I can't seem to find the syntax to go further into
    the xml.
    I want to get the number of perk nodes (children of the perks
    node), loop through those, and get the perk data for each node.
    But, if I do something like the followings, I just undefined:
    info.perks
    info.perks.length
    info.perks.perk[0]
    (The latter 2 must produced an error, because I get no
    results).
    Not sure if I'm trying to do something impossible, or just
    not doing it right.
    Since the "membership" node shows, I'd think I could get to
    the others.
    Sorry for so much code, hard to explain without it...hard to
    explain with it, too!
    Appreciate any help.
    Keith

    Thanks, Kin. Nice to know that it's a limitation of the
    nested structure right now, not my thinking!
    I had gotten something to work along the lines of what you
    had. Although, with yours, I kept getting a failed to establish
    context so didn't get any of the detail area.
    I *like* being able to do a lot of the manipulation through
    JS, especially so can not necessarily show the detail for first set
    automatically and be able to change css and innerText.
    However, here is what I got to do what I wanted (other than
    it does show the first detail automatically.
    my ds sets:
    var dsInvests = new
    Spry.Data.XMLDataSet("Investors/investorPerks.xml",
    "investors/investor");
    var dsInvestPerks = new
    Spry.Data.XMLDataSet("Investors/investorPerks.xml",
    "investors/investor[@level = '{dsInvests::@level}']/perks/perk")
    // this is quite like yours, but I went further into the xml.
    Also, used ' ' at the dsInvests==. Added that to yours, but it
    didn't help.
    Here are the two output areas:
    <h2>Investment Levels</h2>
    <div id="levelWrap" spry:region="dsInvests" align="center"
    class="spryHiddenRegion">
    <table id="interestLevel" cellspacing="0">
    <tr class="spryHiddenRegion">
    <td spry:repeat="dsInvests">
    <span id="r_{ds_RowNumber}"
    onclick="handleInvestClick('{ds_RowNumber}');" title="Click for
    details">${@level}</span>
    </td>
    </tr>
    </table>
    <div id="levExp">Click other investment levels above
    for details on that level</div>
    </div>
    <div id="investArea">
    <div id="invHead" spry:detailRegion="dsInvests">
    <div><strong><span id="detLevel">(
    ${@level} investment)</span>
    {membership}</strong></div>
    </div>
    <div spry:region="dsInvestPerks"><ol><li
    spry:repeat="dsInvestPerks">{perk}</li></ol></div>
    </div>
    finally, the extra JS for the click handler in level list:
    function setCells() {
    var currRow = dsInvests.getCurrentRow().ds_RowID;
    var rows = dsInvests.getData().length;
    for(var i = 0; i< rows; i++){
    var myID = document.getElementById("r_" + i);
    if(i != currRow){
    myID.className = "liveLevel";
    myID.title = "Click for details on this level";
    } else {
    myID.className = "deadLevel";
    myID.title = "Level currently shown below";
    Spry.Data.Region.addObserver("levelWrap", function(nType,
    notifier, data) {
    if (nType == "onPostUpdate")
    setCells();
    function handleInvestClick(id) {
    //var myData = dsInvests.getData()[id];
    //setInfo(myData, id);
    dsInvests.setCurrentRow(id);
    setCells();
    This all works, although seems a bit convuluted. (Although
    does show the first set's detail region at start.)
    This Spry stuff is great! I'm enjoying working with it and
    looking forward to further evolution. Nice alternative when
    Flash/Flex seems overkill for what is needed.
    I combined some Spry with ColdFusion to do a couple parts in
    a site that I'm developing. It's on the Directions and Investors
    pages in:
    http://64.118.70.228/
    In the directions page, I use CF to read my xml to get the
    templates of various directions to CFInclude. Then the spry click
    on the area handles setting the CSS display properties to show the
    proper directions. (Would be nice if there was a way to include an
    html page in a page like we include pictures. Then wouldn't need
    the CF step!
    Thanks for help!
    Keith

  • Embedding HTML into forms to make 3rd party Host Work

    My form looks wonderful!  Only one problem.... It doesn't work!
    It won't says the form was submitted successfully, but I don't receive it.  After reading a thread that said I have to make sure my host provider enables PHPmail, I contacted them they said I need to enter the following:
    mail("receiving-email","subject","message-body","headers");
    Into the form to make it work.
    Is this right?
    If so, how and where in the form do I embed it.  I don't want to screw up the widget.  I opened the html page for the form, but again I don't know where to put this line, if at all.
    Thanks in advance,
    Doc

    i tried uploading using FILEZILLA and everything worked perfectly!!
    consider this solved!!

  • Embedding html in xml tags, when rednering text as html

    Quick question,
    I have a site that reads all content from an external xml.
    The text box that reads this info renders the content as html; does
    anyone know how to go about putting an html tag in an xml tag so
    that flash can read it?
    So would it be possible to do:
    <content>
    " Welcome to the site<br>we are happy to have you
    here<br><img src="logo.jpg"> "
    </content>

    I completed deleted the old way, so I have to recreate this
    from scratch...but here is how I used to be able to do it (which,
    looking at how I do it now since HTML wasn't parsing, this was so
    stupid).
    <chair id="1" price_point="High-end">
    <image>&lt;a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&amp;PageID=%7B7A0FB858%2D2184%2D4033%2DB 474%2D2B22D89BBD96%7D'&gt;&lt;img
    src='/images/s/dshe/mini/7/79219.jpg border='0'
    /&gt;&lt;/a&gt;</image>
    <description>&lt;a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&amp;PageID=%7B7A0FB858%2D2184%2D4033%2DB 474%2D2B22D89BBD96%7D'&gt;Toni&lt;/a&gt;</description>
    <brand>Kwalu</brand>
    <composition>Kwalu</composition>
    <leg_style>Chippendale</leg_style>
    <overall_style>Transitional</overall_style>
    </chair>
    And now in 1.1, having that, it prints this on screen:
    <a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&PageID=%7B7A0FB858%2D2184%2D4033%2DB474% 2D2B22D89BBD96%7D'><img
    src='/images/s/dshe/mini/7/79219.jpg border='0' /></a>
    whereas before, it would be that image and it would link to
    the page specified in the href.
    I'm about to take off from work for the night, but I'll check
    back when I get home if you need anything else from me.
    Thanks for your help, Kin. :)
    Kyle

  • Embedding HTML into a JSFF dynamically

    Hi,
    I have a requirement where I need to embed an HTML table into a jsff (popup).
    I have a method which returns me a String (HTML) based on various other dynamic conditions.
    The returned HTML is a table. Now I need to show this HTML in a popup when user does an action on the base page.
    Is there a way to embed the HTML code into a jsff page dynamically?
    Any pointers to this are appreciated.
    I am using Jdev-11.1.1.4.0 (Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923).
    Thanks in Advance!
    -Swapna

    Hi,
    shay is right, you can create a HttpServlet which you can pass parameter as queryString and in doGet method you can get these parameter and call your proedure that gives you dynamic HTML. you can directly write the html as output using PrinterWriter.
    Where as writing html in ADF is considered as very BAD practice..
    Regards,
    Santosh.

  • Problem converting MSWord into PDF with Acrobat 8.1

    I have a problem very similar to this. I also have a new laptop with WINDOWS Vista professional, MS Office 2007, and Acrobat Standard 8.1.
    The 'Create PDF' button in MSWord (and MSExcel, Powerpoint etc) does not work even for the simplest of Word file without any speacial character. Also if I try to convert the file from inside Adobe Acrobat using "Create PDF/From File...", I get the following message: "An unexpected error occurred. PDFMaker was unable to produce the Adobe PDF." The Acrobat printer is working fine.
    Any Remedy?

    See my answer to your duplicate posting
    http://www.adobeforums.com/webx/.59b4eeda/0

  • Problem populating html form fields with data from database.

    I'm using a straight forward piece of code to populate a form with data from a database, to create and 'edit record' page. The code is as follows;
    TO RETREVE THE DATA FROM THE DATABASE;
         $query = "SELECT * FROM $table WHERE newsletter_id = '$newsletter_id'" ;
         mysql_select_db($database) ;
         $result = mysql_query($query, $connect);
         $numRows = mysql_num_rows($result);
         $dbnewsletter_title = mysql_result($result,$i,'newsletter_title');
    TO POPULATE THE FORM FEILD;
    <tr>
              <td width="140"><p class="admin">Newsletter title</p></td>
              <td><input name="newsletter_title" type="text" <? print "value=$dbnewsletter_title";}?> /></td>
            </tr>
    However, when I view the page, the string shows in the text feild, but seems to be split at the point of the first space. So basically only the first word of the string shows in the text field. If I try to print '$dbnewsletter_title' outside of the table, the string is shown in full as it should be.
    Does anyone know what is causing this problem?
    Many Thanks

    Put the value in quotes:
    <?php print "value='$dbnewsletter_title'"; ?>

Maybe you are looking for

  • On Windows 2012 Terminal Server Outlook fails to connect to Exchange 2013

    I have a new install of Windows 2012.  I have two physical servers.  One is a W2012 std Domain Controller ("DC").  The Second is configured as W2012 HyperV  ("HV").  Under HV I have two VMs.  One VM is W2012/Exchange 2013 ("ExchVM) and the other is W

  • System.ArithmeticException by Windows.System.Display.DisplayRequest.RequestRelease()

    Could anyone shed some light on whey Windows.System.Display.DisplayRequest.RequestRelease() occasionally throws System.ArithmeticException? The error message is: Overflow or underflow in the arithmetic operation. Hong

  • Setting up access points for public access

    Okay, here's the situation. I have a PowerMac G4/1.25GHz dual processor running Server X 10.3.9 with four Mac clients (a small law office). Up until recently, everyone had also been running (client) 10.3.9, but I started upgrading some of them to 10.

  • How to get back utilities, system preferences and safari

    The utilities was lost in my iMac, and so did safari. Maybe my boy deleted them in mistake, he is interested in finding the secret of iMac since I bought it three months ago. I can't launch system preferences to change the setting of iMac, and thanks

  • Deserializing a file not serialized using Java

    Hello , I am trying to deserialize and read a file which has been previously serialized using VC++. Is there a way to read a file serialized by VC++ using Java. When i read using ObjectInputStream, exception is thrown (StreamCorruptedException). The