Hi All,
I am trying to get the attribute value from 100's of xml files using below code..
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0" xmlns:saxon="http://sf.net/saxon" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="saxon xs">
<xsl:output indent="yes" method="html" encoding="UTF-8" />
<xsl:strip-space elements="*" />
<xsl:template match="/">
<html>
<body>
<ol>
<xsl:for-each select="//fileref/@href">
<xsl:variable name="file" select="concat('../input.files/',.)" />
<xsl:message>Processing ...<xsl:value-of select="." /></xsl:message>
<xsl:for-each select="document($file)/distinct-values(//trans-unit/@id)">
<xsl:sort order="ascending" select="." />
<li>
<xsl:value-of select="." />
</li>
</xsl:for-each>
</xsl:for-each>
</ol>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Open in new window
However, I am not getting any results.
Can you please suggest what's gone wrong here?
Thanks,
Shail
but it is very hard to comment on this... and it is really easy for you to debug
1. first test the outer loop
Open in new window
So then you know whether the source XML file already gives you the correct file urls
(you have not added the source XML so I can't test that myself)