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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:58:43+00:00 2026-06-10T23:58:43+00:00

I have xml file below: <?xml version=1.0 encoding=utf-8 ?> <?xml-stylesheet version=1.0 type=text/xml href=template.xsl ?>

  • 0

I have xml file below:

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet version="1.0" type="text/xml" href="template.xsl" ?>
<source>
    <man name="John" surname="Piterson" >
        <cars>
            <car name="Lamborgini Gallardo" maxspeed="400km" />
            <car name="Honda" maxspeed="200km" />
        </cars>
        <appartments>
            <appartment city="New York" />
            <appartment city="Tokio" />
        </appartments>
    </man>
</source>

and i have xsl template below, it should display list of cars

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match="/" >
        <html>
            <body>
                <h1>Users info</h1>
                <div><strong>The cars of John</strong></div>
                <xsl:for-each select="/man/cars/car" >
                    <div>
                        <xsl:value-of select="car@name" />
                    </div>
                </xsl:for-each>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

I need to print all car names of John, the <xsl:for-each – not work in that case, how to do that?

  • 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-10T23:58:45+00:00Added an answer on June 10, 2026 at 11:58 pm
    <xsl:for-each select="/source/man[@name='John'][@surname='Piterson']/cars/car" >
      <div>
        <xsl:value-of select="@name" />
      </div>
    </xsl:for-each>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a xsl file as below: -------Begin------ <?xml version=1.0 encoding=utf-8?> <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform
i have xml file and xslt transformation below: <?xml version=1.0 encoding=utf-8 ?> <?xml-stylesheet version=1.0
I have an xml file likes below. <?xml version=1.0 encoding=utf-8 ?> <Book> <Title>Title</Title> <Content>Content</Content>
I have a xml file as below: <?xml version=1.0 encoding=UTF-8 standalone=no?> <RULES> <RULE DESCRIPTION=
I have got below xml format file called ResourceData.xml . <?xml version=1.0 encoding=utf-8 ?>
I have an xml file like this, <?xml version=1.0 encoding=utf-8 ?> <root> <FeaturedProductCategories> <FeaturedProductCategory>
I have a simple xml below: <?xml version=1.0 encoding=utf-8?> <catalogue> <category name=textbook id=100 parent=books>
For an XML file that has the following structure <?xml version=1.0 encoding=UTF-8> <farm xmlns:my=mynamespace.com
I have a long xml file the content of the file are below: <?xml
How do I change my XML file below to have CAS return to the

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.