on ‎2019 Mar 11 6:22 AM
I often use strans for XML->ABAP TABLE conversion, but I have encountered the following problem. The correct result should be that there is only one row of data in the ''GT_ORDER-PART'' of each row, but now he has two rows, he has read all the The data in "part", how can I make him correspond to ORDER?




Request clarification before answering.
XSLT refers to nodes by using the XPATH language, which use absolute (start with / like in your example /OrdersOrder) or paths relative to the "context node" (not starting with /, like Parts/Part as I show below). The context node is changed by XSLT at runtime, for example for-each sets the context node to the currently-iterated node.
I think that should work:
<xsl:for-each select="/Orders/Order">
...
<xsl:for-each select="Parts/Part">Note: $var1/Parts/Part is equivalent to /Orders/Order/Parts/Part which starts from the root and parses all nodes matching that path.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh my god,i'm so stupid,I tried /Parts/Part, but I didn't try what you said,thank you so much.
By the way, you should better switch to the Simple Transformation language (provided that the transformations remain simple), because it's something like 10 times faster.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.