?
Solved

XML/XSLT: Navigation + file operation

Posted on 2006-05-24
1
Medium Priority
?
193 Views
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?
0
Comment
Question by:go4java
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1500 total points
ID: 16750893
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"?>
<resources>
    <resource>test2.xml</resource>
    <resource>test3.xml</resource>    
</resources>

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

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

Cheers!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

579 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