XSL Mapping: Get node without complete XPath

Dear all,
I would like to create a generic XSL mapping
In the target structure I would like to insert the value of DOCNUM
<xsl:template match="DOCNUM">
   <xsl:value-of select="/ORDERS/IDOC/EDI_DC40/DOCNUM" />
</xsl:template>
That works.
Now, the mapping should become generic. I would like to use this for ORDERS, DELVRY and so on.
I try tor create it this way.
   <xsl:value-of select="/../IDOC/EDI_DC40/DOCNUM" />
   <xsl:value-of select="/IDOC/EDI_DC40/DOCNUM" />
   <xsl:value-of select="/DOCNUM" />
So I don't want to use ORDERS in the select statement.
How to get this work for all IDOC types?
Regards
Chris

just define this
SOURCE
<?xml version="1.0" encoding="UTF-8"?>
<XXXXXXX>
   <IDOC BEGIN="1">
      <EDI_DC40 SEGMENT="1">
         <TABNAM>EDI_DC40</TABNAM>
         <MANDT>310</MANDT>
         <DOCNUM>0000000001021184</DOCNUM>
         <DOCREL>XX</DOCREL>
         <STATUS>XX</STATUS>
         <DIRECT>1</DIRECT>
</EDI_DC40>
</IDOC>
</XXXXXXX>
XLS
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="IDOC">
<DOCNUM>
<xsl:value-of select="EDI_DC40/DOCNUM" />
</DOCNUM>
</xsl:template>
</xsl:stylesheet>
RESULT
<?xml version="1.0" encoding="UTF-8"?>
<DOCNUM>0000000001021184</DOCNUM>
Thanks
Edited by: Rodrigo Alejandro Pertierra on Feb 3, 2011 2:28 PM

Similar Messages

  • XSLT mapping - getting node count

    I'm mapping a flat file to an 835, and on the advice of Boatseller I've dove into XSLT in order to finish the map and it has been the best thing I've ever done. However, not being a real pro at XSLT I am stuck on one thing I hope you guys can help me on.
    I'm dealing with transactions whose lines have tags. One transaction can looks like this:
    0001(header)
    0002(EOB)
    0003(service lines)
    0004(Totals)
    0005(comments)
    0007(footer)
    lines 0002-0004 make up one record and there can be multiple records per transaction. I've got that all figured out. What is killing me is that there can be multiple 0003(EOB) lines per record, like this:
    0001
    0002
    0003
    0003
    0003
    0004
    0002
    0003
    0003
    0004
    0005
    0007
    So in the above transaction I've actually got two records. One with three 0003 lines and another with two 0003 lines. As I'm processing each record (0002-0004) I need to be able to loop through the 0003 lines. When I start looking at the 0003 lines my XSLT
    is actually grabbing ALL 0003 lines in the entire transaction. In the case above, it is grabbing five each time instead of three the first time and two the second time. I have a counter variable that tells me which EOB(0002) section I'm on:
    <xsl:variable name="var:ClaimSequence" select="position()" /> 
    When I try the following code it gives me ALL the service lines(0003) instead of just the ones I need:
    <xsl:variable name="SVCcount" select="count(//ServiceLines)" /> 
    When I try the following code it only gives me the first ServiceLine(0003) line:
    <xsl:variable name="SVCcount" select="count(../ServiceLines[number($var:ClaimSequence)])" />
    What I'm trying to do is determine how many Service lines(0003) I have in the current record and I can create a counter in a for loop and access each service line like this:
    EOB(counter)
    I just can't seem to reach, via XSLT, the correct count.
    Any ideas?
    Thanks.

    You don't need to determine the count, you can use a for-each loop to iterate over the Service lines belonging to each 0002 (EOB) record.
    Here is an example.
    Input:
    <Root>
    <Header/>
    <EOB/>
    <ServiceLine>1</ServiceLine>
    <ServiceLine>2</ServiceLine>
    <ServiceLine>3</ServiceLine>
    <Totals/>
    <EOB/>
    <ServiceLine>4</ServiceLine>
    <ServiceLine>5</ServiceLine>
    <Totals/>
    <Comments/>
    <Footer/>
    </Root>
    XSLT:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="Root">
    <Root>
    <xsl:for-each select="EOB">
    <EOB>
    <xsl:for-each select="following-sibling::ServiceLine[count(preceding-sibling::EOB[1] | current()) = 1]">
    <xsl:copy-of select="." />
    </xsl:for-each>
    </EOB>
    </xsl:for-each>
    </Root>
    </xsl:template>
    </xsl:stylesheet>
    Output:
    <Root>
    <EOB>
    <ServiceLine>1</ServiceLine>
    <ServiceLine>2</ServiceLine>
    <ServiceLine>3</ServiceLine>
    </EOB>
    <EOB>
    <ServiceLine>4</ServiceLine>
    <ServiceLine>5</ServiceLine>
    </EOB>
    </Root>

  • External Context Mapping and "The Mapping to Node...Has Not Been Completed"

    Hi there,
    I've got 2 components: A, B where A consumes the data provided by B.
    I'm calling the component B which includes a view provided by A. This view (provided by A) needs data inputted by the user in a view in B.
    The context of B contains a node called MULTIVALUES flagged as Interface + Input Element Ext.
    The component A uses the component B, in the component usage interface controller of the component A I've referenced the component controller of A. I have then created a node in A's component controller and done the mapping from the component usage interface controller of A to A's component controller.
    The manually created component controller node in A is NOT an interface.
    Now when I invoke B I'm getting an error:
    The Mapping to Node COMPONENTCONTROLLER.1.MULTIVALUES Has Not Been Completed.
    What's still missing?
    Thank you!

    it is indeed much more complex and you need lot of understanding about the component instances and their life time.
    What i do normally for such complex cyclic dependency , i try to split the common part which is needed in bot component_a and component_b and create a new super component_s.
    Component_s is used in both components. You can even go further that you create view component which has nothing but the viewContainer UI elements to embed the views from component_a and Component_b.
    The view component has to create all the used components (comp_s,comp_a,comp_b) and after creating call the interface method in comp_a and comp_b to set the component usage of comp_s (use the if_wd_comp_usage=>entering-referencemode).
    In this way the comp_a,comp_b share the same instance of comp_s.
    What i am saying is to look for a solution in application architecture and not with in the exiting components coding.

  • The error is " The Mapping to Node has not been completed

    Hi All,
    I am getting a strange type of error and need help immediately.
    The error is " The Mapping to Node COMPONENTCONTROLLER.1.PLANNING_ENTITY Has Not Been Completed" for the node that exists in the Parent component and is being used in all the child nodes thru reverse mapping.
    I have done mapping in all the child nodes but still the message is coming.
    Could anybody tell me the reason .
    Regards,
    Arti.

    Basically somewhere you have defined a context node 'PLANNING_ENTITY'  to be an Input-Element. At the same time you did not define (through a component usage at design time) where the input to that node is coming from. This means the mapping path to the node is not complete, and the node does not know where it is mapped to.
    Either:
    - You untick the checkbox 'Input-Element (ext.)' inside the controller context, or
    - You find the component that uses the component with the node 'PLANNING_ENTITY' and select Component_Usage->'Name of Usage'->'Add controller usage'. Inside the controller menu you see then, you can now provide a mapping to the context node.
    I realise this now sounds a little confusing, but I'm happy to provide more details should you need them.
    Cheers,
    Robin

  • Access an interface node : the mapping has not been completed

    Hello all,
    by getting an element of interface-node within a component I get follow error message
    "the mapping to node COMPONENTCONTROLLER.1.INIT_DATA" has not been completed"
    Can anybody say me, what does it mean?
    Some more information (in case for somebody need it):
    1. I have  a component A, where I have defined usage component of component B.
    2. Component B has an interface node INIT_DATA, which is mapped with the node INIT_DATA of component A.
    3. I set attributes of node INIT_DATA of component A and expect, that those values will be assigned to the node INIT_DATA of component B (becouse they are mapped)
    4. by doing it within a component A:
    lo_node = wd_context->get_child_node( name = if_componentcontroller->wdctx=>init_data).
    lo_elem->get_element( ).
    lo_elem->set_attribute(....).
    I get this error message:
    "the mapping to node COMPONENTCONTROLLER.1.INIT_DATA" has not been completed"
    Please let me know, what I do wrong?
    thanks in advance
    Anna

    Hi Anna,
    You should not be having the node INIT_DATA defined separately in both components. It should be defined only in component B and marked as Interface node. Now when you define a usage of component B in component A, you will be able to see this node. You need to map this in component A by drag and drop.
    Also, in the properties tab of the component controller of component A, declare the usage of component B using the F4 help. I think that should solve your problem.
    Regards
    Nithya

  • The Mapping to Node &ATTRIBUTE_NAME& Has Not Been Completed.

    Hi All,
    Could anybody tell me when this exception arises.
    we could not track this exception as all the mappings have been done as desired.
    Need help immediately.
    Regards,
    ARti.

    Hi Aarti,
    I encountered the same problem, but could resolve it.
    There are two kinds of context mapping possible:
    1)Cross component context mapping - In this case, the properties of the interface context node of the used component would look like:
    Interface Node: X
    Input Element (Ext.): must not be set
    Then in the COMPONENT CONTROLLER of the using component, map the desired context node on the left hand side (of the component controller) to the interface node of the used component on the right hand side.
    This is done when we need to receive value of the interface context node of the used component in the using component.
    2)External context mapping: In this case, properties of the interface context node of the used component would look like:
    Interface Node: X
    Input Element (Ext.): X
    Next in the CONTROLLER USAGE in the using component(this is a new node added in the hierarchy in SE80 when displaying the WD component, when component usage has been declared in the current component), right click the desired component usage and select 'Create controller usage'. Now it is here where you define mapping between the interface context node and the context node of the current component controller. By doing this, component controller of the using component would act as the data source.
    This is done when we need to pass value to the used component from the using component.
    The important point to remember is that whenever attribute Input Element (Ext.) of the interface node has been marked as X, ensure to define a mapping for this context, else it results in a runtime error "The Mapping to Node COMPONENTCONTROLLER.1.<interface_context_node> Has Not Been Completed" .
    Regards,
    Chitrali

  • How to get Value of tree node without Reload Page

    hi,
    i worked with apex 4.2 and i created Tree and tabular form to retrieve the date according the value of tree select node the code of tree something like this
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "ENAME" as title,
    null as icon,
    "EMPNO" as value,
    null as tooltip,
    'f?p=36648:34:5234984107903::::P40_SELECTED_NODE:'||empno as link
    from "DEPT"."EMP"
    start with "MGR" is null
    connect by prior "EMPNO" = "MGR"
    order siblings by "ENAME
    and i put Selected Node Page Item: P40_SELECTED_NODE . the tree worked good and retrieve the data into tabular form according to tree node value
    my Question :
    1- i want to retrieve the data without submit the page where each time i select value from tree make page reload to update the tabular form with new value ,there is any way to pass the value of tree node to P40_SELECTED_NODE item and refresh tabular form without page reload .
    2- i want when selected from tree run page process according to value of tree node i tray to create Dynamic action with *(jquery selector : div.tree li>a)* but the Value of node incorrect.
    Regards
    Ahmed;

    look at this link
    Re: How to get Value of tree node without Reload Page ..!

  • Get node jtree without click

    hi all,
    I want get node from jtree without click, just with mouse in node.
    I look in google but dont find nothing...
    I try use listener but MousePressed dont help-me.
    thanks

    jTree1 = new JTree1(treeModel);Sorry, now
    jTree1 = new JTree(treeModel);
    MouseMotionListener mm = new MouseMotionListener(){
          public void mouseMoved(MouseEvent e) {
                System.out.println("moved "+e.getX()+" "+e.getY());
                 int selRow = jTree1.getRowForLocation(e.getX(), e.getY());
                TreePath selPath = jTree1.getPathForLocation(e.getX(), e.getY());
                if(selRow != -1) {
                                    System.out.println("mouse moved..."+selPath);
        public void mouseDragged(MouseEvent e) {
                   System.out.println("dragged "+e.getX()+" "+e.getY());
    jTree1.addMouseMotionListener(mm);
    jScrollPane1.setViewportView(jTree1);

  • After I covered 250 miles I got the automated congratualtions, but now after every run I get the recorded message again saying I just covered another 250 miles. Can I reset or stop it without completly resetting everything?

    I run with the Nano and shoe sensor. After I covered 250 miles I got the automated congratualtions, but now after every run I get the recorded message again saying I just covered another 250 miles. Can I reset or stop it without completly resetting everything?

    Same issue here.  This is really disappointing.  I used to look forward to the milestone messages after each run, especially when I was surprised by a celebrity voice.  Now, it's the same thing every single time, "Congratulations on another 250 miles.  Way to go!" or something along those lines.  I was proud of the 250 mile mark, but please...I don't want to hear it every time! 
    I hope there's some movement on this issue.
    ~ Heather

  • How to insert function nodes in routing service xsl mapping?

    I have been struggling with this for some days now.
    I have requestId, versionNumber coming in as a part of xml.
    I accept this xml(xsd) in one routing node, But on the way out, I want to assign a value requestId+versionNumber(basically concatenate)+randomNumber to transitionId(a new variable).
    How do I introduce this function node in xsl mapping that can concatenate different values that come through?
    Also, how do I generate random numbers?
    Thanks in advance,
    vena

    This is fairly straight forward.
    First of all create a random number. You can do this inyour translation. On the Component Palette select Advanced Functions. There you have an option generate-id or generate-guid. Either of these will be unique. Drag this to the middle.
    You can now drag this to the transactionid. Now you need to create a concatanation. In the Component palatte go to String and drage concat to the middle. Create a link between this concat and the generate-id function. Now you should be able to drag an link from requestid and versionNumber to the concat. If if they are in the wrong order just cut and past in the code by double clicking the concat icon.
    Hope this helps
    cheers
    James

  • XSLT Mapping - Getting current date in XSLT version 1.0

    Hi,
    I want to fetch the system date and compare it with another date, say 06.04.2010.
    How can I do this in XSLT 1.0?
    Thanks & Regards,
    Aditi Naik

    Hi,
    I tried using the following code:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cal="java:java.util.GregorianCalendar">
         <xsl:output method="xml"/>
         <xsl:template name="currentDate" xmlns:cal="java:java.util.GregorianCalendar">
              <xsl:variable name="now" select="cal:getInstance()"/>
              <xsl:variable name="day" select="cal:get($now, 5)"/>
              <xsl:variable name="month" select="cal:get($now, 2)"/>
              <xsl:variable name="year" select="substring(string(cal:get($now, 1)), 3, 2)"/>
         </xsl:template>
    <Body>
              <xsl:choose>
              <xsl:when test="boolean(//*[local-name() = 'IRenvelope']/node()) and boolean($year = 2009) and boolean($month &gt; 11) and boolean($day &gt; 05))">
              </xsl:when>
              </xsl:choose>
    </Body>
    However, when I try to run this mapping I get the error "Invalid XPath Expression" in Altova.
    Can you please tell me exactly what is wrong with this code and how I can get around this?
    Thanks & Regards,
    Aditi Naik

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • I have an old apple ID that is associated with an email I can no longer access, but over half of my apps are associated with this Apple ID. Any idea on how to reset the apps to go with my newer Apple ID without completely wiping my iPhone?

    I have an iPhone 4s. The email I need to use is completely locked because Windows believed someone else was trying to use my account (another reason Windows and I don't seem to get along). Anyway, I think my little sister may have accidentally clicked "Forgot my Password" while trying to download an app on my iPad that was under the same ID. So, an email was sent to my old hotmail account that is lockedried unlocking it, but the alternate email that was listed was an old one of my moms and she can't remember what her username was. I tried answering security questions on my Apple ID to maybe get my password to reset that way, but - since I made this account when I was about 12 or 13 - I can't even begin to remember what the answers to the security questions are. (And before anyone gets on a pedestal about how I was too young to be doing something like this, I did have parent supervision and wanted something like this of my own, so lets stick to the ACTUAL problem). So, main problem here. I now have about 30 app updates that are under an account I basically have no access to. I've deleted the apps from my home screen and tried downloading them with my new Apple ID, but it shows as if it's stored in the cloud and will only let me download it from the old Apple ID. Is there any possible way to dissociate my apps from my old ID and associate them with my newer one WITHOUT completely resetting my phone?

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • Need help in Component Mapping - "Mapping has not been completed" !

    Hi Experts,
    i read the SAP Galileo Press Book "Web Dynpro for ABAP" and i try in Chapter 2 some exercise for Multi-Component-Architecture.
    In this Chapcter i have 2 Components "Main" and "Nations". In one of this Components i created Node´s and Attributes in the Context of Component-Controller. After this i changed to the View and tryed to mapping the Component-Controller and View.
    Before i explain what i have done, i want show us the following Error:
    Note
    -> The following error text was processed in system FID : Adapter error in TEXT_VIEW "TV_LANDX50" of view "ZZWDC_CHAP02_NATIONS.V_NATIONS": Context binding of property TEXT cannot be resolved: The Mapping to Node COMPONENTCONTROLLER.1.T005T Has Not Been Completed.
    -> The error occurred on application server fidvfid0_FID_00 and in work process 0 .
    -> The termination type was: RABAX_STATE
    -> The ABAP call hierarchy was:
    -> Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP
    -> Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
    -> Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP

    ETN_58 wrote:
    Hi Experts,
    >
    > i read the SAP Galileo Press Book "Web Dynpro for ABAP" and i try in Chapter 2 some exercise for Multi-Component-Architecture.
    >
    > In this Chapcter i have 2 Components "Main" and "Nations". In one of this Components i created Node´s and Attributes in the Context of Component-Controller. After this i changed to the View and tryed to mapping the Component-Controller and View.
    >
    > Before i explain what i have done, i want show us the following Error:
    >
    > Note
    >
    > -> The following error text was processed in system FID : Adapter error in TEXT_VIEW "TV_LANDX50" of view "ZZWDC_CHAP02_NATIONS.V_NATIONS": Context binding of property TEXT cannot be resolved: The Mapping to Node COMPONENTCONTROLLER.1.T005T Has Not Been Completed.
    > -> The error occurred on application server fidvfid0_FID_00 and in work process 0 .
    > -> The termination type was: RABAX_STATE
    > -> The ABAP call hierarchy was:
    > -> Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP
    > -> Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
    > -> Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
    hello,
    i think you missed mapping the layout with the context attributes....check out the property of all the elements in the view, if not mapped map it by selecting the attribute from the node.
    Regards,
    Sahai.S

  • Can you please help me resolve this issue on Batch Management Completion. "Cannot Add row without complete selection of batch number." Message 29-77

    'Another user or another operation modified data, to continue open the window again ' Inventory Transaction Log' (OITL)(ODBC-2039) (Message 131-183). If I click again on add I get the following message : 'Cannot add row without complete selection of Batch / Serial Nos. [Message-29-77]
    Path:
    Inventory -> Item Management -> Batches -> Batch Management - Complete form.
    Before this I use Return Components on Receipts from Production as I am mistakenly issued it more than what was needed.
    Were anyone be able to explain why it worked for certain items  and not for others? I have successfully done  “return components with some batches"

    Hi Nagarajan,
    I'm one of colleague of caterine, we only accessing the batch management-complete window, no other window is open, still the error occurs; see image below
    Before that error occurs(in image); first error we encounter was batch number is already exist, then upon click add another person modified the window; but we tried to restore the db then try to add the batch number in different transaction like SI 1658(Goods Issue), and it is okay.. but on the SI 50003 which is Receipt from production we can't add it.
    Hope you can help us.
    Regards,
    Lean

Maybe you are looking for

  • I deleted my contacts by mistake and can't restore them from time capsule

    Please Help!! I deleted around 4000 contacts by mistake with a script deleting the annoying duplicates that come with cloud syncs. I can't restore them from my time capsule, I have read other posts and they suggest to copy the contacts folder in a ba

  • Chinese language pack on English-language Nokia E7...

    I'm based in Manila and just bought a Nokia E72 cellphone here locally in the Philippines. The unit is labeled E72-1. I needed a cellphone which can display Chinese-language (both Traditional & Simplified Chinese) characters. Unfortunately, this E72

  • Can't select photo after scans for faces

    I just bought a laptop with iphoto 09 on it; previously I used 08 (or earlier; can't remember). {Yes I know a new version '11 just came out. Given the number of problems reported maybe I'm not sad about the purchase-timing}. My library is huge with 3

  • IPhone 4 wifi portal login with drop down menu

    Hi, I'm extremely happy with my iPhone 4. I use it often in WiFi hotspots (hotels, university, train stations etc) and the new portal log in system is really handy. Previously I used a third party WiFi portal logging in app which is now no longer nec

  • Macintosh HD gone?

    While recently trying to fix an error in my Macbook Pro I was forced to reset my Macbook Pro to its factory settings. While clearing out the old HD (via the install disk utility area) I got an error just as it finished and next thing I know the whole