Flattening of xml

Hey,
I have an xml document that is an atom feed.
As atom feeds go the repeating element is the
<entry> I'm trying to access the
<contributor><name>text</name></contributor>
Is there any "work around" usings Spry's API to access
this?

http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html
That is the information u seek :)

Similar Messages

  • Flatten to XML does not save Item Names of ListBox to XML file.

    On my Front Panel, I have a ListBox Indicator that has Strings from which the User can select. Also the User can edit items in the ListBox to add new elements. After the user selects one and pushes my Save button, I use the Flatten to XML function to save the selection in an XML file. But Flatten to XML only saves the Value (index of the selected item(s)) to the XML file and not the ListBox Item Names. That is enough information to reconstruct which of the String data that the user selected.
    In a ListBox where a User is selecting among a list of Strings, shouldn't the Flatten to XML function also store the String(s) that were selected?
    Solved!
    Go to Solution.

    Dennis Knutson wrote:
    The control is a U32 which is no different than placing a regular numeric control on the front panel. The flatten to xml is only passed a numeric value in both cases. It can't record something that you do not pass to it. The state of the control is the numeric value and the state can be reconstructed with that numeric. If you want to reconstuct the strings (which are not states), use the property node.
    I disagree. A ListBox that contains Stings to select from is full of String information. Both I and the User entered those Strings into the ListBox. It is the only data in the Listbox that we see. It is the most important information in the ListBox. The Strings are present in the Item Names. The Flatten to XML does have access to the Item Names and can and should provide them. Neither I nor the User are interested in the Numeric Index of the Selected Items. That is useless information to us. Both of use are dealing with Strings. If the State of the ListBox control is to be reconstructed from the XML data provided by the Flatten to XML function, then the Strings (Item Names) in the Listbox must be provided in the XML data.

  • Floating point precision of "Flatten to XML"

    It appears that the "Flatten to XML" function (LV 7.1.1) truncates floating point numbers to 5 decimal places.  This is a rather annoying limitation, since I'm trying to store a relative time in hours, accurate to the second (chosen by a previous coder that I have to be compatible with - otherwise I'd just use seconds).  Is there a workaround to this?  (other than multiplying by some power of 10 before flattening, and dividing after unflattening)
    Jaegen

    Hi Paul and Jaegen,
    I checked our databases and found entries of product suggestions and
    corrective action requests for the behavior of the limited precision
    when flattening to XML. I found an interesting reply from a LabVIEW
    developer on the request for further precision:
    The Flatten To XML primitive puposefully cuts off all numbers at 5
    digits after the decimal. There are 3 main reasons for this:
    Information regarding precision is not propagated on the wire.
    Therefore, there is no real way to know how many significant digits or
    even places past the decimal point is appropriate when data is
    flattened to XML.
    Bloat. If all floating point values printed all of the possible
    decimal digits all of the time, this would provide for some very large
    blocks of XML code.
    Given the arbitrarily complex nature of LabVIEW data, it is
    difficult to provide a method for specifying precision. For example, if
    a user has a cluster of clusters, each of which contain a single,
    double and extended representing various measurements of differing
    accuracy, how can one precision setting be applied to each of these
    values? The user would have to unbundle (and index if an array was
    involved), flatten, concatenate, and then the reverse on the unflatten
    side.
    I suggest that you go ahead and file a new product suggestion by using the "feedback" link on www.ni.com/contact.
    It would be best if you could give some detailed information on how you
    would like LabVIEW to handle different scenarios while getting around
    the above issues.
    Thanks for the feedback!
    - Philip Courtois, Thinkbot Solutions

  • Flatten to XML error

    I'm having an odd error with the Flattent to XML function. I am using it to save a settings type definition for a data acquisition VI I made.  It works beautifully almost all the time until now.  I built a calibration routine that calculates the slope and intercept for my torque measurement using the lineear fit.vi and automatically puts the calculated slope and intercept into the settings type def then saves it. However when I try and save the type definition the Flatten to XML throws an improper input error.  If I just type the same value in and save it works fine.  I can't seem to wrap my head around why I'm getting this error.  Is the linear fit vi not outputting the data as a double?  Why would saving the settings type def with the slope and intercept inserted into the cluster cause an error when manually typing it in does not?
    Thanks for any help,
    Richard 
    Attachments:
    Save Settings XML.vi ‏45 KB
    TorqueCalibration.vi ‏64 KB
    FXML Error.JPG ‏25 KB

    The file path is good as it does not change depending on the method used to save (Code to get the filepath is below). As for the output I'm not sure exactly what your asking for, just a copy of the XML document after the error? Unfortunately I don't have a copy handy.  On the plus side I found a work around though why it works is beyond me.  Before when the code saved the settings to XML directly after the calibration routine calculated the values it caused the error, but I I allow the program to run a few loop iterations with the new values in the settings type definition it saves with no error.  So now the program just loads the new values to the settings type definition and then waits for the user to hit a save button (thats there already for when they make manual changes) and it works.    I can't wrap my head around WHY it works as it seems to be saving the exact same information but there you go.

  • Anyone have example stylesheet for Flatten to XML output

    I would like to log the output of a "flatten to xml" vi and display it in a tabular format in my Teststand xml report.  I'm wondering if anyone has a starting point for the stylesheet side of things.

    Almost there....
    I have a properly formated XML string from Labview to Teststand.  I have the XSL which has been tested and added to my horizontal.xsl used by the Teststand report.  My problem now is that when I log the XML string using Additional Results, Teststand is putting the CDATA tag around the string preventing it from using my XSL.   Is there a flag or something to set so Teststand will add the XML as is.
    I've done this before using the ModifyReportHeader callback and the GetXML method, but the ModifyReportEntry doesn't work for XML reports.  So I really need to know how to stick my XML in the report from my client sequence file without Teststand altering it.
    Thanks,
    Kevin
    Attachments:
    Capture.PNG ‏5 KB

  • Precision of Flatten to XML

    In LabVIEW 6.1 the Flatten to XML function seems to truncate double precision data to 5 decimal places. Is there a way to extend the precision to 10 or 15 decimal places?

    I know that this thread is quite out of date, but afaik there is still no solution for this problem.
    I wrote a .NET dll to parse and reformat the LabView-Xml to a more human-readable form, and also not type specific (only specific on the control names). I thought the double-precision problem was already solved, but it is definitely not. Is there any reason that the precision is always truncated? As Xml nowadays is a common way to share data, for me it was no question that LabView supports it completely, but now I know it doesnt. Is there any workaround? I dont want to use OpenG as its to slow, and also not localization-independent; it shouldnt be a problem just to extend the precision to the maximum possible, printf() always supported this.

  • Flatten to xml from variant

    I have problems with flattening variant data to xml-strings. I tried to make an application to save variant data to xml-files, but the vi "flatten to xml" didn't solve always the same solution. The bug don't occur always and i tried alot to show it. The vi produce sometimes not finished xml-strings. I attached a vi, witch shows the bug on my computer every time.
    Thanks for help, Mathis Wieland
    Attachments:
    error_variant_to_string.vi ‏40 KB

    I installed OpenG toolbox and OpenG Flatten to XML, the error with changing results is fixed, but this vi can't make variants to a xml-string, as well it has problems with the value fo refnums.
    Yours sincerely
    Mathis Wieland
    Attachments:
    error_flatten_to_xml.vi ‏35 KB

  • Flatten hierarchical xml

    Is there a way of flattering an hierarchical xml?
    <menu name="Safety Catalog" menuid="1" parentid="">
      <menu name="General  Regulations" menuid="12">
        <menu name="Rule Gr-1" menuid="13" parentid="12"/>
        <menu name="Rule Gr-2" menuid="14" parentid="12"/>
       </menu>
    </menu>
    will become
    <menu name="Safety Catalog" menuid="1" parentid="">
         <menu name="General  Regulations" menuid="12"/>
         <menu name="Rule Gr-1" menuid="13" parentid="12"/>
         <menu name="Rule Gr-2" menuid="14" parentid="12"/>
    </menu>
    Thanks

    I think you'd have to do that manually, but xml..menu will flatten the
    second and higher levels into one XMLList

  • Flattening the xml data

    Hi,
    I have the following XML loaded in the xmltype column.
    <g1>
         <f1>A</f1>
         <g2>
              <f2>a</f2>
              <g3>
                   <f3>1</f3>
                   <f3>2</f3>
                   <f3>3</f3>
              </g3>
         </g2>
         <g2>
              <f2>b</f2>
              <g3>
                   <f3>5</f3>
                   <f3>6</f3>
                   <f3>7</f3>
              </g3>
         </g2>
    </g1>
    From the above xml, how to get the following result,
    f1 f2 f3
    ===========================
    A     a 1
    A     a 2
    A     a 3
    A     b 5
    A     b 6
    A     b 7
    Thanks.

    SQL> var test varchar2(256)
    SQL> --
    SQL> begin
    2 :test := '<g1>
    3 <f1>A</f1>
    4 <g2>
    5 <f2>a</f2>
    6 <g3>
    7 <f3>1</f3>
    8 <f3>2</f3>
    9 <f3>3</f3>
    10 </g3>
    11 </g2>
    12 <g2>
    13 <f2>b</f2>
    14 <g3>
    15 <f3>5</f3>
    16 <f3>6</f3>
    17 <f3>7</f3>
    18 </g3>
    19 </g2>
    20 </g1>';
    21 end;
    22 /
    PL/SQL procedure successfully completed.
    SQL> select xmltype(:test).extract('/*')
    2 from dual
    3 /
    XMLTYPE(:TEST).EXTRACT('/*')
    <g1>
    <f1>A</f1>
    <g2>
    <f2>a</f2>
    <g3>
    <f3>1</f3>
    <f3>2</f3>
    <f3>3</f3>
    </g3>
    </g2>
    <g2>
    <f2>b</f2>
    <g3>
    <f3>5</f3>
    <f3>6</f3>
    <f3>7</f3>
    </g3>
    </g2>
    </g1>
    SQL> column F1 format A4
    SQL> column F2 format A4
    SQL> column F3 format A4
    SQL> --
    SQL> select extractvalue(xml,'/g1/f1') F1,
    2 extractvalue(value(g2),'/g2/f2') F2,
    3 extractValue(value(f3),'/f3') F3
    4 from (select xmltype(:test) as xml from dual),
    5 table (xmlsequence(extract(xml,'/g1/g2'))) g2,
    6 table (xmlsequence(extract(value(g2),'/g2/g3/f3'))) f3
    7 /
    F1 F2 F3
    A a 1
    A a 2
    A a 3
    A b 5
    A b 6
    A b 7
    6 rows selected.

  • Flatten to XML bug with unit variables in classes

    Hi,
    I just spent about 5 hours trying to figure out why some of my class data kept resetting itself to zero.  Turns out that the part that kept resetting was the part that had a unit variable in it, and that fails to load properly from the Unflatten From XML VI.  It works fine if it's just a cluster, it's being in a class that's the problem.
    I've attached the zip file with the example VIs.
    Could I ask that someone with LV 2014 try this to see if the bug exists there?  
    Right now we're running 2011, but we plan a companywide shift to 2015 as soon as it comes out (and therefore, 2011 drops from extended support).  I'd like to know if I can just wait for the upgrade and then it will work, or if I need to redo about ~15 variables in classes with units on them that I had been counting on loading and saving using the built-in XML functions.

    I was planning on trying for a CAR only after confirming the problem hadn't been quietly fixed in the last 3 years.  I couldn't find anything in the changelogs but sometimes you never know...
    Now that UliB has confirmed it's still a problem I will likely do so.

  • Flatten to/Unflatten from XML on ARM

    Using LV 9 with the ARM module on an EK-LM3S8962.
    I want to use XML on the embedded target. The data to be converted is a group of arrays in a cluster. The cluster is a type def in the embedded project. The Flatten to/Unflatten from XML VIs from the ARM pallet are used to convert the cluster to XML and back. This works OK on a Windows deployment but the application build for the ARM deployment fails with this message:
     Status: Error
    linking...
    .\Obj\LabVIEW.axf: Error: L6218E: Undefined symbol FXPLoad32 (referred from ccgxmlsupport.o).
    Target not created 
    I suspect this has something to do with the schema. Does a copy of the schema (LVXMLSchema.xsd) need to be included in the build specifications? If so, how does one add this to the project?
    Thanx
    JohnCS

    Added a fixed point calculation as suggested and now the VI builds and runs OK. 
    So far  so good, but the String to XML primitive does not generate the correct XML string. In my cluster containing two arrays of strings, none of the control labels have been encoded and the array dimensions are encoded as zero. As a consequence, the XML string will not be decoded back to the cluster correctly. In the Windows environment, the same control encodes the labels and dimension sizes.
    Is there something wrong  with my type def'ed control or with the Flatten to XML primitive as well?
    Here's a copy of my project including the build specification but without the built file.
    Attachments:
    xmltest.zip ‏19 KB

  • Flattening XML text

    Given the following XML snippet:
    <adjustments>
    <adjustment>Add <bonus>10</bonus> points
    if completion time less than
    <completionTime>60</completionTime>
    seconds.</adjustment>
    <adjustment>Add <bonus>15</bonus> points
    if opponent rank is higher than level
    <opponentRank>5</opponentRank>.</adjustment>
    <adjustment>Add <bonus>5</bonus> points if
    the temperature is above <temperature>75</temperature>
    degrees Fahrenheit.
    </adjustments>
    How would I output each adjustment as text like the
    following? In other words, how can I "flatten" the XML text?
    Add 10 points if completion time less than 60 seconds.
    Add 15 points if opponent rank is higher than level 5.
    Add 5 points if the temperature is above 75 degrees
    Fahrenheit.
    Thanks in advance for your help.

    adjustments.text() returns an empty string, of course. And
    something like adjustments.adjustment[0].text() returns just:
    Add points if completion time less than seconds.
    It doesn't have the text of of the child nodes.
    What I need is the text of a parent node and all of the child
    nodes in one string. Even if I iterate over the parent and all the
    descendants, I don't see any way of properly placing the text from
    the children into the text from the parent.
    Any other ideas?

  • Flatten Nested (Hierarchical) XML file

    Hello,
    We are looking to load an XML file into BI. However the XML file is Nested (Hierarchical). Would XI be able to flatten the XML file? We would like to push the data into BI using ABAP proxy and BI would not be able to deal with a nested XML file directly pushed using SOAP RFC or Web services.
    Thanks.

    In the nested structure, there are repeating sections where the header is not repeated. Flatten would imply each data record contains all fields, i.e. the header/parent gets repeated at the child level.
    H-
    |_A1_
         |_B1   -
    >     HA1B1
         |_B2   -
    >     HA1B2
    |_A2_                 HA2B3
         |_B3

  • XML Header Web Services 8.6

    I am developing an HTML application using LabVIEW Web Services in version 8.6. I configured a VI to output data as XML.  I am using the jQuery framework for javacript at this time. I noticed that when I try to get the data from this VI as XML jQuery won't load load it (might be having the same issue with prototype). After running a packet capture this is what I found the data from LabVIEW to look like:
    HTTP/1.1 200 OK
    Date: Tue, 18 Aug 2009 13:55:03 GMT
    Server: Mbedthis-Appweb/2.3.0
    Cache-Control: no-cache
    Content-type: text/xml
    Content-length: 87
    Connection: keep-alive
    Keep-Alive: timeout=60000, max=98
    <Response><Terminal><Name>read_buffer</Name><Value>13.509</Value></Terminal></Response>
    So it seems that  the <?xml version="1.0"> tag at the top of the document is not being sent out and I have to add this manually to my javascript code before it works. Is there anyway to force LabVIEW to send this out on the server side? My javascript code:
     <script type="text/javascript" src="js/jquery.js"></script>
     <script>
     $(document).ready(function(){
      $.get("../LambdaWeb/lambda/read_volts", null, function(data){
       var xml = $('<?xml version="1.0" ?>' + data);
       alert("Data Loaded:" + xml);
      }, "xml");
     </script>
    Also on a side note. I know that JSON is now available in LabVIEW 2009; is there anyway to get JSON support for 8.6?
    Message Edited by Pawel Kowalski on 08-18-2009 09:09 AM
    Message Edited by Pawel Kowalski on 08-18-2009 09:10 AM

    Is there any way so that one can send data (array 'DBL' & about 60,000 elements) after converting it to a string using 'Flatten to String' function and not using 'Flatten to XML'?
    Reason behind using 'Flatten to string' is the size of flattened data is much lesser that it would be in later case.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Using informations about the XML Data Set in *.js

    Dear Users,
    I hope I am able to explane my problem correctly:
    I wonna create a fade effect with various pictures. They don't should blend to 0 - I found a js script that lets the pictures fade from one to the other like this: www.sv-guenther.de
    What this script needs is the number of pictures. I put the picture links into an XML file. Everything works as long as write the number or length of the picture children manually.
    I tried to read out the length by using the ds_RowCount option. This works fine as long as I use this in HTML context like this:
    <div spry:region="ds1" ><script type="text/javascript">  alert({ds_RowCount});</script>{ds_RowCount}</div>
    Both works: The alert shows the number 21 AND you can read the "21" and not {ds_RowCount}.
    okay, but how do I use the "21" integer in a script block in the head area? like this:
    <head>
    <script type="text/javascript">
    var x = {ds_RowCount};
    </script>
    </head>
    I tried it in different ways: var x = '{ds_RowCount}'; or spry:....
    As you can see: I am afraid my scripting knowledge is not the best - like my English is...
    Sorry and thank you very much for your help! - any kind of help
    best regards from Bonn, Germany
    Thorsten

    Dear Ben,
    if you would see me, you wouldn't laugh anymore, you would cry -) - but you are in DownUnder - this would look like I am laughing for you - wouldn't it?
    Thank yoou so much for remembering me. I have been reading your post about this topic (blend a picture). Once somebody asked the same (or almost the same) like I did yesterday. But the difference is, that if you blend a text to 0 it is big diference blending a picture - in my mind. I would love to reduce the opacity from one picture when the next picture is already behind it. So it looks like a smooth fade in fade out, without displaying the background.
    I found a quite good code example for this:HERE
    To make it as easy as possible for me I tried to include the number of the pictures straight into the js code. in the meantime I found the correct code option for this: What I was looking for was: getData() and if I combine it with an observer to wait for the "onPostLoad" everything works fine. I am ashamed that I asked first and then lokked into the SPRY API - Sorry!
    Everything works fine? No not yet - unfourtunally. So I am pleased to get the chance to ask a second time:
    Let's say I have more than one picture and more than one topic. So my XML looks like this:
    <leistungen>
    <inhalte name="Bauvorhaben">
         <inhalt name="Bautechnische Beratung">
         <texte>
              <text>Beurteilung der Baubeschreibung, Beratung zur Ausführungsplanung</text>
         </texte>
         <bilder>
              <bild></bild>
         </bilder>
         </inhalt>
         <inhalt name="Baubegleitende Qualitätsüberwachung">
         <texte>
              <text>Stichprobenhafte Kontrollen der Bauausführung zur Gewährleistung der Einhaltung anerkannter Regeln der Bautechnik und vertraglicher Vereinbarungen</text>
         </texte>
         <bilder>
              <bild>3867</bild>
         </bilder>
         </inhalt>
         <inhalt name="Baumängel">
         <texte>
              <text>Feststellung und Beurteilung von Baumängeln, Ursachenermittlung,Sanierungsempfehlung, Schätzung der Instandsetzungskosten</text>
         </texte>
         <bilder>
              <bild>2857</bild>
              <bild>3612</bild>
         </bilder>
         </inhalt>
         <inhalt name="Beweissicherung">
         <texte>
              <text>Dokumentation von  Schäden an  Bestandsgebäuden im Einflußbereich von Bauvorhaben, Beurteilung von Schadensansprüchen</text>
              <text>Bauzustandsdokumentation, Leistungsfeststellung</text>
         </texte>
         <bilder>
              <bild>1176</bild>
              <bild>154</bild>
         </bilder>
         </inhalt>
         <inhalt name="Abnahme von Bauleistungen / Abnahmebegleitung">
         <texte>
              <text>Einfamilienhäuser</text>
              <text>Mehrfamilienhäuser</text>
              <text>Wohnanlagen</text>
              <text>Bürogebäude</text>
         </texte>
         <bilder>
              <bild>2485</bild>
              <bild>3485</bild>
              <bild>3481</bild>
              <bild>3460</bild>
         </bilder>
         </inhalt>
         <inhalt name="Schiedsgutachten">
         <texte>
              <text>Rechtsverbindliche Beurteilung von Bauprozessen und Gewerken zur Konfliktvermeidung und -lösung</text>
         </texte>
         <bilder>
              <bild>7080</bild>
         </bilder>
         </inhalt>
    </inhalte>
    <inhalte name="Bestandsgebäude">
         <inhalt name="Beweissicherung">
         <texte>
              <text>Dokumentation von  Schäden an  Bestandsgebäuden im Einflußbereich von Neubauten, Beurteilung von Schadensansprüchen</text>          
         </texte>
         <bilder>
              <bild>1176</bild>          
         </bilder>
         </inhalt>
         <inhalt name="Gebäudeschäden">
         <texte>
              <text>Feststellung und Beurteilung von Gebäudeschäden, Ursachenermittlung, Sanierungsempfehlung, Kostenschätzung</text>
              <text>Bautechnische Beratung beim Kauf einer Bestandsimmobilie</text>
         </texte>
         <bilder>
              <bild>2108</bild>
              <bild>4004</bild>
              <bild>1387</bild>
              <bild>3488</bild>
         </bilder>
         </inhalt>
    </inhalte>
    </leistungen>
    First I create an new object
    var ds1 = new Spry.Data.XMLDataSet("xml/leistungen.xml", "leistungen/inhalte/inhalt/texte");
    So the  dsR =  ds1.getData() gives me a dsR.length = 8 - correct - because this XML has got 8 <texte> nodes. But some of these <texte> nodes have more than one <text> node. If I asked for the contet of the fifth node dsR[4]["text"] it gives me back "Bürogebäude" = the last sub node content. I wished I could catch the first, second, third as well. Just like a spry:repeat - do you understand?
    I figured out that it doesn't help to extend the string like
    dsR[4][0]["text"] or dsR[4][0][0].
    As far as I understood the Spry framework flattens the XML like a table. So I thought that there might be just in this raw, in the actual column just another object (not a string)  to be found.This object  I could touch or open with square brackets. Like
    dsR[0]["texte"][0]
    - but: I can't!
    But this would mean, that straight in js I could always only catch the first node value??? I must be wrong!!!  But I don't know were!
    Dear Ben, Dear Guys out there - is this to difficult what I am looking for or am I blind?
    thank you so much for helping me out here - again!

Maybe you are looking for

  • Can't get sound

    Hi, I own a 22 inch Vizio LCD/FHDTV and I have a mini-DVI to VGA connector and the VGA chord all connected up, so the video is not a problem. However, I cannot get sound even with a RCA cable that connects into the headphone jack of my MacBook. I've

  • How do I access Crackle from Apple TV?

    How do i access Crackle from Apple TV?  when I click on the Crackle icon, the message instructs me to go to Crackle.com and enter access code, however there is no option for doing so on the website. thank you HWD

  • I have iPhone4, IOS 7.1.1 - calendar view issues

    I have updated both my iPhone and my iPad retina display to IOS 7.1.1. On my iPad I have the calendar view to see a list of everything in calendar, but on the iPhone I don't. I am unable to attach a screen shot so I'll explain what I can see:- iPhone

  • Related to work process

    Whats the difference between clean with CORE and without CORE ?

  • Report Painter selection variables sorting

    I have added a number of characteristics to my report painter report and set some as variables i.e. plan version 1, plan version 2, plan version 3, plan version 1 year, plan version 2 year, plan version 3 year. These variables appear on the selection