Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:45:19+00:00 2026-06-01T22:45:19+00:00

I am having problems with formating the display of the XML into HTML with

  • 0

I am having problems with formating the display of the XML into HTML with XSL.

I have the following XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Send_Email>
<Send_Email_lookupID>HIDE_REJECT</Send_Email_lookupID>
<Error_Message>REJECT1</Error_Message> 
<Error_Message>REJECT2</Error_Message>   
<Error_Message>REJECT3</Error_Message>   
</Send_Email>

And the XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Result</h2>
<table border="1">
<xsl:for-each select="/Send_Email">
<xsl:if test="not(/Send_Email_lookupID)">
<tr>
<td><xsl:value-of select="*"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

This line is always static and should be hidden:

<Send_Email_lookupID>HIDE_REJECT</Send_Email_lookupID>

The next set of lines may be different everytime, but all need to be displayed.

Can anyone help me out here?

Thanks in Advance.


Update – Correct Solution

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:template match="/">
<html>
<body>
<h2>Result</h2> 
<table border="1">
<xsl:for-each select="Send_Email/*[local-name()!='Send_Email_lookupID']"> 
<tr>
<td><xsl:value-of select="."/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:45:21+00:00Added an answer on June 1, 2026 at 10:45 pm

    I assume that you want a table with one row for each error message – than what you are looking for is:

    <?xml version="1.0" encoding="ISO-8859-1"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    
      <xsl:template match="/"> 
        <html> 
          <body> 
            <h2>Result</h2> 
            <table border="1"> 
              <xsl:for-each select="Send_Email/Error_Message"> 
                <tr> 
                  <td><xsl:value-of select="."/></td> 
                </tr> 
              </xsl:for-each> 
            </table> 
          </body> 
        </html> 
      </xsl:template> 
    
    </xsl:stylesheet>
    

    /Send_Email_lookupID matches a root element because it starts with / – but in your XML the element with that name is not the root one.

    If you don’t want to match just Error_Message but EVERY element under Send_Email except Send_Email_lookupID use:

              <xsl:for-each select="Send_Email/*[local-name()!='Send_Email_lookupID']"> 
    

    that means ‘all the elements under Send_Email except those named Send_Email_lookupID.

    Note also that <xsl:value-of select="*"/> outputs the text contained inside all sub-elements of the current node – whereas <xsl:value-of select="."/> outputs the text contained in the current node – that is what we want in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having problems with classpaths. I have used them before with import but I'm
I am having problems getting JBoss to inject an environment variable value into a
I have started having problems with my VPS in the way that it would
I'm having problems compiling the following program. I'm using gcc -framework Foundation inherit8.1m and
im having problems with formatting for a UITextView. my app pulls in XML, saves
I'm having problems with string matching in PHP. I've 2 html elements in my
I'm having problems with the following JavaScript code. I coded in the comments what's
I have been having problems with the 400 Bad Response, and have got it
I am having problems with getting a HTML editor working. We are using contentEditable
I'm having a problem writing Norwegian characters into an XML file using C#. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.