One format to rule them all.
Transform XML task definitions into executable API workflows across multiple platforms and languages.
XML-Replay is a sophisticated transformation system that converts declarative XML task definitions into executable code for various platforms. Define your HTTP workflows once in XML, then generate Bruno collections, Postman collections, cURL scripts, Python code, JavaScript modules, PowerShell scripts, and comprehensive Markdown documentation.
# Clone and navigate to the project
git clone <repository-url>
cd XML-Replay
# Run the interactive demo
.\demo.ps1 -Demo
# Transform a single XML file to all formats
.\scripts\Transform-All.ps1
# Transform single file to specific format
.\scripts\Transform-Single.ps1 "examples\user-login.xml" bruno
- W3C XSLT 1.0 Compliance: Standards-based transformation with cross-platform compatibility
- Native XML Processing: Direct XPath navigation and template matching
- High Performance: Compiled XSLT stylesheets with .NET XslCompiledTransform
- Zero Dependencies: Pure XSLT implementation requiring no external libraries
- Bruno โ
.bru
API client files with authentication and environment support - Postman โ
.json
collections with tests and documentation - cURL โ
.sh
shell scripts for command-line HTTP testing - JavaScript โ
.js
Node.js modules with async/await and error handling - Python โ
.py
scripts using the requests library with exception management - PowerShell โ
.ps1
scripts with CmdletBinding and enterprise integration - Markdown โ
.md
comprehensive documentation with examples and security notes
- Hierarchical Tasks: Nested task definitions with inheritance
- Parameter System: Typed parameters with validation and defaults
- Authentication: Multiple auth methods (Basic, Bearer, API Key, Custom Headers)
- Data Extraction: XPath-based response parsing and variable binding
- Error Handling: Comprehensive error scenarios and retry logic
- Cleanup Operations: Automatic resource cleanup and state management
- Batch Processing: Transform multiple XML files simultaneously
- Organized Output: Automatic directory structure and file management
- Progress Reporting: Detailed transformation status and error reporting
- Module System: Reusable PowerShell functions and utilities
XML-Replay/
โโโ ๐ README.md # This comprehensive guide
โโโ ๐ docs/ # Detailed documentation
โ โโโ README.md # Getting started guide
โ โโโ schema-reference.md # Complete XML schema documentation
โ โโโ best-practices.md # Development guidelines and patterns
โ โโโ usage-guide.md # Step-by-step usage examples
โโโ โ๏ธ scripts/ # PowerShell automation scripts
โ โโโ Transform-All.ps1 # Batch transformation utility
โ โโโ Transform-Single.ps1 # Single file transformation
โ โโโ modules/
โ โโโ TransformXML.psm1 # Core transformation module
โโโ ๐ฏ templates/ # XSLT transformation stylesheets
โ โโโ bruno.xsl # Bruno API client generator
โ โโโ curl.xsl # cURL command generator
โ โโโ javascript.xsl # Node.js script generator
โ โโโ markdown.xsl # Documentation generator
โ โโโ postman.xsl # Postman collection generator
โ โโโ powershell.xsl # PowerShell script generator
โ โโโ python.xsl # Python script generator
โ โโโ archive/ # Archived Handlebars templates
โโโ ๐ examples/ # Sample XML definitions and demos
โ โโโ user-login.xml # Simple authentication workflow
โ โโโ shopping-cart-add.xml # E-commerce cart operations
โ โโโ shopping-cart-checkout.xml # Purchase completion workflow
โ โโโ complete-shopping-workflow.xml # Complex orchestrated tasks
โ โโโ user-login-interactive.html # Live HTML demonstration
โโโ ๐ schema/ # XML Schema definitions
โ โโโ task-definition.xsd # Complete task validation schema
โโโ ๐ซ output/ # Generated files (git-ignored)
โโโ ๐ฎ demo.ps1 # Interactive project explorer
- Getting Started - Installation, setup, and first steps
- Schema Reference - Complete XML schema documentation
- Usage Guide - Step-by-step transformation examples
- Best Practices - Development patterns and guidelines
- XSLT Templates - Stylesheet documentation and customization
- XML Examples - Sample task definitions for various scenarios
- PowerShell Scripts - Automation utilities and batch processing
- Windows PowerShell 5.1+ or PowerShell Core 6.0+
- .NET Framework 4.5+ (for XSLT processing)
- Git (for cloning the repository)
# Clone the repository
git clone <repository-url>
cd XML-Replay
# Verify installation with the demo
.\demo.ps1 -Structure
# Test with sample transformation
.\scripts\Transform-Single.ps1 "examples\user-login.xml" bruno
After installation, you should see output files generated in the output/
directory:
output/
โโโ user-login/
โโโ user-login.bru # Bruno API client
โโโ user-login.sh # cURL commands
โโโ user-login.js # JavaScript module
โโโ user-login.md # Markdown documentation
โโโ user-login.json # Postman collection
โโโ user-login.ps1 # PowerShell script
โโโ user-login.py # Python script
# Transform one XML file to a specific format
.\scripts\Transform-Single.ps1 -XmlFile "examples\user-login.xml" -Format "bruno"
# Transform to PowerShell with custom output file
.\scripts\Transform-Single.ps1 -XmlFile "examples\user-login.xml" -Format "powershell" -OutputFile "C:\MyOutput\login.ps1"
# Transform all XML files in the examples directory to all formats
.\scripts\Transform-All.ps1
# Transform with verbose output
.\scripts\Transform-All.ps1 -Verbose
# Open the interactive HTML demo
.\demo.ps1 -Demo
# Show all available XML examples
.\demo.ps1 -Examples
# Show all XSLT templates
.\demo.ps1 -Templates
# Display project structure
.\demo.ps1 -Structure
# Import the transformation module
Import-Module .\scripts\modules\TransformXML.psm1
# Transform using the module directly
Invoke-XSLTTransform -XmlPath "examples\user-login.xml" -XslPath "templates\bruno.xsl" -OutputPath "output\test.bru"
Create custom transformation templates by extending the existing XSLT stylesheets:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8" indent="no"/>
<xsl:template match="/task-definition">
<!-- Your custom transformation logic -->
</xsl:template>
</xsl:stylesheet>
# Load the transformation module in your scripts
Import-Module .\scripts\modules\TransformXML.psm1
# Use transformation functions
$result = Invoke-XSLTTransform -XmlPath $xmlFile -XslPath $template -OutputPath $output
if ($result.Success) {
Write-Host "โ
Transformation completed successfully"
} else {
Write-Host "โ Transformation failed: $($result.Error)"
}
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes: Follow the coding standards and add tests
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing XSLT 1.0 standards for template development
- Add comprehensive XML examples for new features
- Update documentation for any schema changes
- Test transformations across all supported output formats
- Maintain PowerShell best practices for automation scripts
Current system capabilities:
- 7 Output Formats: Bruno, cURL, JavaScript, Markdown, Postman, PowerShell, Python
- 100% Success Rate: All transformations working correctly
- XSLT 1.0 Compliance: Full W3C standards compatibility
- Cross-Platform: Works on Windows, macOS, and Linux with PowerShell Core
- OpenAPI Generator: YAML specification generation from XML definitions
- JMeter Integration: Performance testing plan generation
- Docker Support: Containerized transformation processing
- REST API: Web service for remote transformations
- Visual Studio Code Extension: Integrated development experience
- Insomnia Collections: Alternative to Postman for API testing
- Newman Scripts: Automated Postman collection runners
- Terraform Modules: Infrastructure as Code integration
- GitHub Actions: CI/CD workflow generation
This project is licensed under the MIT License - see the LICENSE file for details.
- W3C XSLT Specification for the transformation standards
- PowerShell Team for the excellent scripting platform
- Bruno, Postman, and cURL for inspiring the output formats
- Open Source Community for continuous feedback and contributions
- Documentation: Check the
docs/
directory for comprehensive guides - Examples: Explore the
examples/
directory for sample implementations - Issues: Report bugs and request features via GitHub Issues
- Discussions: Join the community discussions for help and best practices
Ready to transform your API workflows? Start with .\demo.ps1 -Demo
and explore the interactive features!