He fast-forwarded to the lecture. Alistair was holding a whiteboard marker. "Namespaces," he said, "are like the last name of an element. You wouldn't walk into a high school reunion and shout 'Michael!' You'd get twenty Michaels. You need the last name. In XSLT, you must bind the namespace to a prefix, then use the prefix." Leo added xmlns:hcl="urn:healthcare-logistics-45b" to his <xsl:stylesheet> tag. Then he changed his selects to hcl:ShipmentOrder . The data returned like a dam breaking. He had never felt such relief over angle brackets.
Alistair introduced the Identity Transform: a template that copies everything, letting you override only what you need.
Sunday, 9:00 PM. Leo ran his transformation. Saxon-HE (the XSLT processor Alistair had recommended) hummed. The output file appeared: output.csv . He opened it. udemy xslt
The client’s XML had a default namespace: xmlns="urn:healthcare-logistics-45b" . Leo had been ignoring it. Suddenly, his select="ShipmentOrder" returned nothing. Zero nodes. His perfect XPath was blind.
It was perfect. Columns aligned. SKUs concatenated with pipes. Even the empty shipments were correctly represented as blank rows. He fast-forwarded to the lecture
The first section was a revelation. Alistair didn't teach syntax. He taught philosophy. "Declarative thinking," he called it. "Don't tell the computer how to find the data. Tell it what you want, and let the template rules do the walking."
He uploaded the XSLT to the production mapper, ran a test with a real 500MB XML file, and watched it transform in 2.3 seconds. His boss, Sarah, pinged him on Slack. Sarah: "Did you get the XSLT working?" Leo: "Yeah. It's done." Sarah: "You learned XSLT in a weekend?" Leo: "I had a good instructor." He closed his laptop, looked at the sticky note on his monitor – You are always somewhere. Know where. – and smiled. He opened Udemy one last time. A notification popped up. You wouldn't walk into a high school reunion
Sunday morning. The final boss. He needed to generate a CSV header row, then loop through each ShipmentOrder , and for each Package , produce a line with OrderID, TrackingNumber, ItemSKU, Quantity . But some Package elements had no Item (empty shipments), and some had ten.