?
Solved

Transforming many xml files via XSLT processor in PHP

Posted on 2003-02-20
2
Medium Priority
?
177 Views
Last Modified: 2010-04-06
Is it posible to process many xml files (to act like one)
via

$html = xslt_process$xsltproc, 'XMLfile.xml', 'XSLfile.xsl'); ?

I need this because the XML files are related and I need to extract data from all of them in the same time...with a single XSL file. (like a SQL join).

I tried to use in XSL file:

<xsl:apply-templates
select="document('relatedFile.xml')/RELATED_TAG">
</xsl:apply-templates>

but its not working.

I wonder if it is a way to make a global xml with a root node and append all the xml files as children of the root node...and then ...in the xsl file...to use

<xsl:apply-templates
select="root/RELATED_TAG">
</xsl:apply-templates>





0
Comment
Question by:Alta_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
topcat_uk earned 150 total points
ID: 7992420
Hi,

You are on the right track!!

Your code is missing an /

Your Code
<xsl:apply-templates
select="document('relatedFile.xml')/RELATED_TAG">

Try

Your Code
<xsl:apply-templates
select="document('relatedFile.xml')/RELATED_TAG" />

*******************

I created a master XSL file which accepts a parameter for a default XML page.  This page is usually the default elements eg logo, header etc.

This is the parameter to accept the page.
<xsl:param name="DefaultPage" />

This is how I call it.
<xsl:apply-templates select="document($DefaultPage)/WebDocument/Elements" />


0
 
LVL 1

Expert Comment

by:topcat_uk
ID: 7992431
Hi,

You are on the right track!!

Your code is missing an /

Your Code
<xsl:apply-templates
select="document('relatedFile.xml')/RELATED_TAG">

Try

<xsl:apply-templates
select="document('relatedFile.xml')/RELATED_TAG" />

*******************

I created a master XSL file which accepts a parameter for a default XML page.  This page is usually the default elements eg logo, header etc.

This is the parameter to accept the page.
<xsl:param name="DefaultPage" />

This is how I call it.
<xsl:apply-templates select="document($DefaultPage)/WebDocument/Elements" />


0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

770 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