Saturday morning, 8:00 AM. Coffee in hand, Leo opened Udemy and stared into the abyss. "The Complete XSLT Course: From Zero to Hero" by a British instructor named Alistair Finch. 4.6 stars. 14,000 students. 18.5 hours of video. Leo's eye twitched. He’d been burned before by "complete" courses that spent three hours on "What is a variable?"
His job was to transform this beastly <ShipmentOrder> XML into a flat, friendly <OrderRecord> CSV for an ancient warehouse database. His tool? XSLT. He had a weekend to learn it. udemy xslt
<xsl:template match="hcl:ShipmentOrder"> <xsl:for-each select="hcl:Packages/hcl:Package"> <xsl:value-of select="../../hcl:OrderID"/>, <xsl:value-of select="hcl:TrackingNumber"/>, <xsl:for-each select="hcl:Items/hcl:Item"> <xsl:value-of select="hcl:SKU"/>, <xsl:value-of select="hcl:Qty"/> <xsl:if test="not(position()=last())">|</xsl:if> </xsl:for-each> <xsl:text> </xsl:text> </xsl:for-each> </xsl:template> He was mixing a little imperative (the for-each ) with the declarative, and he didn't care. It was his solution. Saturday morning, 8:00 AM
<xsl:template match="Name"> <FullName> <xsl:value-of select="."/> </FullName> </xsl:template> It worked. A tiny, perfect transformation. He felt a jolt of dopamine. He bought the "Advanced XSLT" course as a pre-order, just out of sheer optimism. Leo's eye twitched
He slapped his desk. he yelled. His cat, Loki, fell off the couch. Leo added a sticky note to his monitor: You are always somewhere. Know where.
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.