JAXB - nested elements of same name

Hi
I have a schema which can represent elements with identical nested names like this:
<Simple>
<Strong>
<Simple/>
</Strong>
</Strong>
The nesting is not recursive. i.e. the two 'Simple' elements are not actually identical. Unfortunately when I bind the schema to java using JAXB, the generated code won't compile and i get error due to name collision:
"Nested type SimpleType hides an enclosing type"
Can external binding fix this problem? I have already tried it but without success because there doesn't seem to be a way to bind the 'SimpleType' to another name. I can only change the interface name, but i need to change the type interface as well.
I am tearing my hair about it and only solution i can see is that i use XSLT to transfrom the names before reading the XMl files in and writing them out. I can not change the original schema unfortunately.
Any clues will be much appreciated, Martin.

Hi everybody
In the interest of anyone having similar problem, i have discovered that if i used a schema which used complex types explicitly (as generated by XmlSpy for me) the problem went away. This is probably because the nesting becomes irrelevant. My original schema contained only one element with all the types being anonymous and nested within that element.
Regards, Martin.

Similar Messages

  • Writing schema for multiple elements with same name with diff. content

    following is the XML file,
    <?xml version="1.0" encoding="utf-8"?>
    <e-abstract xmlns="http://www.citicorp.com"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="Deed.xsd">
    <deed>
    <deed_type>
    <deedtyp name="Quit Claim" value="Q" />
    <deedtyp name="sheriff's deed" value="Sheriff" />
    <deedtyp name="Warranty" value="W" />
    </deed_type>
    <deed>
    </e-abstract>
    --- end----
    in this I have 3 elements of deedtyp , how i can write them in .xsd file as these elements have same name?Please help, if u have idea about this...
    i have written .xsd up to deed_type,
    ----Deed.xsd----
    <? xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.citicorp/2001/XMLSchema"
    targetNamespace="http://www.citicorp.com"
    xmlns="http://www.citicorp.com"
    elementFormDefault="qualified">
    <xs:element name="deed_type" type="string" use="required"/>
    <xs:simpleType name="string">
    <xs:restriction base="xs:string">
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>

    I don't know the exact and complete specification of your intended schema...
    anyway, from what I can see in your post, I assume that
    <deed>
        <deed_type>
            <name>Quit Claim</name>
            <value>Sheriff</name>
        </deed_type>
        <deed_type>
            <name>sheriff's deed</name>
            <value>Sheriff</value>
        </deed_type>
        <deed_type>
            <name>Warranty</name>
            <value>W</name>
        </deed_type>
    </deed>would be the "proper" way to go...
    which makes your "deed_type" a complexType, including a sequence of two kinds of xs:string elements : "name" and "value"

  • Can i have xml elements with same name but one is having attrbt..?

    Hi all,
    I am suppose to take input from one system into BPEL.That system is auto gererating xml file. But that file is strange. It has two xml element with
    same name but with completely different sequence. First one is having two comlexTypes while second is having 5 simple types.
    Now the difference is First element is having attribute while second is not.
    So is that file is correct.?
    thanks a lot.
    /mishit

    can you post the file? or load the file into JDeveloper and check the syntax or use XMLSpy for validation of the XML.

  • JMS Queue XML: Elements with same name

    Hi
    I notice that ODI does not do a good job of reverse-engineering JMS queue models where an element name is referenced in different parts of the schema.
    For example:
    root
    ..body
    ...consignment
    ....load
    .....event
    ....unload
    .....event
    etc
    In the above, ODI will reverse-engineer the 'event' element under 'load', but not the one under 'unload'.
    I don't have control over the xsd models and was therefore wondering if there is some sort of workaround I can perform in this scenario?
    Cheers

    Actually, I just found the following Oracle note sums this up: 757642.1
    Is it possible to use the SAME ELEMENT as a SUB-ELEMENT in multiple DIFFERENT Elements of an XML File?
    If so, what is the impact of this approach on the reverse engineered Model and Datastores and how can Integration Interfaces be set up to map these identical ELEMENT for which the content is semantically different and as a result to be used differently in different Oracle Data Integrator (ODI) Integration Interfaces.
    The following XML is a simple example in which the ITEM Element is logically set as a sub-element to three other XML Elements:
    •Shoppinglist
    •GroceryStore
    •HardwareStore
    <Shoppinglist>
    <Item>ShoppingList</Item>
    <GroceryStore>
    <Item>Eggs</Item>
    <Item>Milk</Item>
    <Item>Bread</Item>
    </GroceryStore>
    <HardwareStore>
    <Item>Screwdriver</Item>
    <Item>Hammer</Item>
    <Item>Nails</Item>
    </HardwareStore>
    </Shoppinglist>Solution
    Such an approach must be avoided. This is a strict limitation of the ODI XML Driver.
    See Bug:8563428 DUPLICATE SUBELEMENTS WITH DIFFERETNT TYPES ARE NOT SUPPORTED BY XML DRIVER

  • Reading the next element with sam name

    Hi,
    i have xml file which looks like
    <Response>
    <params>
    <param>
    <value><array><data><value><string>ok</string></value>
    <value><string>41408241257406373</string></value>
    </data></array></value>
    </param>
    </params>
    </Response>
    I need the value of element string which i am reading now using
    <string>ok</string>
    using
    xmldom.getfirstchild
    But problem is how to read the next one as its tag name is also the same?
    <string>41408241257406373</string>
    thanks,
    7Z

    sorry if I was not clear.
    I call soap request and get a XML response
    <Response>
    <params>
    <param>
    <value><array><data><value>
    <string>ok</string>
    </value>
    <value>
    <string>41408241257406373</string>
    </value>
    </data></array></value>
    </param>
    </params>
    </Response>
    I have already funtion by using dom that read the first tag and work fine.
    But for this XML
    <string>ok</string>                                             ----string tag
    <string>41408241257406373</string>              -----string
    it is
    function gettvalue(p_node dbms_xmldom.domdocument, p_tag in varchar2)
       return varchar2
       is
          t_node       dbms_xmldom.domnode;
          t_child_node dbms_xmldom.domnode;
       begin
          t_node       := xmldom.item (xmldom.getelementsbytagname(p_node,  p_tag), 0);
          if xmldom.isnull(t_node)
          then
             return null;
          end if;
          t_child_node := xmldom.getfirstchild (t_node);
          if xmldom.isnull(t_child_node)
          then
             return null;
          else
             return xmldom.getnodevalue(t_child_node);
          end if;
       end;
    it is not reading the second element.
    thanks for help.
    odie_63

  • Accessing multiple xml elements with same name

    I am having trouble with an xsl stylesheet. This is what one of the rows of my output xml document looks like
            <Row>
                <Num>1</Num>
                <Valuation>Val</Valuation>
                <COMBCHARFLAG>Y</COMBCHARFLAG>
                <CCCOUNT>2</CCCOUNT>
                <CCDESC>CHARDESC1</CCDESC>
                <CCDESC>CHARDESC2</CCDESC>
            </Row>
    Does anyone know how I can access the 2nd CCDESC ("CHARDESC2") . When i run this in the workbench I can only ever access the first CCDESC, it acts like the 2nd isn't there. However I was also using a 3rd party xsl editor called "XMLSpy" to look for other possible solutions and when i render it with XMLSpy, everything is displaying correctly. Is this some sort of limitation of the workbench? Any help would be much appreciated. Thanks
    This is the template i am calling in my xsl.......
    <xsl:template name="for.loop">
    <xsl:param name="i" />
    <xsl:param name="count" />
    <!--begin_: Line_by_Line_Output -->
    <xsl:if test="$i &lt;= $count">
    <tr>
         <td align="center"><xsl:value-of select="CCDESC[position()=$i]"/>
         </td>
         <td align="center">
              <input style="width:110px;" class="Mfieldv-M" name="txtValuation"></input>
         </td>
    </tr>     
    </xsl:if>
    <!begin_: RepeatTheLoopUntilFinished>
    <xsl:if test="$i &lt;= $count">
    <xsl:call-template name="for.loop">
    <xsl:with-param name="i">
    <xsl:value-of select="$i + 1"/>
    </xsl:with-param>
    <xsl:with-param name="count">
    <xsl:value-of select="$count"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:if>
    I than call the template as follows from within my  <xsl:for-each select="Row"> statement
                                                                <xsl:call-template name="for.loop">
                                                                <xsl:with-param name="i">1</xsl:with-param>
                                                                <xsl:with-param name="count"><xsl:value-of select="CCCOUNT"/></xsl:with-param>
                                                                </xsl:call-template>

    Muzammil,
    Thanks for the response. I may have explained my situation a little poorly. I am not trying to access the 2nd CCDESC within the workbench via a repeater or such. It is after the XSL renders the page that I don't see the second CCDESC. When the XSL renders the page through Internet explorer i get something that looks like the following......
    Res # 1
    CHARDESC1 
    When I render it in the application XMLSpy it shows both CCDESC's like follows.
    Res # 1
    CHARDESC1 
    CHARDESC2
    In XMLSpy if i change the line of xsl code from      <td align="center"><xsl:value-of select="CCDESC[position()=$i]"/>  to       <td align="center"><xsl:value-of select="CCDESC[2]"/> the page is rendered in XMLSpy with both labels the same as follows.
    Res # 1
    CHARDESC2 
    CHARDESC2
    If i do that same change in the workbench and render the page through IE I get no label results....
    Res # 1
    Thanks

  • Append XML elements with same name in an XML document

    Hi,
    I am using Oracle9i XMLDB utilities to modify an XML document stored in the database. I have a sample XML document like this in the database:
    <Person>
    <Address ID="1"> </Address>
    </Person>
    My task is to include a second <Address> element with a different attribute so that my XML document will become
    <Person>
    <Address ID="1"> </Address>
    <Address ID="2"> </Address>
    </Person>
    After creating the second element, I am using the function xmldom.appendChild() or xmldom.insertBefore() but they remove the first <Address> element and replace it with the second one. This is not what I want since I want both <Address> elements to be present.
    Could anyone please advise.
    Thanks.
    A. Dennis

    Please post your question [url http://forums.oracle.com/forums/forum.jsp?forum=154]here for quick response.
    thank you.
    Regards,
    Anupama
    [url http://otn.oracle.com/sample_code/]OTN Sample Code

  • Concatenate elements with same name in sequence

    version 9.2
    I have a clob column containing xml - unregistered
    Some of the old xml has multiple <notes> elements and the new xml has one <notes> element. I have made a view that successfully extracts the xml from the column and it works great, but when I have multiple <notes> elements the view fails since I am using extractvalue(). I need to select the <notes> tags concatenated into one column in sequence when I have multiples. I am guessing the sequence should be as they appear in the xml document from top to bottom since there is no sequence attribute. I know how to use xmlsequence and xmltable to get the individual <notes> tags but they are not concatenated. Is there a magic xmlsequence/concatenation function that will do what I want here?
    -- old xml
    <Accident>
       <Case>
          <TRACS_Case_Number Value="7777777"/>
          <Notes>V-1 AND V-2 N/B TRANSIT RD (ST 78\) SLOWING TO MERGE INTO TRAFFIC.  V-3 N/B TRANSIT RD. </Notes>
          <Notes>STRIKES V-2 IN REAR AND PUSHES V-2 INTO V-1 STRIKING V-1 IN REAR WITH FRONT OF V-2 .  </Notes>
          <Notes>NO INJURIES.</Notes>
       </Case>
    </Accident>-- new xml
    <Accident>
       <Case>
          <TRACS_Case_Number Value="7777777"/>
          <Notes>V-1 AND V-2 N/B TRANSIT RD (ST 78) SLOWING TO MERGE INTO TRAFFIC.  V-3 N/B TRANSIT RD. STRIKES V-2 IN REAR AND PUSHES V-2 INTO V-1 STRIKING V-1 IN REAR WITH FRONT OF V-2 .  NO INJURIES.</Notes>
       </Case>
    </Accident>I am also trying to register this xml to improve performance. However, when I see things like this in the xml I wonder what will happen when I try to register this xml. The DTD, I have no XSD, currently only supports one <notes> tag. Do I have to clean up all the xml in column to match the current DTD before registering? I could also use a good, EASY, example of how to register a schema.
    Thanks...

    You can use the string aggregation technique to concatenate the Notes element.
    sql> WITH xmltable AS
      2    (SELECT xmltype('<Accident>
      3     <Case>
      4        <TRACS_Case_Number Value="7777777"/>
      5        <Notes>V-1 AND V-2 N/B TRANSIT RD (ST 78\) SLOWING TO MERGE INTO TRAFFIC.  V-3 N/B TRANSIT RD. </Notes>
      6        <Notes>STRIKES V-2 IN REAR AND PUSHES V-2 INTO V-1 STRIKING V-1 IN REAR WITH FRONT OF V-2 .  </Notes>
      7        <Notes>NO INJURIES.</Notes>
      8     </Case>
      9  </Accident>') xmlcol
    10     FROM dual)
    11  SELECT SUBSTR(replace(MAX(sys_connect_by_path(notes,   ':')),':',' '),   2) Notes
    12  FROM
    13    (SELECT extractvalue(t.column_value,    '/Notes/text()') notes,
    14       rownum rn
    15     FROM xmltable xt,
    16       TABLE(xmlsequence(EXTRACT(xmlcol,    'Accident/Case/Notes'))) t)
    17  CONNECT BY PRIOR rn = rn -1 START WITH rn = 1;
    NOTES
    V-1 AND V-2 N/B TRANSIT RD (ST 78\) SLOWING TO MERGE INTO TRAFFIC.  V-3 N/B TRANSIT RD.  STRIKES V-2 IN REAR AND PUSHES
    G V-1 IN REAR WITH FRONT OF V-2 .       NO INJURIES.

  • Oracle Forms - two forms have element with the same name. How to address?

    Hi all
    We test application in Oracle Forms 10G, often there are several forms opened simultaneously.
    And now question – what to do if two or more forms have element with the same Block Name and Name?
    For example:
    //forms:button[(@name=’TOOLBAR_EXIT_FORM_0’)]
    How to address these elements?

    to aamat:
    "The names are not the same"
    OpenScript gives them the same name, it consists of block name + element name + index. it doesn't take form name into consideration, so it gets
    //forms:button[(@name=’TOOLBAR_EXIT_FORM_0’)]

  • Question on multiple form elements with the same name !

    Hi All,
    I have a requirement in which more than one text field with the same name exists on a HTML page. We are using JSF framework (Oracle JDeveloper IDE and OC4J ) . I tried using a String array in my backing bean to handle these text boxes. When I hit the Submit, the action (method) is not invoked. But when I try with unique names everything works fine. Am I going wrong somewhere ?
    Thanks in Advance.

    You cannot have exactly the same name on objects.
    You will have to make an array of them to be able to
    o work with them properly--it will keep the names
    unique.I understand! But JSF creates its own names which are unique. The following JSF code
            <htm:tr>
                <htm:td>
                    <h:inputText value="#{Test.description}" id="description1"/>
                </htm:td>
            </htm:tr>
            <htm:tr>
                <htm:td>
                    <h:inputText value="#{Test.description}"  id="description2"/>
                </htm:td>
        </htm:tr>generates the following HTML code with unique names.
            <tr>
                <td>
                    <input id="Test:description1" type="text" name="Test:description1" />
                </td>
            </tr>
            <tr>
                <td>
                    <input id="Test:description2" type="text" name="Test:description2" />
                </td>
        </tr>
        <tr>Though I have a String Array in the backing bean, this doesn't work (The form does not submit to the method in the Backing Bean).
    Similar situation in Struts works absolutely fine.
    Any help would be appreciated !!!

  • Question about xml schemas and the use of unqualified nested elements

    Hello,
    I have the following schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://xml.netbeans.org/examples/targetNS"
        targetNamespace="http://xml.netbeans.org/examples/targetNS"
        elementFormDefault="unqualified">
        <xsd:element name="name" type="xsd:string"/>
        <xsd:element name="age" type="xsd:int"/>
        <xsd:element name="person">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="name"/>
                    <xsd:element ref="age"/>
                   <xsd:element name="height" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>I am just wondering why would someone have a nested element that is unqualified? here the "height" element.
    Can anyone explain this to me please?
    Thanks in advance,
    Julien.
    here is an instance xml document
    <?xml version="1.0" encoding="UTF-8"?>
    <person xmlns='http://xml.netbeans.org/examples/targetNS'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
      xsi:schemaLocation='http://xml.netbeans.org/examples/targetNS file:/E:/dev/java/XML/WebApplicationXML/web/newXMLSchemaThree.xsd'>
    <name>toto</name>
    <age>40</age>
    <height>180</height>
    </person>

    Don't worry about it.
    There are two different styles of schemas. In one style, you define the elements, attributes, etc. at the top, and then use the "ref" form to refer to them. (I call this the "global" style.) The other style is to define elements inline where they are used. ("local" style)
    Within some bounds, they work the same and which you use is a choice of you and the tools that generate the schemas.
    A warning about the local style. It is possible to define an element in two different locations in the schema that are different. It will get past all schema validation, but it seems wrong to my sense of esthetics. With the global style, this will not happen.
    So, how did this happen? Probably one person did the schema when it only had a name and age. Then, someone else added the height element. They either used a different tool, or preferred the other style. I'm aware of no difference in the document you have described between the two styles.
    Dave Patterson

  • JAXB: Unexpected element

    Hi there,
    I am using JAXB.
    I have generated java classes by use of xjc. Let's say I have configured to generate the files in the java package "some.package". I use the classes in the following code snipped:
    JAXBContext jc = JAXBContext.newInstance(
         "some.package.simpson.bart:"+
         "some.package.simpson.lisa");
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    Data data= (Data) unmarshaller.unmarshal(new File("c:\\test.xml"));When I try to unmarshall an xml document I get the following error/exception:
    DefaultValidationEventHandler: [ERROR]: Unexpected element {simpson:bart}:Data
    Location: line xx of file:/c:/test.xml
    javax.xml.bind.UnmarshalException: Unexpected element {simpson:bart}:Data
    Can you help me?
    Niko
    I have two related DTDs:
    <xs:schema targetNamespace="simpson:bart" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:bart" elementFormDefault="qualified">
        <xs:element name="DataType" type="xs:string"/>
    </xs:schema>
    <xs:schema targetNamespace="simpson:lisa" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:lisa" elementFormDefault="qualified">
         <xs:element name="Data" type="xs:string"/>
    </xs:schema>My test.xml looks like this:
    <Data xmlns="simpson:lisa">
         <DataType xmlns="simpson:bart">someValue</DataType>
    <Data>

    Your schema tells me that the content of elements named "Data" should be of type "xs:string" and thus your instance document is not valid while it contains a nested element named "DataType".
    In order to parse your instance document, you need a schema that defines a complex type for the Data element that allows a nested DataType element... something like this:
    <xs:schema targetNamespace="simpson:lisa" xmlns:bart="simpson:bart" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:lisa" elementFormDefault="qualified">
      <xs:import namespace="simpson:bart" schemaLocation="bart.xsd"/>
      <xs:element name="Data">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="bart:DataType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

  • How to apply different keyboard shortcuts to an actions with the same name but in different menus within one application?

    Hi,
    Hopefully someone can help. I have the application "djay" and in two different menus there is the action "Eject". I was wondering if it's possible to apply different keyboard shortcuts to those actions with the same name? I can't see how to do it as it seems you can only write the action but as there are two it doesn't seem to work for me.
    For example:
    djay>Table-1>Eject - ⌘⇧1
    djay>Table-2>Eject - ⌘⇧0
    Thanks in advance for any help!!

    A NodeList doesn't only contain 1 element. In your example it contains ALL <Data> elements inside the document.
    NodeList nodes = document.getElementsByTagName("Data");
    System.out.println(nodes.getLength() + " \"Data\"-elements found");
    for(int i=0; i<nodes.getLength(); i++) {
       Node node = nodes.item(i);
    }

  • Smartform: windows in different pages having the same name

    Hi all gurus,
    first of all, please forgive me if I'm missing something, I'm quite new on the Smartform argument.
    Shortly; I have to modify some smartforms made by someone else in order to meet customer's desiderata.
    These smartforms are all different but share a common "structure", which is:
    2 pages definition, P_FIRST and P_FOLLOW, which have actually the same internal "structure": they have a LOGO window, then a TITLE window, then a MAIN window, then a FOOTER, and so on.
    In order to do my task, I added a new window in both P_FIRST and P_FOLLOW, let's call it CERTIFICATION_LOGO.
    Moreover, I inserted a new graphic element under the LOGO window.
    Modifying the smartforms, I noticed I have two different kind of behaviour:
    1) in almost all these SF, I add a window called CERTIFICATION_LOGO in P_FIRST, then I have to add a windows to P_FOLLOW which cannot have the same name ( e.g. I called it CERTIFICATION_LOGO_FOLLOW);
    2) in just one SF, when I add a window P_FIRST, then the exactly same window is added to P_FOLLOW. When I modify CERTIFICATION_LOGO window in P_FIRST, also CERTIFICATION_LOGO in P_FOLLOW is updated.
    I can't find a reason why such different behaviour. Actually I'm testing my solution and found that the only smartform that does not work is the only one which I have described with 2). So my guess is that there's some setting anywhere which leads to that different behaviour and this could be a cause of a raised exception... but maybe it's just a case, also because I found in debug that in this standard call in the form PROCESS_TEXT_WINDOW:
    perform xsf_window_open using docentry-tdwindow
                                    docentry-tdwtype.
    where docentry-tdwindow = 'LOGO' and tdwtype = 'T', the system exit the process at the first execution of:
    check xsfop-xsf = c_true.
      check not xsf_obj is initial.
    What does xsfop-xsf should mean? In my case xsfop-xsf = false and xsf_obj is initial... then the SF is not generated.
    What am I missing gurus?
    Thanks in advance,
    Matteo
    Edited by: Matteo Montalto on Aug 26, 2011 4:49 PM

    When you have common windows (LOGO on page first and logo on page next, etc.) you actually have one window definition.  What you put in the window is therefore always displayed for all pages.  In your case, instead of creating your new window and copying it into the follow page, you have two different windows, which now must be separately maintained, as to content, placement, borders, shading, conditions, etc.

  • Responding to two user events with same name

    LV 2013, Win 7, & LVRT 2013, PharLap OS
    I have a situation where I create an ARRAY of User Events, one for each "domain" .  
    A "domain" is an area of DAQ: there is a SCXI domain, a CDAQ domain, an EtherCAT domain, several domains dealing with TCP instruments etc., about 25 domains all told. The name of the event is "New Channels This Domain".
    When a new configuration comes to the PXI from the host, I sort out the channels by their domain and generate a user event for whichever domains have channels that have changed: more channels, fewer channels, differences. If a domain has no channels that have changed, I do not generate an event for it.
    There is a handler for each domain: in that handler, I pick out the event for this domain from the array, and register to receive it.  I have an event structure that responds to the NEW CHANNELS THIS DOMAIN event.  Since it is an array, then no matter which domain I select, the name of the array is "New Channels This Domain".
    All this works fine.
    Now I have a situation where it makes sense to have one handler for TWO domains.
    I can pick out TWO elements of the array just fine, and register them both.   (See attached pic)  But now, in the EDIT EVENTS FOR THIS CASE list, I have TWO events called "New Channels This Domain".  I can select one for one case, and the other for the other case and it seems to work.
    --- Is there any heartache ahead with this scheme?  
    --- If I change the events in the clusters before, is it going to confuse LabVIEW?  
    --- Is there something I can do to change the name of the event after I pick it out of the array?  
    --- Is there something I SHOULD do at that point?
    Like I said, it seems to work, but I'm leery of it staying that way - I've had event structures disturbed before (LV2010) when changing cluster order.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

    CoastalMaineBird wrote:
    Thanks, Greg for that link.  I gave kudos to the idea of the COERCE TO TYPE function, and it seems like it would do the trick, but as of LV2014 it's still not on the palette.
    My question still remains: is it necessary?  Will the event structure remember that it's supposed to use the SECOND event named "X", through all edits and recompiles?  My guess is no, but I'll listen to alternative stories.
    I've been using the Coerce to type for this and enums in versions 2011 through 2014 since learning about it.  I've seen no issue using it in these cases.  I'm guessing it doesn't behave in an expected way for extreame uses which is why NI doesn't release it yet.
    As for would it always know to go to the second event if they are named the same?  My guess is yes.  They maybe named the same but they have different references.  I would think it would be just like having two controls with the same label.  You should never do this, but if you did, and made a local variables on one and wrote to it, it would always write to the correct control.  It would never write to the different control with the same name.  Now even if this is the case it could be confusing to a developer looking at the code, which is why I strongly suggest having unique names.  But if you don't I suspect every thing would work fine, just have a bold comment or something explaining what each case actually is handling.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Maybe you are looking for