R
Rob Cox
Hi (xsl novice here),
I have a file called myResources.xml that contains some strings that
will be localized.
In myXSL.xsl file, I read the strings from here to output as html.
myXSL.xsl is saved as UTF16.
myResources.xml is currently saved as ASCII.
Things work fine now.
But...when I change myResources.xml and save it as UTF16 (and put the
proper header <?xml version="1.0" encoding="UTF-16"?> at the top),
then things don't work any more.
The html that is generated is missing the strings that were supposed
to be substituted from myResources.xml.
It worked as ascii, but when I saved/switched myResources.xml to
UTF16, the substitutions stopped working.
myXSL.xsl is doing something like this:
<stuff deleted>
<xsl:variable name="translationsFile" select="concat($webRoot,
'/xsl/','myResources.xml')"/>
<xsl:variable name="translations"
select="document($translationsFile)"/>
<xsl
aram name="isolang" select="'en'"/>
<xsl:variable name="reportTitleText">
<xsl:choose>
<xsl:when test="count($translations/LocalizedResources/resource[lang($isolang)]/displayText[@category='REPORT_TITLE'])
> 0">
<xsl:copy-of select="$translations/LocalizedResources/resource[lang($isolang)]/displayText[@category='REPORT_TITLE']"/>
</xsl:when>
<xsl
therwise>
<xsl:text>My Default Report String</xsl:text>
</xsl
therwise>
</xsl:choose>
</xsl:variable>
--------------
myResources.xml snippet below
<resource xml:lang="en">
<!-- Resources for viewing a report -->
<displayText category="REPORT_TITLE">Final Report</displayText>
etc.
I have a file called myResources.xml that contains some strings that
will be localized.
In myXSL.xsl file, I read the strings from here to output as html.
myXSL.xsl is saved as UTF16.
myResources.xml is currently saved as ASCII.
Things work fine now.
But...when I change myResources.xml and save it as UTF16 (and put the
proper header <?xml version="1.0" encoding="UTF-16"?> at the top),
then things don't work any more.
The html that is generated is missing the strings that were supposed
to be substituted from myResources.xml.
It worked as ascii, but when I saved/switched myResources.xml to
UTF16, the substitutions stopped working.
myXSL.xsl is doing something like this:
<stuff deleted>
<xsl:variable name="translationsFile" select="concat($webRoot,
'/xsl/','myResources.xml')"/>
<xsl:variable name="translations"
select="document($translationsFile)"/>
<xsl
<xsl:variable name="reportTitleText">
<xsl:choose>
<xsl:when test="count($translations/LocalizedResources/resource[lang($isolang)]/displayText[@category='REPORT_TITLE'])
> 0">
<xsl:copy-of select="$translations/LocalizedResources/resource[lang($isolang)]/displayText[@category='REPORT_TITLE']"/>
</xsl:when>
<xsl
<xsl:text>My Default Report String</xsl:text>
</xsl
</xsl:choose>
</xsl:variable>
--------------
myResources.xml snippet below
<resource xml:lang="en">
<!-- Resources for viewing a report -->
<displayText category="REPORT_TITLE">Final Report</displayText>
etc.