LabVIEW webservice: How to format the published XML data

Hi,
Im trying to  publish some measurement data with LabVIEW webservice and read the data with Android client. However i have some problems with the XML output from the LabVIEW webservice.
I want to publish the data in in this form:
<Response>
 -<Terminal>
        <Parameter> Temperature</Parameter>
         <Value> 5 </Value>
        <Unit> ºC </Unit>
       <Description> Measurements from Sensor 1</Description>
   </Terminal>
</Response>
Any ideas how i can do this? i havent found any good example on how to format the XML output this way. 

Hi,
You can format the data using Format Into String as shown in the attached snippet. Is this maybe something you can use?
Willy
Willy
Attachments:
format xml data.png ‏31 KB

Similar Messages

  • How to retreive the modified XML data?

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

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

  • How to access the following xml data in Flex

    <users>
    <user dept id="HR">
         <user>
              <fname>mm</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>sss</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    <user dept id="Finance">
         <user>
              <fname>ffff</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>www</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    </users>
    using HTTP service through access the data
    this my user.xml file i want to display all the item in flex datagrid using tab navigator function................ each tab navigator contain one data grid for corresponding Dept like HR, sales , Finance
    corresponding information will display in data grid
    first tab navigatore is
    HR ->  data grid field like fname , Email
    finance -> fname, E Mail

    great for quick reply
    my XML file is data.xml
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    private var myUser:XML =
    <users>
    <dept id="hr">
        <user>
            <firstName>murali</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>bharathi</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vasa</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept id = "finance">
        <user>
            <firstName>mohan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vinoth</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept ="sales">
        <user>
            <firstName>manoj</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>deepan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    </users>
    codings i used
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute" creationComplete="htp.send()">
        <mx:HTTPService id="htp" url="data.xml"
            result="resulthandler(event)"
            fault="faulthandler(event)"/>
            <mx:Script>
                <![CDATA[
                    import mx.collections.ArrayCollection;
                    import mx.rpc.events.FaultEvent;
                    import mx.rpc.events.ResultEvent;
                    [Bindable] private var userlist:ArrayCollection;
                    private function resulthandler(event:ResultEvent):void
                        userlist=(htp.lastResult.user.dept.user);
                    private function faulthandler(event:FaultEvent):void
                ]]>
            </mx:Script>
            <mx:TabNavigator>
            <mx:Repeater id="rep" dataProvider="{data.dept}"> <!--data.xml is my fle name-->
                <mx:Canvas label="{rep.currentItem.@id}">
                    <mx:DataGrid dataProvider="{rep.currentItem.user}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Name" dataField="fname"/>
                            <mx:DataGridColumn headerText="E Mail" dataField="email"/>
                        </mx:columns>
                    </mx:DataGrid>
                </mx:Canvas>      
            </mx:Repeater>
    </mx:TabNavigator>
    </mx:Application>
    its not show anything

  • How to use the validation.xml in struts validation?

    Can any one please help me, how to use the validation.xml in struts validation? possible please give me simple example.
    Edited by: SathishkumarAyyavoo on Jan 31, 2009 12:03 PM

    These 2 are the good articles for the beginners to do validation things in Struts. you can follow any one of them.
    1. [http://viralpatel.net/blogs/2009/01/struts-validation-framework-tutorial-example-validator-struts-validation-form-validation.html]
    2. [http://www.vaannila.com/struts/struts-example/struts-custom-validation-example-1.html]
    All the best.

  • How to config the web.xml file, when I use Richfaces + RI 1.2?

    Hi there:
    I want to use Richfaces + RI 1.2 to build a project. I don`t know how to config the web.xml file.
    By the way, my web server is Tomcat 6.0, my JDK's version is 6u6. I don`t want to use the facelets.
    thanks.
    lxm

    just add this before *</web-app>*
    <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>blueSky</param-value>
      </context-param>
      <filter>
           <display-name>RichFaces Filter</display-name>
           <filter-name>richfaces</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
           <filter-name>richfaces</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

  • How to format the value in narrative ?

    Hi Experts,
    In BIEE 11,
    How to format the value in narrative , such as separator.
    In table or pivot property, I have set the separator for measure , but in narrative, the format will be disappeared. So how to implement this requirment?

    I had this problem with 11.1.1.6.0
    If you want this format as the default display format for this column everywhere, then you can save that format as default display format for the column or data type (Lower right corner of data format tab: "Save as Default" button, "Save as the system-wide default for "Table"."Column"). When I had the problem the narratives did use the default display format.
    Another workaround could be a direct database call to convert the data to a string. For example, in Oracle
    EVALUATE('TO_CHAR(%1,%2)' AS CHAR(30), “Table".“Column" ,'$9,999.00')
    but you may need to set EVALUATE_SUPPORT_LEVEL in your nqsconfig.ini, and this ties you to the database technology.

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to Formate the Font of The Tree's Parent Node ?

    Hello,
    Pls. , how to Formate the Font of The Tree's Parent Node ?
    Other Formatting Aspects..etc.
    Regards,
    Abdetu..

    In ur code is HTREE$ is of type varchar2 or ITEM?
    Give valid parameter for item_name/item_id.
    This code will be usefull to add/change the icon of the node. You can show the 16x16 image (gif, ico based on your forms_home\forms\java\oracle\forms\registry\Registry.dat file) before the tree item's node lebel.
    I tried in this way to get the "Favourites" node label as *"Favourites"* (Bold).
    I make *"Favourites"* as a gif icon (16 x 270) and added it as a node icon. but it shows 16 x 16 of my image.
    So using this code u cannot format the font of the tree's parent node.
    Balaji.

  • I had a trouble with my lap top and had to format hard disk and install all soft ware again. could any body tell me how to transfer the application and data in my i phone back to my laptop.

    I had a trouble with my lap top and had to format hard disk and install all soft ware again. could any body tell me how to transfer the application and data in my i phone back to itune.

    You can't. It still thinks that your iPhone is synced with another iTunes library (the one that you had before you reformatted the hard drive.

  • Can any body help me how to make the build.xml

    Can any one tell me how to make the build.xml and want to deploy in the iplanet server. I am very new for that. I dont have any idea of build.xml. If any one have code in build.xml please tell me [email protected] Please if any one is having sample exaple please forward it to me. I am waiting for the quick reply. Please its very urgent mail me.

    htpp://ant.apache.org
    http://ant.apache.org/manual/using.html#example
    Good Luck
    Lee

  • How to reomove the jobticket.xml's??

    Hello I would like to know how to remove the jobticket.xml's.   I know how to delete the extraction files, but all the jobticket generations are clogging up my mstrres folder.  Any advice would help.  I checked all the documentation and there is nothing concerning this modification.
    Thank you very much!

    Wait a minute, you said you wanted to get rid of jobticket files, now you mention PDF files. Let's talk PDF files then.  In general PDF files are registered with the server for later deletion, except in cases when you generate the names of these yourself and send them in. Check if the PDF file names are in any of the files called filecache.properties.*. If they are - they will be  be removed by the server. The time controlled via INI option and I think defaults to 2 hours, so within up to 4 hours the PDFs with names generated by IDS/gendata combination should be removed. INI is <Control> PDFFileCache = number of seconds, defaults to 7200 (2 hours).

  • How to deploy the web.xml file when trying to use the JSP SDK from SAP?

    I want to use the adduser.jsp which downloaded form SAP SDK samples to add user in BO, but I cannot run it sucessfully. I believe it's caused the web.xml file was not deployed appropriately.
    could you please teach how to deploy the web.xml file for the JSP samples ?
    Could you show me some sample of web.xml for the SDK jsp files? Thank you very much!

    Ensure that you have followed below directory structure while deploying your web application.
       web_application_name
          WEB-INF
             lib
             classes
    web.xml must be placed in WEB-INF. Ensure that you have included all the jar files and other necessary files in your application.
    For more information refer to the below link:
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    Regards,
    Anuj

  • How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

    How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
    I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
    Unable to retrieve the data in multiple rows within webservice method.

    Hi Paul,
    I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
    this is my code
    TextField1.rawValue=xmlData.document.rawValue;
    xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
    for(var i=0; i<count; i++)
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
    Table1.Row1.instanceManager.addInstance(true);
    Thanks
    Hussam

  • How do you store parsed XML data in an array

    Hi, i am trying to complete a small program which implements the SAX parser to parse an XML file. My problem is that i am writing a custom class to store the parsed data into an array, and then make the array available to the main program via a simple method which returns the array. I know this must be very simple to do, but i seem to have developed a mental block with this part of the program. I can parse the data and print all the elements to the screen, but i just cant figure out how to store all the data elements into the array. I will post the class which is supposed to do this, and ask anyone out there if they know what i'm doing wrong, and also, if there is a more effeicient way of achieving this ( i expect there definitely is!! but i have never used the SAX parser before and am getting confused by the API docs on it!!) Any help very much appreciated.
    Here is my attempt at coding the class to handle the parsed XML data
    class Sink extends org.xml.sax.helpers.DefaultHandler
         implements org.xml.sax.ContentHandler{
    Customer[] customers = new Customer[20];
         int count = 1;
         int x = 0;
         int tagCount = 0;
         String name;
    String custID;
         String username;
         String address;
         String phoneNum;
    public void startElement(String uri, String localName, String rawName, final org.xml.sax.Attributes attributes)throws org.xml.sax.SAXException{
    //count the number of <name> tags in the XML file
         if(rawName.equals("name")){
              tagCount++;
    public void characters(char[] ch, int start, int len){
    //get the current string
         String text = new String(ch, start, len);
         String text1 = text.trim();
    //there are 5 elements for each customer found in the XML file so when the count reaches 6
    // i reset this to 1
         if(count == 6){
         count = count - 5;
         if(text1.length()>0 && count == 1){
              name = text1;
              System.out.println(name);
              }else{
         if(text1.length()>0 && count == 2){
              custID = text1;
              System.out.println(custID);
                   }else{
                   if(text1.length()>0 && count == 3){
                   username = text1;
                   System.out.println(username);
                   }else{
                        if(text1.length()>0 && count == 4){
                        address = text1;
                        System.out.println(address);
                        }else{
                        if(text1.length()>0 && count == 5){
                             phoneNum = text1;
                             System.out.println(phoneNum);
                             //add data to the customer array
                             customers[x] = new Customer(name, custID, username, address, phoneNum);
    // increment the array index counter
                        x = x+1;
                        }//end of if
                        }//end else
                        }//end else
                   }//end else
              }//end else
    }//end of characters method
    public void endDocument(){
         System.out.println("There are " + tagCount +
         " <name> elements.");
    }//end of class Sink
    Before the end of this class i also need to make the array available to the calling program!!
    Any help would be much appreciated
    Thanks
    Iain

    Ok, yer going about this all the wrong way. You shouldn't have to maintain a count of all the elements. Basically you are locking yourself into the XML tags not only all being there but are assuming they are all in the same order. What you should do is in your characters() method, put all of the characters into a string buffer. Then, in endElement() (which you dont use btw, you should) you grab the information that is in the string buffer and store it into your Customer object depending on what the tagName is.
    Also, you should probably use a List to store all the Customer objects and not an single array, it's more dynamic and you arent locked into a set number of Customers.
    I wont do it all for you, but I'll give you a good outline to use.
    public class CustomerHandler extends DefaultHandler {
        private java.util.List customerList;  // List of Customer objects
        private java.util.StringBuffer buf;   // StringBuffer to store the string of characters between the start and end tags
        private Customer customer;  // Customer object that is initialized with each entry.
        public CustomerHandler() {
            customerList = new java.util.ArrayList();   // Initialize the List
            buf = new java.util.StringBuffer();   // Initialize the string buffer
        //  Make your customer list available to other classes
        public java.util.List getCustomerList() {
            return customerList;
        public void startElement(String nsURI, String sName, String tagName, Attributes attributes) throws SAXException {
            // Clear the String Buffer
            //  If the tagName is "Customer" then create a new Customer object
        public void characters(char[] ch, int start, int length) {
            //  append the characters into the string buffer
        public void endElement(String nsURI, String sName, String tagName) throws SAXException {
            // If the tagName is "Customer" add your customer object to the List
            // Place the data from the String Buffer into a String
            //  Depending on the tagName, call the appropriate set method on your customer object
    }

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

Maybe you are looking for