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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:19:12+00:00 2026-05-23T04:19:12+00:00

I am working with xslt 1.0 and trying to use the XSLT document function

  • 0

I am working with xslt 1.0 and trying to use the XSLT document function to apply the stylesheet to a hierarchy of folders. The folder structures is as below, but I cannot seem to find any reliable references on the Web on how to do this.

a/
└── b
    └── c
        ├── d
        ├── e
        ├── f

Is there a way I can apply my stylesheet to nodes, in a file, in folder f via a file in folder a (a has links to file names in folder hierarchy).

Update #2

book01.xml
<?xml version="1.0" encoding="utf-8" ?>
<book location="../collection/book01.xml">
    <chapter>chapter001</chapteer>
</book>

chapter01.xml
<?xml version="1.0" encoding="utf-8" ?>
<chapter location="../collection/book01/chapter01.xml">
    <page>page01</page>
</chapter>

page01.xml
<?xml version="1.0" encoding="utf-8" ?>
<page location="../collection/book01/chapter01/page01.xml">
    <pagenumber>page 1</pagenumber>
    <text>
      page one.
    </text>
</page>

Output

Book Name: Book XX
  Chapter XX
    Page XX
      page xx.
  • 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-23T04:19:13+00:00Added an answer on May 23, 2026 at 4:19 am

    I’m not sure this is a feasable/reasonable way to implement what you want achieve in the context of your use case; however, you can stay with you initial plan, that is working with xsl:for-each and document().

    For example, assume you have the input file with the list of paths:

    <files>
        <file>book001.xml</file>
        <file>chapter001.xml</file>
    </files>
    

    This input can be reasonably used to define a variable containing all your input documents and apply templates:

    <xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
        version="1.0">
    
        <xsl:template match="files">
            <xsl:variable name="docs">
                <docs>
                    <xsl:for-each select="file">
                        <xsl:copy-of select="document(.)"/>
                    </xsl:for-each>
                </docs>
            </xsl:variable>
    
            <xsl:apply-templates select="msxsl:node-set($docs)"/>
        </xsl:template>
    
        <!-- now you can match elements of your xml files -->
    
    </xsl:stylesheet>
    

    Notice that I needed the extension function in order to evaluate to a node-set. This is definetly available in xsltproc, or you can get it from EXSLT anyway.

    In the example I’ve assumed that the input file is in the same folder of the book001.xml and chapter001.xml file.

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

Sidebar

Related Questions

I'm working on XUL and i'm trying to execute XSLT processor function in XUL
I am trying to use XSLT variables and not having much success, hopefully I'm
I'm working with an OpenXML document, processing the main document part with some XSLT.
I am new to working with XSLT and am trying to create a pivot
I'm trying to use checkstyle for a java project but I can't seem to
I'm trying to use ant to use XSLT to preprocess three specific stylesheets in
Im working with XSLT and I'm outputting an HTML5 document. In my document I
I'm trying to add a tag like <div itemscope> in my xslt transformation but
I have the following code that applies a XSLT style Test.Xml.xslTransform = function(xml, xsl)
I am trying to use <xsl:for-each select=@*> to grab all the attributes of a

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.