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

  • Home
  • SEARCH
  • 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 7659439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:19:59+00:00 2026-05-31T13:19:59+00:00

I have the following XML code: <detaileddescription> <para>Lorem ipsum dolor sit amet, consectetur adipiscing

  • 0

I have the following XML code:

<detaileddescription>
   <para>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum aliquam
   interdum erat, <computeroutput>monospace output</computeroutput> eget rhoncus nunc
   porttitor ut. Ut ac metus sed erat rutrum dignissim.
   <parameterlist kind="param">
       <parameteritem>
           <parameternamelist>
               <parametername>item1</parametername>
           </parameternamelist>
           <parameterdescription>
               <para>Param description.</para>
           </parameterdescription>
        </parameteritem>
    </parameterlist>
    <simplesect kind="return">
        <para>
            <computeroutput>ERR</computeroutput> mattis nunc sed velit ultricies
            volutpat. Suspendisse potenti. Vivamus nec ligula blandit urna lobortis   
            tempus.
        </para>
     </simplesect>
     </para>
 </detaileddescription>

I’d like to use xsl:apply-templates only to the text node child of the detaileddescription/para element and the <computeroutput> element that’s inside the text node. In other words, I want to apply-templates only to the following content:

   Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum aliquam
   interdum erat, <computeroutput>monospace output</computeroutput> eget rhoncus nunc
   porttitor ut. Ut ac metus sed erat rutrum dignissim.

Can anyone show me how to do this using XSLT 2.0 and XPath 2.0?

  • 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-31T13:20:00+00:00Added an answer on May 31, 2026 at 1:20 pm

    If I understand your question correctly, this should work:

    <xsl:apply-templates select="detaileddescription/para/(text()|computeroutput)"/>
    

    of course, depending on the context note. Otherwise, you could also mean the corresponding tempate that will fit only those elements you want:

    <xsl:template match="detaileddescription/para/(text()|computeroutput)"/>
      <xsl:copy-of select="." /> 
      <!-- or whatever you want to do with it -->
    </xsl:template>
    

    Hope this helps,
    R

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

Sidebar

Related Questions

Learning xml, Can anyone help me? I have following XML code: **<book lang=en>name of
I have following code: //preparing DAO objects FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(test-context.xml); surveyDao =
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have the following code that serializes a DataTable to XML. StringWriter sw =
I have the following code: $page=3; $i=1; while($i<=$pages) { $urls .= '.http://twitter.com/favorites.xml?page= . $i
I have a line of PHP code that does the following: $xml = <xml><request>...[snipped
I have a following XML code: <Group> <GElement code=x> <Group> <GElement code=x> <fname>a</fname> <lname>b</lname>
I have the following XML code, which I got by a UPnP device and
I have the following XML Parsing code in my application: public static XElement Parse(string
I have the following magento XML code: <action method=addLink translate=label module=customer><name>myorders</name><path>chepri/myorders/customer</path><label>Standing Orders</label></action> I was

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.