Solved

Getting unwanted values between the XML tags in XSLT mapping

Posted on 2014-09-13
6
249 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 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