I have an xml output file that I want to check that a directory exists:
<row_element column="6" property_name="TEST">file_name = sample.txt ~ parent_file = main.txt ~ root_directory = c:\main\sample</row_element>
<row_element column="6" property_name="TEST">file_name = sample2.txt ~ parent_file = main.txt ~ root_directory = c:\main\sample2</row_element>
I tried the code below, but noticed that the substring-before with the '~' does not seem to work due to the fact that my xml data does not end with a '~'. Is there another method to do this check or at least tweak this code to work?
<xsl:variable name="find_root" select="row_element[@property_name = 'TEST'"/>
<xsl:if test="(normalize-space(substring-before(substring-after($find_root/., 'file_name ='), '~')) = 'sample.txt') and (normalize-space(substring-before(substring-after($find_root/., 'parent_file ='), '~')) = 'main.txt') and (normalize-space(substring-before(substring-after($find_root/., 'root_directory ='), '~')) = 'c:\main\sample')">
<xsl:value-of select="'FOUND'"/>
</xsl:if>
Thanks in advance.