Solved

Getting unwanted values between the XML tags in XSLT mapping

Posted on 2014-09-13
6
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 36

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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…

728 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