ISO-8859-1 format - InfoPath Dev
in

InfoPath Dev

ISO-8859-1 format

Last post 11-24-2005 02:00 AM by Coita Thierry. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 11-22-2005 03:07 AM

    • frala
    • Not Ranked
    • Joined on 11-09-2005
    • France
    • Posts 16

    ISO-8859-1 format

    Hi,

    I would like to encode the saved XML document using the ISO-8859-1 encoding.
    How can I do that ?

    Thanks for your help.

    Franck
  • 11-22-2005 05:08 AM In reply to

    Salut,

    Simply make a XSL transformation or put in a string and make a replace.

    Or select the root node and add your xml déclaration at the beginning

    If you use .Net in the XMLdocument I believe that you can found a encoding method (I'm not sure)

    That depend on the case! Explain me more a little bit more!

    But infopath only accept UTF-8 encoding for his primary datasource!


    ++

    Thierry



    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-22-2005 06:17 AM In reply to

    • frala
    • Not Ranked
    • Joined on 11-09-2005
    • France
    • Posts 16
    The problem is that characters are UTF-8 encoded.
    For example, if the 'é' character is used, the XML contains
    Ã@ (which is the UTF-8 encoding for the 'é').
    Perhaps it is a problem of my xsl:fo stylesheet. Here is its header :
    <?xml version="1.0" encoding="UTF-8"?>
    and I set :
    <xsl:output method="xml" encoding="UTF-8"/>

    Any idea ?

    Franck
  • 11-22-2005 06:30 AM In reply to

    so do like that replace in your xsl

    <?xml version="1.0" encoding="UTF-8"?>

    <xsl:output method="xml" encoding="UTF-8"/>

    by

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <xsl:output method="xml" encoding="ISO-8859-1"/>

    If that don't work make a generic xsl transformation with this XSL:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
    <xsl:template match="/">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="*">
    <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
    <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
    </xsl:template>
    </xsl:stylesheet>


    ++

    Thierry

    P.S. Tu habites où en france?
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-22-2005 08:00 AM In reply to

    • frala
    • Not Ranked
    • Joined on 11-09-2005
    • France
    • Posts 16
    First, I had ISO-8859-1 encoding. As it doesn't work, I changed it to UTF-8.

    Using the generic XSL transformation, it doesn't work.

    Here is what I have to do (and it works) :

    <xsl:template name="parseUTF8">
    <xsl:param name="string"/>

    <xsl:choose>
    <xsl:when test="contains($string, '#194;#160;')">
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#194;#160;')"/></xsl:call-template>#160;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#194;#160;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#160;')">
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#160;')"/></xsl:call-template>#224;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#160;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#167;')">
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#167;')"/></xsl:call-template>#231;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#167;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#168;')">
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#168;')"/></xsl:call-template>#232;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#168;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#169;')">
    <xsl:variable name="line" select="substring-before($string, '#195;#169;')"/>
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#169;')"/></xsl:call-template>#233;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#169;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#170;')">
    <xsl:variable name="line" select="substring-before($string, '#195;#170;')"/>
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#170;')"/></xsl:call-template>#234;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#170;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#175;')">
    <xsl:variable name="line" select="substring-before($string, '#195;#175;')"/>
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#175;')"/></xsl:call-template>#239;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#175;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#180;')">
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#180;')"/></xsl:call-template>#244;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#180;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#185;')">
    <xsl:variable name="line" select="substring-before($string, '#195;#185;')"/>
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#185;')"/></xsl:call-template>#249;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#185;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($string, '#195;#187;')">
    <xsl:variable name="line" select="substring-before($string, '#195;#187;')"/>
    <xsl:call-template name="parseUTF8"><xsl:with-param name="string" select="substring-before($string, '#195;#187;')"/></xsl:call-template>#251;<xsl:call-template name="parseUTF8">
    <xsl:with-param name="string" select="substring-after($string, '#195;#187;')"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$string"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>



    What a wonderfull world !!!!! :-|

    Franck

    PS: j'habite dans la région parisienne, dans le 78
  • 11-22-2005 01:04 PM In reply to

    Il va falloir ouvrir une section support en français, tu en penses quoi Thierry?

    Franck (l'autre)....

    Regards,

    Franck Dauché
    InfoPathDev
  • 11-22-2005 01:19 PM In reply to

    • Ben
    • Top 500 Contributor
    • Joined on 11-17-2005
    • Germany
    • Posts 33
    Na toll einfach mal die Sprache wechseln ist auch keine Loesung :D
  • 11-22-2005 07:11 PM In reply to

    Warum ist es keine Loesung? :)

    Franck
  • 11-22-2005 10:53 PM In reply to

    Ok happy to see that you have solve your problem!

    But which processor or class do you use for make your transformation?

    I know that if you use xsltransform from the namespace system.xml.xsl the default encoding is UTF-16!

    So it's possible that this problem comes from the processor!

    ++

    Thierry

    P.S.Franck D. --> Oui effectivement ca pourrait être une bonne idée faudrait voir si on peux arranger ca avec les admins! En plus Patrick risque d'être content lui qui aime bien le français et les françaises ;-)
    En tout cas moi je suis motivé!
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 11-22-2005 11:14 PM In reply to

    • frala
    • Not Ranked
    • Joined on 11-09-2005
    • France
    • Posts 16
    I use the FOP library.

    Franck

    PS : et pourquoi ne pas ouvrir une section Francko-française !!! ;-)
  • 11-24-2005 02:00 AM In reply to

    quote:
    Originally posted by frala

    I use the FOP library.

    Franck

    PS : et pourquoi ne pas ouvrir une section Francko-française !!! ;-)



    Ok mais alors Francko-Suisse s'il vous plait! y faut pas m'oublié non plus;-)

    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.