Get the name of a particular tag in XML

Hi,
Is there a way in OSB such that I can get the name of a particular XML tag for example if I want to assign the name of tag transactionType from the below mentioned XML to a variable, can i do it using some XQuery function??
<?xml version="1.0" encoding="UTF-8"?>
<tns:sandstonetns xmlns:tns="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sandstone.response.transactionHistory.app.nab.cz.fc.ofss.com Sandstone_Data_Transaction_History_Response.xsd ">
<tns:listOfTransactions>
<tns:transactions>
<tns:clients>
<tns:clientID>tns:clientID</tns:clientID>
</tns:clients>
<tns:timestamp>2001-12-31T12:00:00</tns:timestamp>
<tns:sequenceNumber>tns:sequenceNumber</tns:sequenceNumber>
<tns:description>tns:description</tns:description>
<tns:amount>0</tns:amount>
<tns:accountNumber>tns:accountNumber</tns:accountNumber>
<tns:debitOrCreditFlag>tns:debitOrCreditFlag</tns:debitOrCreditFlag>
*<tns:transactionType>Any</tns:transactionType>*
</tns:transactions>
</tns:listOfTransactions>
<tns:returnResponse>
<tns:returnCode>0</tns:returnCode>
<tns:returnDescription>tns:returnDescription</tns:returnDescription>
</tns:returnResponse>
</tns:sandstonetns>
Edited by: rahulc on Jan 19, 2011 4:43 AM

You may use fn:local-name() -
http://www.xqueryfunctions.com/xq/fn_local-name.html
Regards,
Anuj

Similar Messages

  • How to get the name of tag or variable

    Hi everyone,
    I am a newbie, I have problem on getting the name or tag of the variable from OLE for Processing Control(OPC) server, could anyone tell me how I can get the name of tag or variable from writting vb codes or please direct me to any helpful information. Here are
    my codes,
    Dim ItemsDef(NBR_ITEMS) As String
    Dim DeviceAddress As String
    Dim IndItem As Long
    DeviceAddress = "MBT:152.160.178.60"
    'Preparing the Handles for "AddItems"
    For IndItem = 1 To NBR_ITEMS
    ItemsDef(IndItem) = DeviceAddress & "!40000" & Format(IndItem) '40000 is the memory location of variable in the OPC, how can I get the variable name, what is the code or syntax?
    Next
    blah...
    Thank you,
    Calvin

    Hi Calvin,
    If you are looking for general information and examples about OPC, then we have lots of places for you to browse!
    Here is a small list, and you can probably find other links within these documents:
    **If you have Measurement Studio from National Instruments, then you can look at the "Measurement Studio Reference" help file. Search for OPC and in the overview you will find the methods for accessing the items on an OPC server.
    **Elsewhere in the help file, you can find a link to this Application Note on our developer zone
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?​openagent&F4921B34CA8F4A9786256874005BE3F7&cat=7CD​A3E51FEFC4AA2862568B80071A1E2
    **One more resource is http://www.ni.com/opc
    **Probably the most useful will be the examples yo
    u can find on our web site. You can go to http://www.ni.com/support and in Option 3 search the Example Code database for "opc".
    In the first example program (Controlling OPC Servers with the OPC Automation API in Visual Basic) that you should get when searching for "opc" in the example programs database, look for the line with this code: "browser.GetItemID(leaf)". There you can see the way the program creates an OPCBrowser from the server instance, and then gets the servers available items for use by the client. This sounds like the specific information you are looking for with the variable name.
    If you aren't able to find out your answer here or in the various help resources, then please feel free to contact us at National Instruments at http://www.ni.com/ask
    Regards,
    John N
    Applications Engineer
    National Instruments

  • Getting the 'name' of an XML tag

    I am trying to get the 'name' value out of an XML tag. Here is the XML that I am parsing:
    <param name="param_name">param_value</param>
    I can get the values 'param' and 'param_value' using the node.getNodeName() and the node.getNodeValue() methods.
    I need the value of "param_name" though because in the situation that I am in, this is how the node values are determined.
    Any thoughts? Thanks in advance!

    Hello,
    "name" is called an attribute of the "param" element. You could try to take a look at the getAttributes() function (node.getAttributes().item(0)).
    I hope it helps.

  • How to get the name of a duplicated control or created control and add a callback to it

    Hi All,
    Depending on how many input points I need, I am duplicating a numeric or string input with the DuplicateCtrl function. My question is, how do I get the name and id of the control that was just created, and how can i assign a callback to it? Alternately, would it be better to create a fresh ctrl instead of duplicating?
    Thanks in advance!
    Solved!
    Go to Solution.

    Hi TurboMetrologist,
    why are you trying to get the control constant name? Keep in mind that you cannot use that name to address the control; control names are actually simply macros in the include file associated to the UIR, that is, the compiler preprocesses the code and wherever it finds PANEL_CONTROL names substitutes the corresponding numeric value as parameters to the functions (and consequently 'control' parameter is an int and not a char*)
    That is why NewCtrl () or DuplicateCtrl () functions return a control ID: it is the handle to the new object, our only way to manipulate it. You will need to store this handle into a non-volatile memory so that you can access it durng program life.
    Additionally, there are other ways to assign some particular meaning to a control than swiching on the control constant name. You could for example use the callbackData parameter to differentiate between different copies of a control.
    Let me explain with an example. You told that you need several inputs (dynamically created as you don't know in advance how many of them to use); a clean solution could be to:
    Design a master copy of one control in the UIR editor, where it is easy to customize it; assign also a callback function, if it has to be common to all copies of the control
    Programmatically assign a callbackData value to that control, e.g. SetCtrlAttribute (..., ..., ATTR_CALLBACK_DATA, (void *)1);
    Duplicate the control and then assign a different callbackData
    for (i = 2; i < 5; i++) {
       handle = DuplicateCtrl (...);
       SetCtrlAttribute (..., handle, ATTR_CALLBACK_DATA, (void *)i);
    By operating this way, every time the control callback is fired by any control it will receive the assigned callbackData, and you will be able to differentiate your code by a simple switch:
    switch ((int)callbackData) {
       case 1:    // The master control
          break;
       case 2:    // The first duplicated control
          break;
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to get the name of a previous test?

    Hi,
    The top level of my sequence is a list of subsequences, each one being a  sub-test.
    While inside one particular sub-test I would like to know the name of the sub-test which was executed before the one I'm in at the moment.   Obviously this is relevant only when I run selected sub-tests.
    example:
            MyTest.seq
                 sub-test1
                 sub-test2
                 sub-test3
    I'm inside sub-test3 (in the setup or main sequence), and would like to know the name of the sub-test which was executed before sub-test3.  It is possible that no sub-test ran before sub-test3.
    Thanks
    RK
    Solved!
    Go to Solution.

    Hi Rafi,
    Just in case you are using an earlier version of TestStand than 4.0, you might consider using the NameOf() function since you wouldn't be able to directly access the TestStand API through expressions.  Here are a couple articles to look into.
    Getting the Name of Any TestStand Property Programmatically in TestStand
    Storing Step Names of a Sequence in a Local Variable
    Let me know whether the suggestions above point you to a solution. 
    Rod T.

  • Getting column names for a particular Table from Connection object.

    Hi,
    Can any one suggests me a way to get column names from a particular table of a database from the java.sql.Connection object. ?
    Thanks in advance.

    Connection connection;
    DatabaseMetaData metadata = connection.getMetaData();
      String[] names = {"TABLE"};
      ResultSet tables = metadata.getTables(null,"%", "%", names);
      while (tables.next()) {
      String tableName = tables.getString("TABLE_NAME");
       ResultSet columns = metadata.getColumns(null, "%", tableName, "%");
    while (columns.next()) {
      String columnName = columns.getString("COLUMN_NAME");
        }

  • Getting the name of a menu from the menu item

    Hi everybody,
    I'm trying to get the name of the menu that a particular menu item is classified under, and thus far I can't figure out how. Can anyone give me a hand with this, please? I have a SSCCE that describes my efforts so far:
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    public class MenuTester {
         public MenuTester() {
              JMenuItem item = new JMenuItem( "zzz" );
              item.addActionListener( new ActionListener() {
                   public void actionPerformed( ActionEvent e ) {
                        System.out.println( ((JPopupMenu)((JMenuItem)e.getSource()).getParent()).getLabel() );
                        System.out.println( ((JPopupMenu)((JMenuItem)e.getSource()).getParent()).getName() );
              JMenu menu = new JMenu( "test" );
                    menu.setName( "test" );
              menu.add( item );
              JMenuBar bar = new JMenuBar();
              bar.add( menu );
              JFrame frame = new JFrame();
              frame.setJMenuBar( bar );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.setSize( 300, 300 );
              frame.setVisible( true );
         public static void main( String args[] ) { new MenuTester(); }
    }I've tried the JPopupMenu method getLabel, and the generic Component method getName, but neither of them seem to work, even when I explicitly set the name. The result of both calls is "null", not "test" as it should be. There must be something small that I'm missing, but I'm not sure what, can anyone please tell me what it is?
    Thanks,
    Jezzica85

    JMenuItem mi = (JMenuItem)e.getSource();
    JPopupMenu popup = (JPopupMenu)mi.getParent();
    JMenu menu = (JMenu)popup.getInvoker();
    System.out.println( menu.getText() );

  • Getting the name of selected Node in Adobe 3D PDF

    Hello,
    I'm trying to use the following code to get the name of the selected node for a 3D object in my PDF.
    var c3d = this.getAnnots3D(this.pageNum)[0].context3D;
    c3d.activated = true;
    var select = c3d.scene.selectedNode.name;
    I get the error
    TypeError: c3d.scene.selectedNode is undefined
    19:Console:Exec
    undefined
    I have placed my code at the folder level.
    Can someone help please?

    The XPath expression for attribute is tag-name/@attribute-name

  • Cisco Unity 7: Voice mail cann't get the name or Number phone of the caller

    Hi,
    I have installed Cisco Unity Messaging Unified version 7 and integrated with Exchange 2010.
    I have two scenario, and I want to know if are normal or not:
    1.       If the 2 IP phones are subscribed with Cisco Unity: the first IP phone call the other IP phone and let a voice mail. When the second IP phone check his message vocal it can get the name of the caller or his number phone (the message is: You have One message from XXXX) and he get e-mail as objet: Voice Mail from XXXX.
    2.       If one IP phone is not subscriber with cisco unity call other Ip phone subscribed with cisco unity and let him a voice mail. The second IP phone when check his message vocal it can’t get the name of the caller or his number phone: The message is: You have one voice mail xxxx; without indicate from!! and he get a e-mail as object: Voice mail from Unknown.
    Please, I want to know if the second scenario is normal ? if not, who to resolve this problem? I want that he indicate the number of caller same he isn't subscriber with cisco unity?
    Thanks a lot,
    Best regards,
    Omar YUNSI

    So for the 2nd scenerio you would want to check what your Message Subjects were set to.  For Unity 7 open Web SA, click Configuration and then Message Subjects.  Make sure that the Outside Caller Message has %CALLERID% in it somewhere.  The value %CALLERNAME% will return unknown if we do not receive a name from the PSTN.
    Try setting the Outside Caller Message to:
    %U% %P% Voice Message from %CALLERID%
    and that should get you your desired results.
    The default Message subject is:
    %U% %P% Voice Message from %CALLERNAME% (%CALLERID%).  So with that it would say Voice Message fom Unknown (xxxx) if it was not able to determine the name of the user which is usually normal from a PSTN call.
    Just to note, the From address is always going to say from Unity Messaging System, it will only be the subject that has the extension in it.
    Bryan

  • Logic to build report to get the stock on a particular date

    Dear Guru's,
    We are trying to build a report for getting the stock on a particular date. It is not possible to copy MB5B that option is ruled out. We have also tried to get the data from MBEWH but that is also  not helping as the table is not updated for all the periods.
    Please advice
    Thanks,
    Sam

    Dear Sameer,
    You can copy MB5B report and can modify as per your reuirement.
    If you want get stock a paticular date.It is hard to get, why because you have to fetch all the Material documents
    and you have to use MBEW table to get the current date stock and you have to do add/subtract from calculated stock.
    Due to this there will performance issues also.
    So try to copy MB5B and change as per your requirement.
    regards
    Subhash

  • How to get the name and value of an attribute on a node/element that is not a child

    Hello,
    Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
    My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
    another doc with the same layout, but different content.
    I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'.  I can only seem to get the node names, but not the attributes on the node.  I need the name, because it can be different from doc to doc, so
    I can't hardcode this.
    Can someone please help with how to retrieve an attribute name/value on a node that is not a child.  Here's an example of what
    my xml looks like:
    DECLARE
    @myDoc1 xml
    ,@mydoc2 xml
    DECLARE
    @ProdID int
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>2 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "wheel">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first.  If they are, then i want to show the difference in the child elements. 
    This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
    I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
    ,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
    ...etc...
    but that only gives me the node names, and the child elements.  It does not give me back the attribute names and values from the node itself.
    Thanks in advance for your help.
    cee

    Are you looking for something like this:
    DECLARE @myDoc1 xml
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <Features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>'
    SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
           T.c.value('.', 'nvarchar(50)')  AS value
    FROM   @myDoc1.nodes('ProductDescription/@*') AS T(c)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I name each photo buy replacing the jpeg number with the name. when I burn to disk and open disk the name is not shown. how do I get the name given to show on the burn disk?.

    after I burn the files to dvd and load to view the name does not appear. How do I get the name listed to appear on the burn disk instead of the file number?

    Naming the Photo - or giving it a title - is not the same as naming  file.
    How are you burning to dvd? With iPhoto? If so then the Title will be available in any app that understands basic metadata.
    If you want the title available in the Finder - which does not understand photo metadata  - then you'll need to export the file
    File -> Export
    In the resulting dialogue you'll see a heading for 'File Name'. Choose 'Use Title' from the drop down.
    Regards
    TD

  • Need of a Webservice to get the name of the file in a Folder

    Hi All,
    I am in need of a Web service which should get the name of the file in a folder.
    Note :  Folder is created in the MOSS server.
    Thanks.

    Just to add, Mac in intergrated into AD and all I need is help in creating the script
    Thanks

  • How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in myD

    How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in my Dell Precision Workstation 670?
    I have recorded 10 tracks of voice with music using Adobe Audition 3 and Sony CD-RW CRX217E with no problem.
    The problem is, however, that the names I type in Audition 3 for each of the tracks and artist do not copy to the CD I have recorded. This means that when I play the tracks on any playback equipment that shows the names of the tracks and artists, etc. all that appears on the screen is the track number, such as Track 1, Track 2, etc.
    I am using a Dell Precision Workstation 670
    Inter®Xeon
    CPU3.2GHz
    3.19GHz,2.00GB RAM
    SYSTEM
    Professional x64 Edition
    V2003
    SP 2, v.4354
    Thank you
    NoPro

    Well, there is one possibility, but I can't absolutely confirm this. I had a look at the specification for the drive on the Dell website:
    http://support.dell.com/support/edocs/storage/P89087/en/index.htm
    and nowhere does it say that the drive supports CD-Text, I'm afraid. Even though all drives can in theory write this, a lot have the header hard-coded, and simply can't. Yours may be one of them, but I think you'll have to ask Dell to confirm this.

  • How to get the name of the current tab.

    Hi Experts,
    I have two tabs in my tab strip and a button common to both the tabs.Can you please let me know how to get the name of the current tab in the event method of the push button.
    Thanks in advance.
    Regards,
    Arun

    1.Declare an Action for OnSelect event of Tabstrip. This event is triggered whenever any change in tab occurs.
    2. Declare an Import Parameter in this method
       Tab type String.
    3. This parameter has value of the selected TAB.
    4. You can set this value in some Attribute in Attribute Tab in this event only (OnSelect):
         wd_this->Att  = Tab.
    Att is the attribute created by you in Attributes Tab of View. ( of type String)
    5. Now the selected Tab ID is stored in this Attribute Att.
    6. In the Onaction of Button , retrieve the selected tab value from this attribute using :
               Data : lv type string.
                lv =  wd_this->Att
    Now lv has your selected TAB ID.
    I hope it would help you.
    Edited by: Saurav Mago on Oct 13, 2009 2:22 PM

Maybe you are looking for

  • Open link in new window Webapps

    Hi All, I wonder if you can help. I have created a directory site, with web apps. When you get to the listings page it has a link to there website but the links do not open in the same window.] A link to a page is here so you can see what I mean Air

  • Help! datafile deleted on oracle 9i under redhat linux

    Please help me, i delete a datafile from a test tablespace and i don't know how to fix it on 9i, in 8i is very documented but 9i is a real pain, here is the error when 'dbstart'ing the db: Copyright (c) 1982, 2002, Oracle Corporation. All rights rese

  • HT2729 My 7th generation iPod nano won't allow me to sync videos from iTunes. How can I fix this?

    My 7th generation iPod nano won't allow me to sync videos from iTunes. How can I fix this?

  • Adobe Media Player, discontinued?!

    When I enter the players homepage at http://www.adobe.com/products/mediaplayer/ I see the following statement: "Effective September 16, 2010, Adobe® Media Player software will no  longer be available for download from the Adobe TV website.  In  addit

  • JSP Rendering issue

    I am displaying around 20000 records in my jsp view.I fetch the value from DB and use ArrayList of model objects and send that ArrayList to the view where I iterate over the ArrayList and display the table values. I am facing some performance issues.