I've created an XSLT using an identity template and several templates that match to a potential XPath in the source. However, the matching paths do not always exist. Is there a way to "insert" the path before the matching template applies? Since I know XSLT does not execute procedurally, I wasn't sure how to do this. Examples below.
Let's say this is the XSLT:
<xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:if> </xsl:template> <xsl:template match='pathA'> do stuff </xsl:template> <xsl:template match='pathB'> do something </xsl:template> <xsl:template match='pathC'> do other stuff </xsl:template> And let's say this in the input:
<root> <Child> <pathA>I have Data!</pathA> <pathC>We skipped B!</pathC> </Child> </root> Is there a way to "create" pathB so that the template that matches the XPath can execute?
Thanks again for any assistance!