Dynamic XML Endpoint with MySQL Data and XSLT Styling
detail.loadingPreview
This advanced workflow creates a dynamic XML API endpoint that fetches real-time product data from a MySQL database, transforms it into a custom XML structure, and automatically links it with an XSLT stylesheet for browser-side rendering. It provides a powerful solution for serving rich, styleable data feeds or web content directly from your database.
About This Workflow
Unlock the full potential of your data with this comprehensive n8n workflow designed to serve dynamic XML content. Triggered by a simple webhook, it seamlessly connects to your MySQL database to retrieve specified product information. The workflow then intelligently maps and structures this data into a well-defined XML format, complete with an XML stylesheet instruction. A separate, built-in webhook ensures your XSLT stylesheet is served alongside the XML, providing a complete, styled data presentation experience directly in compatible browsers or applications, all while adhering to modern web standards like CORS.
Key Features
- Dynamic XML Generation: Automatically creates custom XML output from database queries on demand.
- MySQL Database Integration: Connects directly to MySQL to pull real-time data, like product listings.
- XSLT Styling Support: Serves XML data pre-linked to an XSLT stylesheet for immediate, browser-side rendering.
- Custom Data Mapping: Easily define and map database fields to your desired XML element names and hierarchy.
- Dual Webhook Endpoints: Provides one endpoint for the dynamic XML and another for serving its associated XSLT stylesheet, ensuring seamless integration.
How To Use
- Set Up MySQL Credentials: Add your MySQL database credentials (e.g.,
db4free MySQL) in n8n's credentials section. - Configure Webhooks: The primary
Webhooknode (XML usecase: advanced) will be your main XML endpoint. TheRequest xsl templatewebhook serves the XSLT stylesheet; ensure its path matches thehrefin theCreate HTMLnode. - Customize Database Query: In the
Show 16 random products(MySQL) node, modify theSELECTquery to fetch data relevant to your needs from your specific database tables. - Define XML Structure: Adjust the
Define file structure(Set) node to map your database columns to the desired XML element names (e.g.,Product.Code,Product.Name). - Review XSLT Link: The
Create HTMLnode includes<?xml-stylesheet type="text/xsl" href="{{ $env.WEBHOOK_URL }}webhook/044ccd2d-d1a7-485b-bb22-218a6848fd1c/models.xsl"?>. Ensure the XSLT webhook path matches your setup. TheGet XSLT(HTTP Request) node fetches the XSLT from a Gist; you can modify this URL to point to your own XSLT file.
Apps Used
Workflow JSON
{
"id": "a652199d-b6f8-49a3-883e-9d4bf7642e80",
"name": "Dynamic XML Endpoint with MySQL Data and XSLT Styling",
"nodes": 8,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: a652199d-b6f8...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Dynamic Bible Scripture Retrieval Workflow
This n8n workflow provides a robust solution for dynamically querying and retrieving Bible scriptures from the getBible.net API. It takes structured JSON input for references, translation, and version, returning the corresponding passages in a standardized API response format.
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.