Solved

Getting unwanted values between the XML tags in XSLT mapping

Posted on 2014-09-13
6
244 Views
Last Modified: 2014-09-14
Hi Folks
 
I have come across a very strange situation with my xslt mapping.
 
I am getting unwated values "11" between xml tags
 
as follows
 
<Tag>0001</Tag>
11
<DataID>3</DataID>
 
 
I am not sure why I am getting these values in between the tags. Any suggestions would be appreciated. I have also attached the code snippet pertaining to these 2 tags
0
Comment
Question by:kalyangkm
  • 3
6 Comments
 

Author Comment

by:kalyangkm
ID: 40320895
<Order>
            <OrderHeader>
              <Tag>009</Tag>
              <xsl:for-each select="E1EDKA1">
                <xsl:choose>
                  <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U960'">
                  <DataID>
                    <xsl:value-of select="'1'" />
                  </DataID>
                  </xsl:when>
                  <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U300'">
                  <DataID>
                    <xsl:value-of select="'3'" />
                  </DataID>
                  </xsl:when>
                  <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U930'">
                  <DataID>
                    <xsl:value-of select="'1'" />
                  </DataID>
                  </xsl:when>
                  <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U400'">
                  <DataID>
                    <xsl:value-of select="'3'" />
                  </DataID>    
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="'1'" />
                  </xsl:otherwise>
                </xsl:choose>
               </xsl:for-each>

Open in new window

0
 

Author Comment

by:kalyangkm
ID: 40320950
Hi Folks,

Anyone out there please?
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 40321400
The problem will be on line 27 (of the snippet that you posted above), if none of the other "tests" of the choose pass then the "otherwise" gets evaluated and in there all you are doing is outputting a '1' with no surrounding xml tag
0
 

Author Comment

by:kalyangkm
ID: 40321761
McCarl,

I already changed the code by removing the otherwise part, thanks anyway.

Regards
Kalyan.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question