Dynamic XML Product Feed with XSLT for Browser Rendering
detail.loadingPreview
Expose a dynamic XML feed of random products from your MySQL database, automatically styled client-side with XSLT, via a custom API endpoint. This workflow handles data retrieval, transformation, and self-hosts the XSLT stylesheet to ensure seamless browser rendering while overcoming common cross-origin issues.
About This Workflow
This n8n workflow offers a powerful solution for delivering dynamic data as an XML API, specifically designed for client-side rendering with XSLT. It intelligently connects to a MySQL database to fetch a random selection of product records, then meticulously transforms this data into a standardized XML format. The resulting XML is served via a public webhook, complete with an embedded reference to an XSLT stylesheet.
A key innovation of this workflow is its ability to self-host the XSLT stylesheet through a separate, dedicated webhook endpoint. This crucial feature effectively resolves common Cross-Origin Resource Sharing (CORS) challenges, ensuring that client browsers can consistently access and apply the styling transformation to the XML data. It's an ideal choice for dynamic product catalogs, data feeds, or any custom integration requiring robust XML data exposure with client-side XSLT presentation.
Key Features
- Dynamic Data Retrieval: Connects to your MySQL database to fetch a random selection of 16 product records with a simple, configurable SQL query.
- Automated XML Generation: Converts your structured database output into a well-formed XML document, ready for web consumption or system integration.
- Client-Side XSLT Integration: Automatically embeds a reference to an XSLT stylesheet within the generated XML, enabling browsers to apply styling and transform the data visually.
- CORS-Compliant XSLT Hosting: Features a dedicated webhook to self-host the XSLT stylesheet, ensuring seamless access and bypassing cross-origin restrictions for browser-based rendering.
- Custom API Endpoint: Provides a public webhook URL to serve your dynamic product data, acting as a flexible and customizable API.
How To Use
- Configure MySQL Credentials: Ensure your
Show 16 random productsnode is correctly configured with credentials (db4free MySQLin this example) to connect to your product database. - Adjust Product Query (Optional): Modify the SQL query in the
Show 16 random productsnode if you need different data, a specific selection, or more/fewer products. - Update XSLT Source (Optional): If your XSLT stylesheet is hosted elsewhere, update the URL in the
Get XSLTHTTP Request node. For self-hosting, ensure the XSLT file is accessible via a public URL like a GitHub Gist. - Customize XML Structure (Optional): Adjust the
Define file structureSet node to map your database fields to the desired XML element names (e.g.,productCodetoProduct.Code). - Activate Workflow: Once configured and saved, activate the workflow. It will expose two public webhook URLs: one for the dynamic XML data and another for the XSLT stylesheet.
- Access Data: Open the main webhook URL (e.g.,
{{ $env.WEBHOOK_URL }}webhook/81115579-ca32-496f-baa7-f14fb3baec6f) in your browser to see the XML content with the applied XSLT styling.
Apps Used
Workflow JSON
{
"id": "ef9e5d5f-9819-4fcf-a09b-f44ee5f5a86b",
"name": "Dynamic XML Product Feed with XSLT for Browser Rendering",
"nodes": 24,
"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: ef9e5d5f-9819...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
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.