How to copy a set of nodes stored in a variable in xslt 2.0

I am trying to do something like this:
XSL
<xsl:variable name="setOfNodes" select="foo[@attr = 'bar']" />
<result>
<xsl:copy-of select="$setOfNodes/*" />
</result>XML
<test>
<foo attr="bar" />
<foo attr="bar" />
<foo attr="different" />
<foo attr="bar" />
</test>I want the result to look like this:
<result>
<foo attr="bar" />
<foo attr="bar" />
<foo attr="bar" />
</result>But when I run the above xsl I get:
<result />This seems like it should be pretty simple, I am probably just mixing something up. Does anyone have any ideas or suggestions for how to do this type of thing?

Whether it is XSLT 1.0 or 2.0 does not really matter for your question. As you bind a value to your variable 'setOfNodes' with the XPath expression in the 'select' attribute selecting some 'foo' element nodes the value of that variable is a node-set (in XSLT 1.0) or a sequence (in XSLT 2.0) of those 'foo' element nodes. And if you want to copy those nodes to the result tree then you simply do <xsl:copy-of select="$setOfNodes"/>. Your attempt with select="$setOfNodes/*" would copy the child elements of those 'foo' elements to the result tree, only all those 'foo' elements are empty, they don't have any child nodes at all, thus nothing is copied to the result tree with your xsl:copy-of attempt.

Similar Messages

  • How to copy FDM setting (import format, dimension mapping, control table)

    Dear All,
    How to copy FDM setting (import format, dimension mapping, control table) from application to another application.
    I found that only dimension mapping can be imported. Is there any way to copy FDM application quickly?
    Thanks your help

    If you get a chance try the following script, it's so simple and easy to extract all the map data to XML and will help in to import back through Import script.
    Sub MapExtractor()
    'UpStream WebLink Custom Script:
    'Created By:      SatyaK
    'Date Created:      12/08/09
    'Purpose: This Script will produce a Account Map File for
    '                         the current location.
    'Execute the export
    strFilePath = API.IntBlockMgr.InterfaceMgr.fExportMapToXML("File Path", PPOVPeriod)
    End Sub
    -------------

  • How to copy a set of tables from a database to another periodically?

    We have a 4 node RAC primary database(10.2.0.2) with a physical standby(10.2.0.2) on our production site. Offlate we noticed that one of the applications(APP2) is causing heavy loads due large data downloads on the primary database servers. Our primary database has 2 schemas,
    1) one being the main schema with all objects, (USER1)
    2) and the other has views that query some set of tables from the main schema. (USER2)
    The application APP2 uses USER2 views to query and download huge data periodically. We need to be able to give accurate data results to APP2, but in the same time take off the load from the database, as APP2 is not our main application.
    We would like to know if there are any cost effective options in oracle to do this, and if so, what is the best option? Anyone has any experience setting up something like this before?
    We have thought of creating another 10.2.0.2 database on a different server and giving it regular updates(like data feeds) from the current database. The current database data changes quiet often, so the data feeds would have to be done often to keep the data current on the new database. So, we are not exactly sure how to go about it. Would a COPY command help?
    Please advice.

    user623066 wrote:
    Our 4 node RAC is already busy with our main application, which has its connections spread across all 4 nodes.
    Our main applications services are the same on all nodes and use all 4 nodes in the same way.
    There are some other utilities that we run from one of the app servers that connect to only 1 of the nodes.
    APP2 uses all 4 servers, which is again controlled by connection pooling and distributes the load.Wouldn't separate services be more beneficial here? If APP2 is locked down to one node during normal operation, that ensures that other connections aren't going to be competing for hardware with APP2 on 3 of the 4 nodes. If APP2 is generating less than 25% of the total load, you can let the other applications use whatever hardware resources are left idle on the node APP2 is locked down to.
    By Large data downloads, I meant both increase in network traffic and the CPU load on the database nodes.
    We are already using resouce manager to limit the resources allocated to USER2 that APP2 uses.
    And we have also limited the large downloads to take place in the early hours of the day when the traffic from our main application is less.
    But this has still not been optimal for the usage requirements for APP2. APP2 is also doing queries all through the day, but has a limit for the number of rows downloaded during peak hours.Can you explain a bit more about why using Resource Manager hasn't been sufficient? That's normally a pretty good way to prevent one hungry user from drastically affecting everyone else. Perhaps you just need to tweak the configuration here.
    Logical Standby seems a good option. But we need to keep our physical standby in place. Is it possible to have a logical standby and a physical standby? (ofcourse on separate servers)Sure. You can have as many standby servers of whatever type you'd like.
    Could we use a COPY command to copy data for the set of tables to a new database? Or is that also a complex option?You could, yes. COPY is a SQL*Plus command that has been depricated for copying data between Oracle databases for quite a while. It only works from SQL*Plus and would only be designed for one-time operations (i.e. there is no incremental COPY command). I can just about guarantee that's not what you want here.
    How do materialized views work? Wouldn't they still reside on the main database? Or is it possible to have remote materialized views?You probably don't want materialized views, but if you decide to go down that path
    - You'd create materialized view logs on the base tables to track changes
    - You'd create materialized views on the destination database that select data over a database link back to the source database
    - You'd put those materialized views into one or more refresh groups that are scheduled to refresh periodically
    - During a refresh, assuming incremental refreshes, the materialized view logs would be read and applied to the materialized views on the destination system to update the materialized views.
    Justin

  • How to copy data from one node to another or fromone table to another table

    Hi,
    I have a two tables.I am populating data in first table and on the click of first table ,selected row data should be copied to the second table.
    How do i achieve this requirement and what should be the cardinality of the second table
    Thanks
    Bala Duvvuri

    Hi,
    For this u have to fetch the selected row.
    For fetching the selected row go to the events of first table and select "OnLeadselect".
    Create a new method for this.
    Now in this method read the value of the selected row with method get_static_attributes.
    with this u will have the selected row in the element.
    not just bind this elemnt with the second table.
    Second node will also have the cardinality 0:n, because this is also binded with the table.
    Coding part for this is as below:
    method ONACTIONSELECT .
        DATA lo_nd_cn_mara TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_mara TYPE REF TO if_wd_context_element.
        DATA ls_cn_mara TYPE wd_this->element_cn_mara.
        DATA ls_cn_mara1 TYPE wd_this->elements_cn_mara.
      navigate from <CONTEXT> to <CN_MARA> via lead selection
        lo_nd_cn_mara = wd_context->get_child_node( name = wd_this->wdctx_cn_mara ).
      @TODO handle not set lead selection
        IF lo_nd_cn_mara IS INITIAL.
        ENDIF.
      get element via lead selection
        lo_el_cn_mara = lo_nd_cn_mara->get_element(  ).
      @TODO handle not set lead selection
        IF lo_el_cn_mara IS INITIAL.
        ENDIF.
      alternative access  via index
      lo_el_cn_mara = lo_nd_cn_mara->get_element( index = 1 ).
      @TODO handle non existant child
      IF lo_el_cn_mara IS INITIAL.
      ENDIF.
      get all declared attributes
        lo_el_cn_mara->get_static_attributes(
          IMPORTING
            static_attributes = ls_cn_mara ).       " here u are getting the selected row of the table.
    APPEND ls_cn_mara to ls_cn_mara1.      " append the row in the table so that can be binded with the second node
      DATA lo_nd_cn_maraout TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_maraout TYPE REF TO if_wd_context_element.
      DATA ls_cn_maraout TYPE wd_this->element_cn_maraout.
    navigate from <CONTEXT> to <CN_MARAOUT> via lead selection
      lo_nd_cn_maraout = wd_context->get_child_node( name = wd_this->wdctx_cn_maraout ).
    Bind the table with the second node
    lo_nd_cn_maraout->bind_table( ls_cn_mara1 ).
    endmethod.
    ->cn_mara  is the first node.
    ->cn_mara1  is the second node
    Thanks,
    Pankaj Aggarwal
    Edited by: Pankaj Aggarwal on Nov 19, 2008 7:40 AM

  • How to copy and paste the node?

    please help~~~
    不知道这里有没有搞这个的中国人啊~~~说英文实在是件很麻烦的事。。。。。。。
    Edited by: user12393902 on 2009/12/28 23:32

    --節点のレベルを判別する、ラベル<>1の場合、子節点の下で新たな節点を追加する
         IF ( PKG_変数.NODE_DEPTH_STR != 1 ) THEN
         GO_BLOCK('EMP');
         FIRST_RECORD;
         FOR CNT_NODE IN 1..CNT_EMP-1 LOOP
              IF ( :EMP.CHK = '1' ) THEN
                   LV_NODE_LABEL := :EMP.ENAME;
                   LV_NODE_VALUE := :EMP.EMPNO;
    --SET_ALERT_PROPERTY('ALT',ALERT_MESSAGE_TEXT,'PKG_変数.NODE_LABEL_STR:'||PKG_変数.NODE_LABEL_STR);
    --RET := SHOW_ALERT('ALT');
         CHILD_NODE := FTREE.ADD_TREE_NODE( HTREE,
         PKG_変数.TRIGGER_NODE_STR,
         FTREE.PARENT_OFFSET,
         FTREE.LAST_CHILD,
         FTREE.EXPANDED_NODE,
         LV_NODE_LABEL,
         NULL,
         LV_NODE_VALUE );
              END IF;
              NEXT_RECORD;
         END LOOP;
         IF ( :EMP.CHK = 1 ) THEN
              LV_NODE_LABEL := :EMP.ENAME;
              LV_NODE_VALUE := :EMP.EMPNO;
         CHILD_NODE := FTREE.ADD_TREE_NODE( HTREE,
         PKG_変数.TRIGGER_NODE_STR,
         FTREE.PARENT_OFFSET,
         FTREE.LAST_CHILD,
         FTREE.EXPANDED_NODE,
         LV_NODE_LABEL,
         NULL,
         LV_NODE_VALUE );
         END IF;
         --節点のレベルを判別する、ラベル=1の場合、新たな根節点を追加する     
         ELSE
         GO_BLOCK( 'DEPT' );
         GO_RECORD( :SYSTEM.CURSOR_RECORD );
         NODE_LABEL := :DEPT.DEPT_NAME;
         NODE_VALUE := :DEPT.DEPT_NO;
         HTREE := FIND_ITEM( 'BLCK_TREE.TREE' );
         NEW_NODE := FTREE.ADD_TREE_NODE( HTREE,
         FTREE.ROOT_NODE,
         FTREE.PARENT_OFFSET,
         FTREE.LAST_CHILD,
    FTREE.EXPANDED_NODE,
    NODE_LABEL,
    NULL,
    NODE_VALUE );
         GO_BLOCK('EMP');
         FIRST_RECORD;
         FOR CNT_NODE IN 1..CNT_EMP-1 LOOP
              IF ( :EMP.CHK = '1' ) THEN
                   LV_NODE_LABEL := :EMP.ENAME;
                   LV_NODE_VALUE := :EMP.EMPNO;
         FIND_NODE := FTREE.FIND_TREE_NODE( HTREE,
         NODE_VALUE,
         FTREE.FIND_NEXT,
         FTREE.NODE_VALUE,
         FTREE.ROOT_NODE,
         FTREE.ROOT_NODE );
         CHILD_NODE := FTREE.ADD_TREE_NODE( HTREE,
         FIND_NODE,
         FTREE.PARENT_OFFSET,
         FTREE.LAST_CHILD,
         FTREE.EXPANDED_NODE,
         LV_NODE_LABEL,
         NULL,
         LV_NODE_VALUE );
    --SET_ALERT_PROPERTY('ALT',ALERT_MESSAGE_TEXT,'LV_NODE_VALUE:'||LV_NODE_VALUE);
    --RET := SHOW_ALERT('ALT');
              END IF;
              NEXT_RECORD;
         END LOOP;
         IF ( :EMP.CHK = 1 ) THEN
              LV_NODE_LABEL := :EMP.ENAME;
              LV_NODE_VALUE := :EMP.EMPNO;
         FIND_NODE := FTREE.FIND_TREE_NODE( HTREE,
         NODE_VALUE,
         FTREE.FIND_NEXT,
         FTREE.NODE_VALUE,
         FTREE.ROOT_NODE,
         FTREE.ROOT_NODE );
         CHILD_NODE := FTREE.Add_Tree_Node( HTREE,
         FIND_NODE,
         FTREE.PARENT_OFFSET,
         FTREE.LAST_CHILD,
         FTREE.EXPANDED_NODE,
         LV_NODE_LABEL,
         NULL,
         LV_NODE_VALUE );
         END IF;
    END IF;

  • How to display backslashes from a command stored in a variable

    I have a file list of Unix comands with backslashes and other special characters. I am reading it into a loop and running the commands. At present I have :
    cat Udata
    LineNum=1
    while read line
    do
         echo
         echo
         echo "**********************************"
         echo "Process $LineNum"
         echo "Code is     >>  $line"
         echo "Results are: "
         echo
         eval "$line"
         (( LineNum++ ))
    done < hmregraw
    hmregraw is the file with the commands such as
    grep '\tA.:' Udata
    The \ is not printing and in eval it is trying to run
    grep 'tA.:' Udata
    which is wrong. The line being read into the while loop from hmregraw has the \ removed. How can I preserve those backslashes? Is there a way I can do this with out modifying the other departments or creating another duplicate file?
    Thank You.

    The 'read' is removing the \
    Try using read -r
    See man bash

  • How to copy a value of interface counter to a variable

    Hi Folks,
    I'm new in EEM and I'm trying to read a interface counter and save the value in a new variable. I will use the new variable to manipulate the value.
    Should I use SNMP (event snmp oid ...) to get the value?
    Regards
    Padula

    You can use something like this:
    event manager applet periodic-cmds   
    event timer watchdog time 60
    action 1.0 cli command "enable"
    action 2.0 cli command "show interface gi0/1 | append flash:/output.txt"
    action 3.0 ...
    Just keep adding the commands you want to run.

  • Enabling the set/hierarchy node option in Report painter

    In Report painter how to enable the option to check the set/hierarchy node option in ‘general data selection’. it always displayes in disabled mode.

    sanjay,
    in change mode(GRR2)it wont allow to edit 'set/hierarchy node', only allows for variable.

  • Copy Form Setting from one user to another

    Hi,
    I am using 2005A.
    How to copy form setting (rows and UDFs at header) from one user to another user?
    Thanks

    Hi Ming Ming On,
    I found a note couple of years ago.
    I can't remember the note number, and I attach the note here.
    Solution
    The following queries enables you to set preferences for one user and copy those to another user who is supposed to have the same preferences.
    Explanation for the queries variables:
    dest - Company database name
    sourcid - Represents the user ID from whom the preferences will be copied.
    destid - Represents the user ID to whom the preferences will be copied.
    How to get the user ID?
    From SAP Business One query interface or from the SQL Query Analyzer, run the query as follows:
    1. SELECT T0.U_NAME, USERID FROM OUSR T0 FOR BROWSE
    2. From the query's results, identify both the sourcid and the destid.
    3. In order to copy the preferences from sourcid to destid, run the query as follows:
    a) Replace the text dest with the company database name.
    b) Replace the text sourceid with the user ID from which the preferences will be copied.
    c) Replace the text destid with the user ID to which the preferences will be copied.
    d) Use dest, if exists (select 1 from sysobjects where name = 'temp_dev_sup')
    e) Begin - drop table temp_dev_sup
    f) End - select * into temp_dev_sup from cprf where usersign='sourcid'
    Deleting a certain user:
    Delete from cprf where usersign='destid'
    Update userid in temporary table:
    1. Update temp_dev_sup
    2. Set usersign='destid'where usersign='sourcid'
    Insert preferces into CPRF table
    1. Insert into cprf
    2. Select "" from temp_dev_sup where usersign='destid*'
    &#50696;&#51228;)
    1. Use TEST_MONAMI
    2. drop table temp_dev_sup
    3. Delete from cprf where usersign='2'
    4. select * into temp_dev_sup from cprf where usersign='1'
    5. Update temp_dev_sup
        Set usersign='2'where usersign='1'
    6.  Insert into cprf
         Select * from temp_dev_sup where usersign='2'

  • SharePoint 2013 - Document Set Capture Version History. Does each version captured for each document set keep a copy of all the document stored in the document set?

    Hi All,
    We have currently encountered an issue where even though version control is turned on in a document library, changes made to the metadata of a document set is not tracked in a version history. 
    We have found that in order to this a user will need to manually click on the capture version history button. 
    With this in mind, we are concerned about the impact of this on our storage. The question we have been trying to answer is whether each document set version:
    stores the change in metadata of the document set and a copy of all the documents stored in the document set
    stores the change in metadata of the document set and a reference to the documents stored in the document set (making use of SharePoint 2013's shredded storage)
    The reason we ask this is that if a document set version stores a copy of all the document stored in a document set, a change in one of the fields in the document set could result in the storage used to grow exponentially. e.g. if the document set contains
    documents totaling 30MB, and if we have 10 versions of the document set, we could take up 300 MB in the content database for just one document set.
    We have tried to some searching around Google but wasn't able to find any answers around this question. Would appreciate some assistance from anyone who has knowledge around how document set version history works. 
    Thanks in advance.
    John

    i had a long thing written out, but submit failed.  suffice to say it does "2".  it only stores the changes with pointers to the documents. 
    Christopher Webb | Microsoft Certified Master: SharePoint 2010 | Microsoft Certified Solutions Master: SharePoint Charter | Microsoft Certified Trainer| http://tealsk12.org Volunteer Teacher | http://christophermichaelwebb.com

  • I have set up different use accounts on my I mac how can other users share the music stored in my I tunes

    I have set up different user accounts on my I mac how can other users share the music stored in my I tunes

    iTunes: How to share music between different accounts on a single computer

  • How to clear value set values from node info

    Hi,
    I have set some values on value set to display on a dropdown in my view.  using following method.
      l_node_info->set_attribute_value_set(  name      = 'XYZ'  value_set = l_value_set ).
    Now i need to clear node info value set. Otherwise particular attribute which i used for dropdown is always showing values added .
    Please suggest how to clear value set.
    Thanks,
    Venkat.

    Hi,
    Interface IF_WD_CONTEXT_NODE_INFO is for metadata of a node. It has nothing to do with the values in dropdown list.
    In order to manipulate the values in the dropdown of an attributes, you can use the IF_WD_CONTEXT_NODE.
    As you are saying its a dropdown, what I can suggest is to write supply function for the node.
    And then get the index (V_INDEX) of the value you wanted to see in the dropdown list, and then use the following code in the method WDDOINIT
    LO_NODE->SET_LEAD_SELECTION_INDEX( INDEX = V_TABIX ).

  • I had my iPhone 4S stolen last week and I am going to sync it to my computer to get everything back on it. I have a new computer, i know how to copy music over to the new computer, but where are the contacts stored on the computer?

    Hi there,
    Can anyone help me!? I know how to copy my music library to my new computer but struggling with copying the contacts etc. Where do I find the contacts folder on my old computer?
    Thanks
    K

    I had my iPhone 4S stolen last week and I am going to sync it to my computer to get everything back on it.
    If it is stolen , how are you going to sync it?
    You mean you got a new iPhone and you want to sync it to your computer?
    Plug it in.
    I know how to copy my music library to my new computer
    New computer??? Or new iPhone?
    I know how to copy my music library to my new computer but struggling with copying the contacts etc. Where do I find the contacts folder on my old computer?
    I suggest you simply copy your entire User folder from old computer to new computer. This way all your data (Music, photos, contacts, emails, calendars, documents, etc.)  goes across.

  • How  to  copy  the  table1selected  records into table 2 in webdynpro java.

    Hi 
           how  to  copy  the  table1selected  records into table 2 in webdynpro java.
    venkat
    Edited by: venkatpvr on Sep 23, 2011 11:53 AM

    Hi Venkat,
    You have 2 Value Nodes one for Table1 and second for Table2.
    Table1 node having one more Value Attribute i.e check Box data type is Boolean. Now you are requirement are select records from Table1 Node and click on One Method that records will moves to Second Table2 Node.
    Create One Method for getting the Records from 1-Table to 2-Table
    CopytoTable2 ()
    In this method you have to write code like this
    If (wdContext.nodeTable1.Checkbox(true))
    If(1. Check the Table1 Value Node Size()>0)
    Get the Table1 records and set to table2 Value node.
    Else
    Please select check box// Error message
    Hope this helps!!
    Regards
    Vijay K

  • How to copy file from global zone to non-global zone?

    Hi,
    I'm new in zone.
    I have installed a zone and I would like to install some programs.
    Could you please tell me how to copy downloaded file from internet to the new installed zone?
    Kind regards,
    Daniel

    I like to use zcp which came from BigAdmin I believe.
    #!/usr/bin/perl
    # zcp - copy a file from the global zone to a nonglobal zone. Solaris 10.
    # 10-Mar-2005, ver 0.50 (first release)
    # USAGE: zcp file1 zonename:file2
    # eg,
    # zcp /etc/syslog.conf workzone1:/tmp
    # Standard Disclaimer: This is freeware, use at your own risk.
    # 10-Mar-2005 Brendan Gregg Created this.
    $ENV{PATH} = "/usr/bin:/usr/sbin";
    $VERBOSE = 1;
    # Process arguments
    # check for arguments,
    if (@ARGV != 2) {
    die "USAGE: zcp file1 zonename:file2\n";
    # check source file exists,
    $srcpath = $ARGV[0];
    if (! -e $srcpath) {
    die "ERROR1: Can't find source file $srcpath\n";
    # check destination zone exists,
    ($destzone,$destpath) = split(/:/,$ARGV[1]);
    chomp(@Zones = `zoneadm list`);
    foreach $zone (@Zones) { $Zone{$zone} = 1; }
    unless ($Zone{$destzone}) {
    die "ERROR2: Can't find zone $destzone\n";
    # check if destination is a directory or filename,
    $dir = `zlogin -S $destzone '
    if [ -d "$destpath" ]; then echo 1; else echo 0; fi'`;
    if ($dir == 1) {
    $node = $srcpath;
    $node =~ s:.*/::;
    $destpath = "$destpath/$node";
    # Print message
    print "zcp from $srcpath, to zone $destzone, to file $destpath.\n" if $VERBOSE;
    # Copy File
    system("cat $srcpath | zlogin -S $destzone 'cat - > $destpath'");
    # Verify file copied
    $srcsize = -s $srcpath;
    $destinfo = `zlogin -S $destzone 'ls -l $destpath'`;
    @Fields = split(' ',$destinfo);
    $destsize = $Fields[4];
    if ($srcsize != $destsize) {
    print STDERR "ERROR3: Copy failed, size mismatch ".
    "($srcsize != $destsize)\n";
    } else {
    print "Copy successful ($destpath, $destsize bytes).\n" if $VERBOSE;
    }

Maybe you are looking for

  • My iPod Touch is no longer charging since iOS update

    Hi, so I have three iPod chargers, and as far as I know, they should both work perfectly fine. One is super old, I've had it since my first second generation iPod Nano, and one is practically brand new, I've had it for a few months. The new one and t

  • Problem with Yahoo! Finance

    On my PC (IE) I had Yahoo! Finance set up so that the stock quote for my stocks updated on the screen. In Safari, it does not happen. Anyone have this problem?

  • So all my music auto downloads onto my iphone?

    So I turn on icloud on my iphone. I want to restore from a backup so I get my old notes and email accounts. Does this mean my entire itunes library will automatically download too? I think there is a bug with this because the reason I wiped my phone

  • EPUB, .PDF, or .Folio for iPad Book?

    I am attempting to convert a bilingual childrens book into an iPad Viewable app but I find much of this confusing. There is English and Hmong text on each page... Is there a way I could create the digital book so the user could select which language

  • Daylight Savings started in my country... Alarm clock time did not change

    Hi, DST began in mexico. My iphone clock is set to "Mexico City" time zone and the clock indeed adjusted automatically to DST this past sunday. The iphone alarm (not a 3rd party app, but the original iphone alarm app) is what had a weird behavior...