Solved

Getting unwanted values between the XML tags in XSLT mapping

Posted on 2014-09-13
6
239 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
Comment Utility
<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
Comment Utility
Hi Folks,

Anyone out there please?
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
Comment Utility
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
Comment Utility
McCarl,

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

Regards
Kalyan.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now