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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:47:42+00:00 2026-05-28T22:47:42+00:00

I am working on a simple dictionary in XML, and now I’m trying to

  • 0

I am working on a simple dictionary in XML, and now I’m trying to output some words vertical, but they all come out on a line without spaces.

This is some of the XML file

<thesaurus>
  <dictionary>
    <language>English</language>
    <word type="1">word 1</word>
    <word type="2">word 2</word>
    <word type="3">word 3</word>
    <word type="4">word 4</word>
    <word type="5">word 5</word>
    <word type="6">word 6</word>
    </dictionary>
</thesaurus>

This is my first “almost” solution

  <xsl:template match="/">
    <html>
      <body>

          <xsl:apply-templates select="//word">

          <xsl:sort order="ascending"/>
        </xsl:apply-templates>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

That solution only prints out all the word like this

AgentsColorFoundationsGrainPartialPogotypePretendSilentStrollTender

My second try is something like this

 <xsl:for-each select="thesaurus">
         <h1> <xsl:value-of select="//word"/></h1>
               </xsl:for-each>

In that way I could style the words and they will print vertical, but the thing is that only the first of the words is printing. =/

Would be great with a hint 🙂

Thanks

  • 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-28T22:47:42+00:00Added an answer on May 28, 2026 at 10:47 pm

    Use this template:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="/">
        <html>
          <body>
            <xsl:apply-templates select="*/*/word">
              <xsl:sort order="ascending"/>
            </xsl:apply-templates>
          </body>
        </html>
      </xsl:template>
    
      <xsl:template match="word">
        <xsl:value-of select="."/>
        <br/>
      </xsl:template>
    
    </xsl:stylesheet>
    

    Output:

    <html>
      <body>word 1<br />word 2<br />word 3<br />word 4<br />word 5<br />word 6<br /></body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a simple dictionary where I have words and synonyms to
I'm trying to simulate some code that I have working with SQL but using
I'm trying to make a simple text editor with winapi, its working for simple
Good Day, I have a simple working routine in Perl that swaps two words:
I am working on some simple form validation and need some assistance. Basically, I
I know this is simple but I can't get it working! I have no
I'm new to Objective-C and I'm trying to create a simple dictionary style app
I'm trying to figure out a 'simple' dictionary/database with Python, which will retrieve a
I'm working on creating a dictionary and I'm trying to create ListMenu dynamically as
The Application I'm working on a simple dictionary search tool, with the main purpose

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.