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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:20:51+00:00 2026-05-12T16:20:51+00:00

XML/XSL newbie here, so please forgive my ignorance. This is the xml input given

  • 0

XML/XSL newbie here, so please forgive my ignorance. This is the xml input given to me:

<entry>
    <desc>
        <p>Lorem ipsum <a href="http://www.google.com">dolor</a> sit amet.</p>
        <p>Lorem <strong>ipsum</strong> dolor sit amet.</p>
    </desc>
</entry>

I must write an XSL to get this result:

<p>Lorem ipsum <a href="http://www.google.com">dolor</a> sit amet.</p>
<p>Lorem <strong>ipsum</strong> dolor sit amet.</p>

I thought this would work, in an entry template:

<xsl:value-of select="desc"/>

but instead this is the output of the above line:

Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.

Am I correct in assuming there must be other xsl stylesheets on my system that do that? In any case, I have neither read not edit access to them, I can only add a new stylesheet, so to fix this I used this:

<xsl:for-each select="desc/*">
    <p><xsl:value-of select="."/></p>
</xsl:for-each>

This gets me, at least:

<p>Lorem ipsum dolor sit amet.</p><p>Lorem ipsum dolor sit amet.</p>

However as you can see links and formatting have gone bye bye! I have no control on the kind of html elements that get added in there. Can anybody suggest a way to preserving the formatting and all of the desc element? The engine is XSL 1 only. Thanks in advance!

  • 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-12T16:20:52+00:00Added an answer on May 12, 2026 at 4:20 pm

    You need to copy the elements under desc and all of their sub-elements. The copy-of XSL element will do this for you:

    <xsl:copy-of select="desc/node()"/>
    

    That will copy all of the children of desc, including text nodes, and any of their sub-elements.

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

Sidebar

Related Questions

I wish to use xml and xsl to generate controls on an asp.net page.
I have a xsl file that is grabbing variables from xml and they seem
I am looking for a XSL snippet that simply returns the XML unaltered. It
I have a JSP which attaches a XSL to an XML document pulled from
Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL
we're currently generating all our official documents using XSL-FO transformation using .xml files as
This XML file contained archived news stories for all of last year. I was
The XML Schema Part 2 specifies that an instance of a datatype that is
The XML I'm trying to validate is as follows: <root> <element attribute=foo> <bar/> </element>
Which XML validation tools can you recommend for both performance and accuracy, each of

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.