Different elements in two 1 D array

Helloo
I am having two 1 D arrayes. one array consists of r values and other theta values. For example (See attachement) , I want to take the two r values for same theta values and so on fro other tetha valules. how is this possible?
Thanks
Nghtcwrlr
********************Kudos are alwayzz Welcome !! ******************
Solved!
Go to Solution.
Attachments:
1D array.JPG ‏28 KB

You did not tell us what kid of output you want, but a FOR loop should do what you need. Autoindex on the "angles" and not on the "Rs", and you'll get a 2D array.
Message Edited by altenbach on 12-15-2008 04:13 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
BuiltComplex.png ‏16 KB

Similar Messages

  • Multiplying elements of two different arrays

    hey, I have a while loop thats performing two separate operations similtaneously and filling the data elements of two different 1d arrays with data.with each iteration of the loop a new value pass from an operation to an array.
    I need to multipy to corresponding elements of the arrays such the first element of one array is skipped. so element i0 * element j1 , element i1 * elemnent j2 etc. how can i acess the elements and make the calculations? arrays could have hundreds of elements.
    Thanks.
    Brendan

    blue silver wrote:
    hi Peter,
    I have an array of 2,000,000 values (each long int). I need to do an "Moving average" operation which would than:
    1) takes average of the first 10 values , plots it
    2) remove the first value ,add 11.th value, take average, plots it in the next 100 ms in the chart
    3) remove the first value, add 12.th value, take average, plots it in the next 100 ms in the chart
    (as you see , it is a kind of shifting) the averaged array elements is always 10 , and after averaging those 10 elements , plot it with 100 ms distance in the graph.
    1999989)  remove the 1,999,989 th element , add the last element
    you have a possible idea ?
    your help will be tremendously appreciated.
    Regards
    Silver
    Try this.  It iterates 10 times taking a subset of the array each time to sum it to a shift register.  When done, divides by the total number of iterations.  So it adds i0 to i1 to i2 to i3 to i{N}.  For each element from i0 up.  It will give you an array where n elements are missing  (because elements 0 through n-1 don't have N samples to average to.
    Message Edited by Ravens Fan on 11-26-2007 09:26 PM
    Attachments:
    Example_BD.png ‏4 KB

  • Printing every possible pair combination of elements in two arrays??

    Hi there,
    I'm trying to implement the problem of printing every possible pair combination of elements in two arrays. The pattern I have in mind is very simple, I just don't know how to implement it. Here's an example:
    g[3] = {'A', 'B', 'C'}
    h[3] = {1, 2, 3}
    ...code...??
    Expected Output:
    A = 1
    B = 2
    C = 3
    A = 1
    B = 3
    C = 2
    A = 2
    B = 1
    C = 3
    A = 2
    B = 3
    C = 1
    A = 3
    B = 1
    C = 2
    A = 3
    B = 2
    C = 1
    The code should work for any array size, as long as both arrays are the same size. Anybody know how to code this??
    Cheers,
    Sean

    not a big fan of Java recursion, unless tail recursion, otherwise you are bound to have out of stack error. Here is some generic permutation method I wrote a while back:
    It is generic enough, should serve your purpose.
    * The method returns all permutations of given objects.  The input array is a two-dimensionary, with the 1st dimension being
    * the number of buckets (or distributions), and the 2nd dimension contains all possible items for each of the buckets.
    * When constructing the actual all permutations, the following logic is used:
    * take the following example:
    * 1    2    3
    * a    d    f
    * b    e    g
    * c
    * has 3 buckets (distributions): 1st one has 3 items, 2nd has 2 items and 3rd has 2 items as well.
    * All possible permutaions are:
    * a    d    f
    * a    d    g
    * a    e    f
    * a    e    g
    * b    d    f
    * b    d    g
    * b    e    f
    * b    e    g
    * c    d    f
    * c    d    g
    * c    e    f
    * c    e    g
    * You can see the pattern, every possiblity of 3rd bucket is repeated once, every possiblity of 2nd bucket is repeated twice,
    * and that of 1st is 4.  The number of repetition has a pattern to it, ie: the multiplication of permutation of all the
    * args after the current one.
    * Therefore: 1st bucket has 2*2 = 4 repetition, 2nd has 2*1 = 2 repetition while 3rd being the last one only has 1.
    * The method returns another two-dimensional array, with the 1st dimension represent the number of permutations, and the 2nd
    * dimension being the actual permutation.
    * Note that this method does not purposely filter out duplicated items in each of given buckets in the items, therefore, if
    * is any duplicates, then the output permutations will contain duplicates as well.  If filtering is needed, use
    * filterDuplicates(Obejct[][] items) first before calling this method.
    public static Object[][] returnPermutation(Object[][] items)
         int numberOfPermutations = 1;
         int i;
         int repeatNum = 1;
         int m = 0;
         for(i=0;i<items.length;i++)
              numberOfPermutations = numberOfPermutations * items.length;
         int[] dimension = {numberOfPermutations, items.length};
         Object[][] out = (Object[][])Array.newInstance(items.getClass().getComponentType().getComponentType(), dimension);
         for(i=(items.length-1);i>=0;i--)
              m = 0;
              while(m<numberOfPermutations)
                   for(int k=0;k<items[i].length;k++)
                        for(int l=0;l<repeatNum;l++)
                             out[m][i] = items[i][k];
                             m++;
              repeatNum = repeatNum*items[i].length;
         return out;
    /* This method will filter out any duplicate object in each bucket of the items
    public static Object[][] filterDuplicates(Object[][] items)
         int i;
         Class objectClassType = items.getClass().getComponentType().getComponentType();
         HashSet filter = new HashSet();
         int[] dimension = {items.length, 0};
         Object[][] out = (Object[][])Array.newInstance(objectClassType, dimension);
         for(i=0;i<items.length;i++)
              filter.addAll(Arrays.asList(items[i]));
              out[i] = filter.toArray((Object[])Array.newInstance(objectClassType, filter.size()));
              filter.clear();
         return out;

  • Comparison of Elements of Two 2D Arrays

    Hello!
    I am trying to compare elements of two 2D Arrays and find at least one pair of elements that are identical. Browsing the forum I found one method suggested by Altenbach (http://forums.ni.com/t5/LabVIEW/Compare-elements-in-an-array/m-p/458622). However, it works well with 1D Arrays. That is why I rearranged the original code for my case, but unfortunately the attempt was unsuccessful. Could anyone please have a look at my VI and suggest any solution? 
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    Search and Compare Indices.vi ‏16 KB

    Thanks, paul_cardinale !
    It works.. Now I see the principle. 
    Sometimes, the algorithm works perfectly, but sometimes it detects only one common index.
    For example, 
    3 5   and  5 5 6
    1 0            0 1 7
    In this case (5,0) is common for both arrays. But the algorithm shows that only "5" is common. Why do u think it is happening? 
    I have attached VI. 
    Attachments:
    Search and Compare Indices.vi ‏19 KB

  • I'm using a 1D Arrary with 27 different elements and would like to send those data over UDP Write and UDP Read functions.

    I'm using a 1D array with 27 different elements. I would like to transfer that data over a UDP connection, and read it back by using UDP connections.
    But I would like to read 3 elements at a time (On read side) and send those to 9 different ports.
    Note: the data will go to only one PC with one Network Address)
    * 1st elements (0,1,2) and send to port #XXX to see those 1st 3 elements.
    * continue until the elements reaches up to 27
    This is what I have done but I'm finding myself in pitfalls...
    Send side:
    I'm using a UDP Open connection on send side to send my data. So with selected a Source Port, I have created a UDP Op
    en connection. I�m using only one source port to send all the data across the channel. I would like to read 1st 3 elements and send those data across with an assigned Destination port. I would like to do that for 9 times b/c there are 27 elements in the array. So I�m using a For Loop and setting N count to 9. So I�m not getting any errors when I execute and no answer on the other side at all.
    Read side:
    I�m using a UDP Open connection to read in the data with port #. I�m using while loop to with Boolean inside by making a true all the time. Inside that While loop, I�m using For Loop to read the 3 elements data a time and send to a right port address. (As start out I was just trying to see if it works for only one port).
    Attachments:
    UDP_SEND_1.vi ‏40 KB
    UDP_READ_1.vi ‏31 KB

    You are not getting any errors because UDP is a connectionless protocol. It does not care if anyone receives it. Your example will work fine with the following considerations.
    (1) Don't use the generic broadcast address (255.255.255.255).
    (2) You are listening on port 30000. So why are you sending to port 1502, nobody will receive anything there.
    The destination port of the outgoing connection must match the server port of the listener. (The source port is irrelevant, set ot to zero and the system will use a free ephemeral port).
    (3) On the receiving side, you are not indexing on the received string, thus you only retain the last received element. Then you place the indicator outside the while loop where it never gets updated. :-(
    (4) Do yourself a favor and don't micromanage how the data is sent across. Just take the entire array, flatten it to string, send it across, receive it, unflatten back to array, and get on with the task.
    (You can do the same with any kind of data).
    I have modified your VI with some reasonable default values (destination IP = 127.0.0.1 (localhost)), thus you can run both on the same PC for testing "as is". Just run the "read" first, then every time you run "send", new data will be received.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    UDP_READ_1MOD.vi ‏29 KB
    UDP_SEND_1MOD.vi ‏27 KB

  • I want to have two different operations on two analog output terminals of DAQ. When I work

    with AO0, it works. But after I add in another channel, AO1, there is an error saying that 'specified group is in use'. Actually, I assigned different group number for AO0 and AO1 when configuing the device using AO Config.vi. How to deal with this error?I want to have two different operations on two analog output terminals of DAQ. When I work with AO0, it works. But after I add in another channel, AO1, there is an error saying that 'specified group is in use'. Actually, I assigned different group number for AO0 and AO1 when configuing the device using AO Config.vi. How to deal with this error?

    with AO0, it works. But after I add in another channel, AO1, there is an error saying that 'specified group is in use'. Actually, I assigned different group number for AO0 and AO1 when configuing the device using AO Config.vi. How to deal with this error?Hey Steve,
    Doug is correct. Both analog outputs have a shared clock. If you want to write to both outputs simultaneously, you will need to include both of them in the same operation (group).
    You can write a 2-D array to the AO Write VI in which you can include data for both channels. In the 2-D array, column 1 will be for the first channel in the channel list and column 2 will be for the second channel.
    I hope this helps.
    Regards,
    Todd D.
    NI Applications Engineer

  • Use enum or subclassing to differentiate between different elements?

    Hello all,
    I have a design decision to make.
    I have two different Elements with everything the same except the name.
    So I have two ideas on how this can be solved.
    1. Through subclassing.
    2. Through enumeration.
    I have tried to make two examples of this so you can recommend 1 or 2 only on a conceptual level not implementation.
    Sub classing
    public class Element {
         //Methods     
    public class A extends Element {
         //Nothing
    public class B extends Element {
         //Nothing
    public class Main {
         public static void main(String[] args) {
              Element elm = new A();
              if (elm instanceof A){}
              else if (elm instanceof B){}
    }Enumeration
    public class Element {
         public enum Type {A, B}
         private Type type;
         public Element(Type type) {
              this.type = type;
         public Type getType() {
              return type;
         //Methods
    public class Main {
         public static void main(String[] args) {
              Element elm = new Element(Type.A);
              switch(elm.getType()) {
                   case A:
                   case B:
    }Thanks /Farmor
    Edited by: Farmor on Dec 15, 2009 3:14 PM (Spelling error)

    Thanks for the answers.
    Then I will go with the enum solution that will give me a lot of free things.
    Such as I can limit the API user to only choose between my predefined values and the use of my API will be much easier when used in a good IDE.
    /Farmor

  • Two dimension string array in teststand

    Hello,
    I want to pass a two dimension string array from a labWindows dll into Teststand. My labwindows dll:
    #define NR_columns 12
    #define NR_rows  1200
    #define NR_hight   1024
    int__declspec(dllexport) __stdcall  sort( char pspec[NR_columns][NR_rows][NR_hight])
    The call of the dll in teststand looks like the attached picture in the doc file.
    and I got the error message which shows the attached second picture in the doc file
    what is the problem?
    regards
    samuel
    Attachments:
    Error1.doc ‏94 KB

    Hello Samuel,
    I'm not experienced in LabWindows but I think the reason for this Error is the dimension of FileGlobals.loadspec in TestStand. The Error Dialog displays for this String Array [0..11][0..1200]. That's an array of 12 and 1201 elements but function is expecting 12 and 1200 elements.
    I hope this helps.
    Kind regards
    C. Dietz
    Test Engineering
    digades GmbH
    www.digades.com

  • Determining if element is in a certain array

    Hi,
    I was wondering if there is a way to determine if a String element is part of an array of Strings. In other words, I want to do something like:
    String myString = "blah";
    String[] stringArray = {"blah", "foo"};
    if (myString is part of stringArray) {
    // Do stuff here
    }The reason I want to do this is because I have two large String arrays, and want to determine if a String element is in one array or the other, and do some stuff based on the result.
    Is there a way to do this? If so, how? Could I use compareTo, or something like that, to determine if it is part of an array?
    Thanks,
    Dan

    Use java.util.Arrays.binarySearch(stringArray, myString) if the array is sorted, or use a more high-powered collection class instead (such as a java.util.ArrayList, and the methods it provides to search within).
    http://java.sun.com/j2se/1.5.0/docs/api/index.html

  • BI server generating  query in a different way between two instances

    Hi All,
    We have executed a report in dev,test instances,BI server generated query in a different way in two instances where as dev BI server is on AIX operating system(recently we migrated from windows),test instance is on still on Windows environment.
    For a report below are the queries
    DEV(AIX)
    WITH
    SAWITH0 AS (select sum(T316025.SALES_QUOTA) as c1,
    T329697.DIVISION_DESC as c2,
    T329697.AREA_DESC as c3,
    T329697.TERRITORY_DESC as c4,
    case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end as c5,
    T150993.X_CONS_MAJOR_GROUP as c6,
    T66755.PER_NAME_ENT_YEAR as c7
    from
    W_DAY_D T66755 /* Dim_W_DAY_D_Common */ ,
    W_PRODUCT_D T67704 /* Dim_W_PRODUCT_D */ ,
    WC_SLX_DATA_F T316025 /* Fact_WC_SLX_DATA_F */ ,
    WC_CUSTOMER_HIERARCHY_D T329697 /* Dim_WC_Customer_Hierarchy_D_With_Error */ ,
    OBIEE_SECURITY_LOCATION_SALES T339204,
    W_PROD_CAT_DH T150993 /* Dim_W_PROD_CAT_DH_General */
    where ( T66755.ROW_WID = T316025.DAY_WID and T316025.CUSTOMER_HIERARCHY_WID = T329697.ROW_WID and T67704.ROW_WID = T316025.PRODUCT_WID and T67704.PROD_CAT2_WID = T150993.ROW_WID and T329697.TERRITORY_CODE = nvl(T339204.LOCATION , T329697.TERRITORY_CODE) and T329697.AREA_DESC = 'GROCERY AREA - EAST' and T329697.DIVISION_DESC = 'DOMESTIC SALES DIVISION' and T339204.USER_NAME = upper('Administrator') and case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end = 'JETRO CASH AND CARRY ENTERPRISES INC(10313)' and (T66755.PER_NAME_ENT_YEAR in ('2011', '2012')) and (T329697.TERRITORY_DESC in ('BOSTON', 'CHARLOTTE', 'FLORIDA', 'GREAT LAKES', 'MID-SOUTH', 'NEW YORK', 'WHITE ROSE')) )
    group by T66755.PER_NAME_ENT_YEAR, T150993.X_CONS_MAJOR_GROUP, T329697.TERRITORY_DESC, T329697.AREA_DESC, T329697.DIVISION_DESC, case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end )
    select distinct SAWITH0.c2 as c1,
    SAWITH0.c3 as c2,
    SAWITH0.c4 as c3,
    SAWITH0.c5 as c4,
    SAWITH0.c5 as c5,
    SAWITH0.c6 as c6,
    SAWITH0.c7 as c7,
    SAWITH0.c1 as c8
    from
    SAWITH0
    order by c1, c6
    Test(Windows)
    select distinct D1.c2 as c1,
    D1.c3 as c2,
    D1.c4 as c3,
    D1.c5 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c1 as c8
    from
    (select sum(T316025.SALES_QUOTA) as c1,
    T329697.DIVISION_DESC as c2,
    T329697.AREA_DESC as c3,
    T329697.TERRITORY_DESC as c4,
    case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end as c5,
    T150993.X_CONS_MAJOR_GROUP as c6,
    T66755.PER_NAME_ENT_YEAR as c7
    from
    W_DAY_D T66755 /* Dim_W_DAY_D_Common */ ,
    W_PRODUCT_D T67704 /* Dim_W_PRODUCT_D */ ,
    WC_SLX_DATA_F T316025 /* Fact_WC_SLX_DATA_F */ ,
    WC_CUSTOMER_HIERARCHY_D T329697 /* Dim_WC_Customer_Hierarchy_D_With_Error */ ,
    OBIEE_SECURITY_LOCATION_SALES T339204,
    W_PROD_CAT_DH T150993 /* Dim_W_PROD_CAT_DH_General */
    where ( T66755.ROW_WID = T316025.DAY_WID and T316025.CUSTOMER_HIERARCHY_WID = T329697.ROW_WID and T67704.ROW_WID = T316025.PRODUCT_WID and T67704.PROD_CAT2_WID = T150993.ROW_WID and T329697.TERRITORY_CODE = nvl(T339204.LOCATION , T329697.TERRITORY_CODE) and T329697.AREA_DESC = 'GROCERY AREA - EAST' and T329697.DIVISION_DESC = 'DOMESTIC SALES DIVISION' and T339204.USER_NAME = upper('Administrator') and case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end = 'JETRO CASH AND CARRY ENTERPRISES INC(10313)' and (T66755.PER_NAME_ENT_YEAR in ('2011', '2012')) and (T329697.TERRITORY_DESC in ('BOSTON', 'CHARLOTTE', 'FLORIDA', 'GREAT LAKES', 'MID-SOUTH', 'NEW YORK', 'WHITE ROSE')) )
    group by T66755.PER_NAME_ENT_YEAR, T150993.X_CONS_MAJOR_GROUP, T329697.TERRITORY_DESC, T329697.AREA_DESC, T329697.DIVISION_DESC, case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end
    ) D1
    order by c1, c6
    If we observe test query is very simple and easy to back track but in Dev it is appending like sawwith0,sawwith1 etc..looking difficult.
    Is there in any configuration to change to generate query like Test(with out SAWWITH0).
    NOTE:Any how results are same in both instances.
    Please help me to resolve this issue.
    Thank You,
    Anil Kumar.

    Anil,
    Are your database settings the same in both of the rpds dev and test?
    Check wether you didn't change anything to the default. Open your RDP double click on the Database in the physical layer and go to Feature you can check all the settings there
    Adil

  • How can I use two single-dimensional arrays-one for the titles and array

    I want to Use two single-dimensional arrays-one for the titles and one for the ID
    Could everyone help me how can i write the code for it?
    Flower
    public class Video
    public static void main(String[] args) throws Exception
    int[][] ID =
    { {145,147,148},
    {146,149, 150} };
    String[][] Titles=
    { {"Barney","True Grit","The night before Christmas"},
    {"Lalla", "Jacke Chan", "Metal"} };
    int x, y;
    int r, c;
    System.out.println("List before Sort");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);
    System.out.println("\nAfter Sort:");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);

    This is one of the most bizarre questions I have seen here:
    public class Video
    public static void main(String[] args) throws Exception
    int[] ID = {145,147,148, 146,149, 150};
    String[] Titles= {"Barney","True Grit","The night before Christmas", "Lalla", "Jacke Chan", "Metal"};
    System.out.println("List before Sort");
    for(int i = 0; i < Titles.length; i++)
       System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles);
    System.out.println("\nAfter Sort:");
    for(int i = 0; c < Titles.length; i++)
    System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles[i]);
    Generally you don't use prefix (++c) operators in you for loop. Use postfix (c++).
    Prefix means that it will increment the variable before the loop body is executed. Postfix will cause it to increment after.

  • Is there a way to have two different iTunes for two different iPhones on one Windows User account?

    Using Windows 7, iphone 4.
    I've read as many threads on these forums and as many kb's as I could find, but I sttill can't figure it out. I have 2 iPhones. Let's call them, "wife" and "hubby". I want to have two separate iTunes, one for each of the phones. Hubby is the Windoows User. I don't want to set up a different Windows User for wife.
    Hubby was the original iPhone. When I plug it in, iTunes recognized it has Hubby's iPhone. Then I unplug Hubby and close iTunes. I plug in Wife but iTunes stll comes up with Hubby under Devices and syncs Hubby's iTunes to Wife's iphone.
    I've tried using the shift key when I open iTunes to set up two separate .itl files to no avail.
    Is there a way to have two different iTunes for two different iPhones on one Windows User account?
    Thanks!

    What happens if you rename the iPhone "Wife" when it shows up as "Hubby", then choose a different set of apps/playlists to sync with? iTunes is supposed to be able to manage multiple devices, each with their own selection of content. Perhaps you "restored" "Wife" with a backup from "Hubby" when you first set things up which is now causing confusion.
    To create a new library press and hold down the shift key as you click the icon to start iTunes and keep holding shift until asked to choose or create a library. You need to use the same technique to switch back.
    tt2

  • How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers? (history data from a chart)

    Hello,
    in my vi I have a chart with 5 Plots displaying measurement data.
    The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
    I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
    I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
    How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
    I use LabVIEW 7.1
    Johannes
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Gerd,
    thank you for the quick response and the easy solution.
    Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
    And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
    Johannes
    Message Edited by johanneshoer on 04-28-2009 10:39 AM
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    SaveChartHistory.JPG ‏57 KB
    SaveChartHistory.JPG ‏57 KB

  • Xslt: mapping different elements onto instances of an unbounded element

    How can you map different elements onto sequential elements of an unbounded type? For example:
    <record>
    <tag1>abc</tag1>
    <tag2>def</tag2>
    <tag3>ghi</tag3>
    </record>
    onto
    <properties>
    <property name="tag1" seq="1">abc</property>
    <property name="tag2" seq="2">def</property>
    <property name="tag3" seq="3">ghi</property>
    </properties>
    The mapping onto the first property will always be from tag1, etc. However, in the schema for <properties>, <property> only appears once:
    <xsd:element name="property" type="NormalizedString" minOccurs="0" maxOccurs="unbounded">
    Can this be mapped using JDeveloper? Can it be mapped by hand?
    If so, how?
    Thanks!

    Hello user,
    I think you will have to do this manually. It's been way too long since I was doing any serious XSLT hacking, and I don't have your schemas, but this may give you a starting point for your transformation;
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns0="http://www.w3.org/2001/XMLSchema"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.oracle.com/Transformation"
    exclude-result-prefixes="xsl ns0 ns1 xref xp20 bpws ora ehdr orcl ids hwf">
    <xsl:template match="/ns1:TransformationProcessRequest/ns1:record">
    <xsl:for-each select="*">
    <xsl:element name="ns1:property">
    <xsl:attribute name="name"><xsl:value-of select="name()"/></xsl:attribute>
    <xsl:attribute name="seq"><xsl:value-of select="position()"/></xsl:attribute>
    <xsl:value-of select="current()"/>
    </xsl:element>
    </xsl:for-each>
    </xsl:template>
    <xsl:template match="/ns1:TransformationProcessRequest">
    <ns1:properties>
    <xsl:apply-templates select="/ns1:TransformationProcessRequest/ns1:record"/>
    </ns1:properties>
    </xsl:template>
    <xsl:template match="/">
    <ns1:TransformationProcessResponse>
    <xsl:apply-templates select="/ns1:TransformationProcessRequest"/>
    </ns1:TransformationProcessResponse>
    </xsl:template>
    </xsl:stylesheet>
    Regarding validation to XSD, I guess that's just a matter of specifying the right namespaces and elements...?
    Regards,
    Rune

  • Adding two 2-D Arrays to then save

    I am trying to build two 2-D arrays to then save as a spreadsheet file. This process happens in while loop and I need to enable indexing when I feed the wire out. When I do this I use the build array fucntion but then it creates a 3-D array which I cannot save.

    Ok. I've made an example that processes the whole file(s). Run the process file.vi, input a file pattern and select a directory of test files. Now you can click the process files button and it will produce files containing the results you wanted.
    In the example I have not included the option of selecting just a segment of the files. The files are named after their origin file, the name is not put into the file itself...and finally I assume that the files always contain complete sets (you can initialize an array to hold the results instead of reusing the incoming array to avoid this dependancy...).
    As you will see generating the result is quite simple, it's all done in the calculate VI. If you want to average across fil
    es as well (not just data within one and the same file) it will need modifications though...If you want to be able to select a sub-section of the file the easiest way to do it is to do it prior to feeding the array to the calculate VI...the most effective though would be to modify the logic of the calculation VI slightly so that it can work on a selection directly.
    If you sometimes need to be able to calculate the average and deviation of more values than the pairs, that's possible as well, but would require a modification of the calculation vi...
    Mads
    MTO
    Attachments:
    Process_files.zip ‏196 KB

Maybe you are looking for