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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:59:03+00:00 2026-06-01T14:59:03+00:00

I am trying to parse an XML file into smaller XML files and place

  • 0

I am trying to parse an XML file into smaller XML files and place them into folders. The folders get generated based on some of the elements in XML.

How do I generating folders in XSLT? I was able to generate files using xsl:result-document, but so far I had no luck with finding how to generate folders.

  • 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-01T14:59:04+00:00Added an answer on June 1, 2026 at 2:59 pm

    You don’t need to create folders specifically, just supply full desired path like folder1/doc1.xml. For example:


    <?xml version="1.0" encoding="UTF-8"?>
    <tests>
        <testrun run="test1">
            <test name="foo" pass="true" />
            <test name="bar" pass="true" />
            <test name="baz" pass="true" />
        </testrun>
        <testrun run="test2">
            <test name="foo" pass="true" />
            <test name="bar" pass="false" />
            <test name="baz" pass="false" />
        </testrun>
        <testrun run="test3">
            <test name="foo" pass="false" />
            <test name="bar" pass="true" />
            <test name="baz" pass="false" />
        </testrun>
    </tests>
    

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      version="2.0">
    
    <xsl:output method="text"/>
    <xsl:output method="html" indent="yes" name="html"/>
    
    <xsl:template match="/">
    <xsl:for-each select="//testrun">
    <xsl:variable name="filename"
      select="concat('output1/',@run,'.html')" />
    <xsl:value-of select="$filename" />  <!-- Creating  -->
    <xsl:result-document href="{$filename}" format="html">
        <html><body>
            <xsl:value-of select="@run"/>
        </body></html>
    </xsl:result-document>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to parse this xml file into an object to use the
I'm trying to parse the contents of an remote XML file into MySQL, so
I am trying to parse an XML File, but there is one place where
While trying to parse an xml file into table format, jQuery keeps closing my
I'm trying to parse a massive xml file into my MySQL database. the file
I'm trying parse an xml file and insert it into an mysql database. The
I'm trying to parse the DMOZ content/structures XML files into MySQL, but all existing
I'm trying to parse the content.xml inside a ODF-file. I've read the file into
I am currently trying to parse some xml data into an NSDictionary . This
i m trying to parse a xml file into html. So i atm go

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.