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 7634135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:05:32+00:00 2026-05-31T07:05:32+00:00

I am looking to make an XSLT that will transform the input XML below:

  • 0

I am looking to make an XSLT that will transform the input XML below:

<?xml version="1.0" encoding="UTF-8"?>
<payload>
    <header>
        <from>From: exmaple@domain.com</from>
        <to>To: exmaple@domain.com</to>
    </header>

    <email>
        <body>Hello, email body here...</body>
    </email>

    <attachments>
        <attachment>
            <name>log1</name>
        </attachment>

        <attachment>
            <name>log2</name>
        </attachment>

    </attachments>
</payload>

into:

From: exmaple@domain.com
To: exmaple@domain.com

Hello, email body here...

To: exmaple@domain.com
log1


To: exmaple@domain.com
log2

Where the To node is repeated after every attachment. There can a number of attachments, not just two.

UPDATE FROM USER

Im pretty new to this, but i tried creating a payload without the header, email, and attachment tags. Then used to arrange them into the correct order but this looks horrible. And is not scalable

  • 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-05-31T07:05:34+00:00Added an answer on May 31, 2026 at 7:05 am

    How about:

    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
      <xsl:output method="text"/>
    
      <xsl:template match="from|to">
        <xsl:value-of select="text()"/>
        <xsl:text>&#0010;</xsl:text>
      </xsl:template>
    
      <xsl:template match="body">
        <xsl:text>&#0010;</xsl:text>
        <xsl:value-of select="text()"/>
        <xsl:text>&#0010;</xsl:text>
      </xsl:template>
    
      <xsl:template match="attachments">
        <xsl:for-each select="attachment">
          <xsl:text>&#0010;&#0010;</xsl:text>
          <xsl:apply-templates select="../../header/to"/>
          <xsl:value-of select="name/text()"/>
          <xsl:text>&#0010;</xsl:text>
        </xsl:for-each>
      </xsl:template>
    
      <xsl:template match="text()"/>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking to make a simple application that will capture the video from
I'm looking to make a website that will probably get some heavy, repetitive traffic.
i looking to make a small script that will understand pagination of urls i
I'm looking to make a simple web traffic sniffer that will automatically reply to
I'm looking to make an image that's just noise, maybe something like this: (source:
I'm looking to make a page that would show about 20k lines and a
I'm looking to make a page wherein a user will make a selection for
I am looking for a tool for semi-automatic XSLT generation. Given 2 XML files,
Im looking to make a program that mixes up all the keyboard letters/ASCII values.
I am looking to make a phone call from software and have the software

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.