Loading ...
Sorry, an error occurred while loading the content.

XML

Expand Messages
  • Mihai Batranu
    Hello! I write in English because I m not Greek, I am Romanian and I have a problem, maybe you can help me. I use the xslt_process function to transform XML
    Message 1 of 5 , May 8, 2001
    • 0 Attachment
      Hello!
      I write in English because I'm not Greek, I am Romanian and I have a
      problem, maybe you can help me. I use the xslt_process function to
      transform XML code using XSL templates. The problem is that I want to
      obtain Greek characters. So I specify the encoding ISO-8859-7, but there
      still can't be seen any Greek character, in fact there's nothing to be
      seen because it appears an error... here's a little example:

      the file test.xml

      <?xml version="1.0" encoding="ISO-8859-7"?>
      <root>
      <text>????????????????????????????????</text>
      </root>

      the file test.xsl

      <?xml version="1.0" encoding="ISO-8859-7"?>
      <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output encoding="ISO-8859-7"/>
      <xsl:template match="root">
      <html>
      <head>
      <title>Greek</title>
      </head>
      <body>
      <xsl:value-of select="text"/>
      </body>
      </html>
      </xsl:template>
      </xsl:stylesheet>

      the file index.php

      <?
      $filename = "./test.xml";
      $fd = fopen ($filename, "r");
      $xmldata = fread ($fd, filesize ($filename));
      fclose ($fd);
      $filename = "./test.xsl";
      $fd = fopen ($filename, "r");
      $xsldata = fread ($fd, filesize ($filename));
      fclose ($fd);
      if(xslt_process($xsldata, $xmldata, $result))
      { echo $result; }
      else
      { echo "ERROR ".xslt_errno()." ".xslt_error(); }
      ?>

      As you can see, there's something very simple, a test... but it doesn't
      work :-(( Can you help me and tell where's the mistake?
      Thank you,
      Mihai

      --
      Homepage: http://moshu.edison.ro

      "Un vieux sphinx ignoré du monde insoucieux,
      Oublié sur la carte et dont l'humeur farouche
      Ne chante qu'aux rayons du soleil qui se couche."
      C.B.
    • Panayotis Vryonis
      I have not used xslt_process, but coult it be that you are not using iso-8859-7 encoded text but unicode ? If for example you are writing your text in a
      Message 2 of 5 , May 9, 2001
      • 0 Attachment
        I have not used xslt_process, but coult it be that you
        are not using iso-8859-7 encoded text but unicode ?
        If for example you are writing your text in a Microsoft
        Windows editor, this is highly possible.

        Just an idea.

        Panayotis.

        Mihai Batranu wrote:

        > Hello!
        > I write in English because I'm not Greek, I am Romanian and I have a
        > problem, maybe you can help me. I use the xslt_process function to
        > transform XML code using XSL templates. The problem is that I want to
        > obtain Greek characters. So I specify the encoding ISO-8859-7, but there
        > still can't be seen any Greek character, in fact there's nothing to be
        > seen because it appears an error... here's a little example:
        >
        > the file test.xml
        >
        > <?xml version="1.0" encoding="ISO-8859-7"?>
        > <root>
        > <text>????????????????????????????????</text>
        > </root>
        >
        > the file test.xsl
        >
        > <?xml version="1.0" encoding="ISO-8859-7"?>
        > <xsl:stylesheet version="1.0"
        > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        > <xsl:output encoding="ISO-8859-7"/>
        > <xsl:template match="root">
        > <html>
        > <head>
        > <title>Greek</title>
        > </head>
        > <body>
        > <xsl:value-of select="text"/>
        > </body>
        > </html>
        > </xsl:template>
        > </xsl:stylesheet>
        >
        > the file index.php
        >
        > <?
        > $filename = "./test.xml";
        > $fd = fopen ($filename, "r");
        > $xmldata = fread ($fd, filesize ($filename));
        > fclose ($fd);
        > $filename = "./test.xsl";
        > $fd = fopen ($filename, "r");
        > $xsldata = fread ($fd, filesize ($filename));
        > fclose ($fd);
        > if(xslt_process($xsldata, $xmldata, $result))
        > { echo $result; }
        > else
        > { echo "ERROR ".xslt_errno()." ".xslt_error(); }
        > ?>
        >
        > As you can see, there's something very simple, a test... but it doesn't
        > work :-(( Can you help me and tell where's the mistake?
        > Thank you,
        > Mihai



        --
        yassou.net: be there before you go!
        http://www.yassou.net/
      • Mihai Batranu
        ... Wow! I have changed the encoding, I tried with UTF-8 and it worked! I have Greel characters in my browser :-) Still there s a problem... I tried to enter
        Message 3 of 5 , May 9, 2001
        • 0 Attachment
          Panayotis Vryonis wrote:

          > I have not used xslt_process, but coult it be that you
          > are not using iso-8859-7 encoded text but unicode ?

          Wow! I have changed the encoding, I tried with UTF-8 and it worked! I
          have Greel characters in my browser :-) Still there's a problem... I
          tried to enter the text in a MySQL database but it appears that it
          doesn't work... And at the MySQL site it says the Unicode support has
          not been added yet :-((( Do you have any ideas?
          Anyway, thank you a lot for the solution! (Eyxaristo, maybe? :-)) ).
          Mihai

          --
          Homepage: http://moshu.edison.ro

          "Un vieux sphinx ignoré du monde insoucieux,
          Oublié sur la carte et dont l'humeur farouche
          Ne chante qu'aux rayons du soleil qui se couche."
          C.B.
        • Rouvas Stathis
          ... base64_encode the string you want and add the result to MySQL. Upon extracting, do base64_decode. ... Eyxaristo, it is! -Stathis.
          Message 4 of 5 , May 9, 2001
          • 0 Attachment
            Mihai Batranu wrote:
            >
            > Panayotis Vryonis wrote:
            >
            > > I have not used xslt_process, but coult it be that you
            > > are not using iso-8859-7 encoded text but unicode ?
            >
            > Wow! I have changed the encoding, I tried with UTF-8 and it worked! I
            > have Greel characters in my browser :-) Still there's a problem... I
            > tried to enter the text in a MySQL database but it appears that it
            > doesn't work... And at the MySQL site it says the Unicode support has
            > not been added yet :-((( Do you have any ideas?

            base64_encode the string you want and add the result to MySQL.
            Upon extracting, do base64_decode.

            > Anyway, thank you a lot for the solution! (Eyxaristo, maybe? :-)) ).
            > Mihai
            >

            Eyxaristo, it is!

            -Stathis.
          • Mihai Batranu
            ... Hey, this is great, it worked! Eyxaristo again :-)) I guess I ll stay more here, maybe I have other problems in the future with my project :-)) Mihai --
            Message 5 of 5 , May 9, 2001
            • 0 Attachment
              Rouvas Stathis wrote:

              > base64_encode the string you want and add the result to MySQL.
              > Upon extracting, do base64_decode.

              Hey, this is great, it worked! Eyxaristo again :-)) I guess I'll stay
              more here, maybe I have other problems in the future with my project :-))
              Mihai

              --
              Homepage: http://moshu.edison.ro

              "Un vieux sphinx ignore' du monde insoucieux,
              Oublie' sur la carte et dont l'humeur farouche
              Ne chante qu'aux rayons du soleil qui se couche."
              C.B.
            Your message has been successfully submitted and would be delivered to recipients shortly.