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="translati onsFile" select="concat( $webRoot,
'/xsl/','myResources. xml')"/>
<xsl:variable name="translati ons"
select="documen t($translations File)"/>
<xsl:param name="isolang" select="'en'"/>
<xsl:variable name="reportTit leText">
<xsl:choose>
<xsl:when test="count($tr anslations/LocalizedResour ces/resource[lang($isolang)]/displayText[@category='REPO RT_TITLE'])
> 0">
<xsl:copy-of select="$transl ations/LocalizedResour ces/resource[lang($isolang)]/displayText[@category='REPO RT_TITLE']"/>
</xsl:when>
<xsl:otherwis e>
<xsl:text>My Default Report String</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
--------------
myResources.xml snippet below
<resource xml:lang="en">
<!-- Resources for viewing a report -->
<displayText category="REPOR T_TITLE">Final Report</displayText>
etc.
-----------
Thanks for any suggestions.
Rob Cox
rob_cox@dell.co m
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="translati onsFile" select="concat( $webRoot,
'/xsl/','myResources. xml')"/>
<xsl:variable name="translati ons"
select="documen t($translations File)"/>
<xsl:param name="isolang" select="'en'"/>
<xsl:variable name="reportTit leText">
<xsl:choose>
<xsl:when test="count($tr anslations/LocalizedResour ces/resource[lang($isolang)]/displayText[@category='REPO RT_TITLE'])
> 0">
<xsl:copy-of select="$transl ations/LocalizedResour ces/resource[lang($isolang)]/displayText[@category='REPO RT_TITLE']"/>
</xsl:when>
<xsl:otherwis e>
<xsl:text>My Default Report String</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
--------------
myResources.xml snippet below
<resource xml:lang="en">
<!-- Resources for viewing a report -->
<displayText category="REPOR T_TITLE">Final Report</displayText>
etc.
-----------
Thanks for any suggestions.
Rob Cox
rob_cox@dell.co m
Comment