XML/XSLT: Navigation + file operation

Posted on 2006-05-24
Last Modified: 2008-03-10
We have a XML document that includes some directory pathes to other XML files
(these XML files include another directory path and this path contains the files PDF, TXT etc.) - don't ask me why...
Can XSL been used to navigate through such a structure, get the information and build a final HTML?
Question by:go4java
    1 Comment
    LVL 60

    Accepted Solution

    Hi go4java,

    yep, that is no problem

    you can use the document() funtion to get access to other documents
    and you can use XPath to get inside them

    with this XML
    <?xml version="1.0" encoding="UTF-8"?>

    and this XSLT
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="" version="1.0">
        <xsl:template match="/">
        <xsl:template match="resource">
            <xsl:apply-templates select="document(.)//link" />
        <xsl:template match="link">
            <a href="{.}"><xsl:value-of select="."/></a>

    you would make a html a of every link element found in the files test2.xml and test3.xml


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Xsl Nested Loop 4 18
    Header in SQL XML PATH 4 37
    use node.js to convert JavaScript JSON array to xml 2 64
    SVG, D3, scaling, translation 11 102
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now