Search

I'd like to upload XML documents via an upload field. The uploaded document should then be integrated with an dynamic XML datasource.

I thought this would be simple: Just use the parameter output to get the file name and set up a dynamic XML with it. The problem is, that the upload field is not able to output anything. Does anybody know why? And does anybody how I could change the upload field to get the file name as parameter output?

if you're going to access the xml document, i don't think you can use a $variable for that. If i'm guessing correctly, you'll have to access the xml via the document() function which, from my experience, has always needed an XPATH expression to correctly grab the file.

but you do say you're integrating it into a dynamic xml DS so i'm not entirely sure how that would be integrated entirely.

Ah cool! I didn't know the document() function yet. That's what I needed - thank you, wtdtan!

One possible solution. Create a new folder e.g. /workspace/uploads/xml/ into which your XML files are upload. Drop in a PHP script into this folder which reads the files in the directory, combines them into an XML document, and outputs as text/xml. You can then set a Dynamic DS to point to this PHP file.

This is obviously something of a security concern. So you could always upload the file, then pass the name of the uploaded file to the Dynamic DS URL.

This is what I'm doing now:

  1. Upload an XML file via an upload field.
  2. Use the path in <xsl:apply-templates select="document($path)/diagramm" /> to import the needed XML structure.

Works like a charm!

np nils. man, my redundancy just astounds me sometimes as to how redundant i am.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details