
Teaching Coding Agent to Write XSLT — The Hook in Action
Parts 1 and 2 explained the skill and the hook setup. This part shows it actually running — a real session, real prompts, real hook output. No theory. We'll build the same Order-to-Shipment transformation three ways — XSLT 1.0 with inline C#, XSLT 2.0 with Saxon, and LML compiled to XSLT 3.0 — and watch the hook verify each one, catch bugs, and drive Claude through a multi-step fix cycle. Everything below is from a single session. Step 1: XSLT 1.0 with inline C The prompt Create an XSLT 1.0 transformation (compatible with .NET XslCompiledTransform) that maps an Order to a Shipment. Use the existing Order.xml as input reference and target the ShipmentOutput.xsd schema. Requirements: - Map OrderID → ShipmentRef with a "SHP-" prefix (use inline C# via msxsl:script) - Map OrderDate → ShipDate, reformatted from yyyy-MM-dd to dd/MM/yyyy (inline C#) - Map CustomerName → Recipient - Generate an ExecutionDate using inline C# that returns DateTime.UtcNow - Loop over each Item → Line, mapping Pro
Continue reading on Dev.to
Opens in a new tab



