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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:37:22+00:00 2026-05-31T11:37:22+00:00

I’m trying to combine multiple, smaller XML files into one large XML. I have

  • 0

I’m trying to combine multiple, smaller XML files into one large XML.

I have done some searching and am trying to use PHP / XML / XSL but I can’t seem to get it right.

I’m using:

<?php

// Load the XML source
$xml = new DOMDocument;
$xml->load('collection.xml');

$xsl = new DOMDocument;
$xsl->load('vp.xsl');

// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules

echo $proc->transformToXML($xml);

?>

And here is the XSL file I’m using:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>

<xsl:param name="pdoc1Url" select="'http://www.domainname.com/pages/google-feed?page=1.xml'"/>
<xsl:param name="pdoc2Url" select="'http://www.domainname.com/pages/google-feed?page=2.xml'"/> 
<xsl:param name="pdoc3Url" select="'http://www.domainname.com/pages/google-feed?page=3.xml'"/>
<xsl:template match="/">

<documents>
<xsl:copy-of select="document($pdoc1Url)"/>
<xsl:copy-of select="document($pdoc2Url)"/>
<xsl:copy-of select="document($pdoc3Url)"/>
</documents>
</xsl:template>
</xsl:stylesheet>

However when I run the script nothing is combining? I know I’m doing something wrong but can’t seem to find out exactly what that is. I think I’m using the PHP XSLT Processor incorrectly.

What is the best way to combine XML documents from multiple URLs into 1 xml? They all have the same formatting. Ideally I’d like to be able to view the combined XML from a URL.

The data I’m trying to combine is like these two URLs for example:
http://www.domainname.com/pages/google-feed?page=1.xml
http://www.domainname.com/pages/google-feed?page=2.xml

  • 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-31T11:37:24+00:00Added an answer on May 31, 2026 at 11:37 am

    I was able to perform your transformation using Saxon 6.5.4. The transformation took more than 14 seconds on a fast 12GB RAM computer. 108209 lines were produced (and thus I am not placing the output here … 🙂 ).

    There is an error in http://www.vitaminpartners.com/pages/google-feed?page=1.xml but Saxon recovered from this error. Quite probably the XSLT processor you are using doesn’t recover from this error, or the computer you are using lacks enough memory.

    Here are the messages from Saxon:

    SAXON 6.5.4 from Michael Kay
    Java version 1.6.0_31
    Preparation time: 90 milliseconds
    Processing file:/(Untitled)
    Building tree for file:/(Untitled) using class com.icl.saxon.tinytree.TinyBuilder
    Tree built in 6 milliseconds
    Building tree for http://www.vitaminpartners.com/pages/google-feed?page=1.xml using class com.icl.saxon.tinytree.TinyBuilder
    Error on line 28088 column 21 of http://www.vitaminpartners.com/pages/google-feed?page=1.xml:
      Error reported by XML parser: unexpected character after entity reference (found "<") (expected ";")
    Recoverable error
    org.xml.sax.SAXParseException: unexpected character after entity reference (found "<") (expected ";")
    Building tree for http://www.vitaminpartners.com/pages/google-feed?page=2.xml using class com.icl.saxon.tinytree.TinyBuilder
    Tree built in 6936 milliseconds
    Building tree for http://www.vitaminpartners.com/pages/google-feed?page=3.xml using class com.icl.saxon.tinytree.TinyBuilder
    Tree built in 4350 milliseconds
    Execution time: 14845 milliseconds
    Press any key to continue . . . 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from

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.