cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anouk Udressy" <udn...@hotmail.com>
Subject Re: Problem with Cocoon and namespace
Date Fri, 22 Sep 2000 13:55:08 GMT
Hi,

Thanks for your answer.
I have try to use the userAgent but I don't see anything. Wich parameter
must I append exactly if I use a wap browser (?user-agent="???") ?

I don't use XSP.

The result generated by cocoon is the following. As you can see, this code
could not be viewed with a wap browser if I don't remove the xmlns:*** tags.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:lng="http://bigfoot.com/~audresssy/languages/1.0"
xmlns:lnk="http://bigfoot.com/~audresssy/links/1.0"
xmlns:trl="http://bigfoot.com/~audresssy/translations/1.0"><card
id="card1"
title="Info trafic"><p>Informations sur le trafic routier<table
align="LCC" columns="2"><tr><td>Rue</td><td>Taux
d&apos;occupation</td></tr><tr><td>Test 4</td><td>
   ok
  </td></tr></table></p></card></wml>

<!-- This page was served in 1160 milliseconds by Cocoon 1.7.4 -->

If it can help you to better understant my problem, you will find the code
source join with this message.

regards,

Anouk

-XSL File -------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet  version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:lng="http://bigfoot.com/~audresssy/languages/1.0"
xmlns:lnk="http://bigfoot.com/~audresssy/links/1.0"
      xmlns:trl="http://bigfoot.com/~audresssy/translations/1.0">

<xsl:param name="lang"/>
<!--<xsl:variable name="lang">fr</xsl:variable>-->

<xsl:template match="result/links | result/languages"/>
<xsl:template match="result/translations/trl:date"/>
<xsl:template match="result/translations/trl:page/trl:page_translation"/>
<xsl:template match="result/points"/>
<xsl:template match="/">

<xsl:processing-instruction
name="cocoon-format">type="text/wml"</xsl:processing-instruction>

<wml>
<card id="card1" title="Info trafic">
 <p>
<xsl:value-of
select="/result/translations/trl:page/trl:page_translation[@xml:lang=$lang]/
trl:h1"/>
<table columns="2" align="LCC">
  <tr>
<td><xsl:value-of
select="/result/translations/trl:page/trl:page_translation[@xml:lang=$lang]/
trl:head_col1"/></td>
    <td><xsl:value-of
select="/result/translations/trl:page/trl:page_translation[@xml:lang=$lang]/
trl:head_col2"/></td>
  </tr>
<xsl:for-each select="/result/points/point" >
  <tr>
    <td><xsl:value-of select="val_ref/nom"/></td>
    <td>
 <xsl:variable name="taux_occ">
  <xsl:value-of select="val_vol/taux_occ"/>
 </xsl:variable>
 <xsl:variable name="ref_occ_fluide">
  <xsl:value-of select="val_ref/ref_occ_fluide"/>
 </xsl:variable>
 <xsl:variable name="ref_occ_sature">
  <xsl:value-of select="val_ref/ref_occ_sature"/>
 </xsl:variable>
 <xsl:choose>
  <xsl:when test="$taux_occ &lt; $ref_occ_fluide">
   ok
  </xsl:when>
  <xsl:when test="$taux_occ &gt; $ref_occ_sature">
   ko
  </xsl:when>
    <xsl:otherwise>
       boaf
     </xsl:otherwise>
  </xsl:choose>
  </td>
  </tr>
</xsl:for-each>
</table>
</p>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>
------------------------------------------

-XML File ------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="result2.xsl" type="text/xsl"?>
<?xml-stylesheet href="result_wap.xsl" type="text/xsl" media="wap"?>
<?cocoon-process type="xslt"?>
<result xmlns:lng="http://bigfoot.com/~audresssy/languages/1.0"
xmlns:lnk="http://bigfoot.com/~audresssy/links/1.0"
xmlns:trl="http://bigfoot.com/~audresssy/translations/1.0">
 <!-- <!DOCTYPE lng:languages SYSTEM "languages.dtd"> -->
 <languages xmlns:lng="http://bigfoot.com/~audresssy/languages/1.0">
  <lng:language xml:lang="fr">
   <lng:description>Francais</lng:description>
   <lng:icon>french.png</lng:icon>
  </lng:language>
  <lng:language xml:lang="en">
   <lng:description>English</lng:description>
   <lng:icon>english.png</lng:icon>
  </lng:language>
 </languages>
 <!-- <!DOCTYPE lnk:links SYSTEM "links.dtd"> -->
 <links xmlns:lnk="http://bigfoot.com/~audresssy/links/1.0">
  <lnk:link display="text" name="index" type="HTML">
   <lnk:translation xml:lang="fr">
    <lnk:url> http://index.htm</lnk:url>
    <lnk:description>Acceuil</lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url> http://index.html</lnk:url>
    <lnk:description>Index</lnk:description>
   </lnk:translation>
  </lnk:link>
  <lnk:link display="text" name="new_query" type="HTML">
   <lnk:translation xml:lang="fr">
    <lnk:url>information_sur_le_trafic_routier.htm</lnk:url>
    <lnk:description>Nouvelle requête</lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url>information_sur_le_trafic_routier.htm</lnk:url>
    <lnk:description>New query</lnk:description>
   </lnk:translation>
  </lnk:link>
  <lnk:link display="text" name="map" type="HTML">
   <lnk:translation xml:lang="fr">
    <lnk:url>plan.htm</lnk:url>
    <lnk:description>Carte de la ville</lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url>plan.htm</lnk:url>
    <lnk:description>Map</lnk:description>
   </lnk:translation>
  </lnk:link>
  <lnk:link display="text" name="stop" type="HTML">
   <lnk:translation xml:lang="fr">
    <lnk:url>bouchons.htm</lnk:url>
    <lnk:description>Les bouchons en un clin d&apos;oeil</lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url>bouchons.htm</lnk:url>
    <lnk:description>Stop</lnk:description>
   </lnk:translation>
  </lnk:link>
  <lnk:link display="text" name="info" type="HTML">
   <lnk:translation xml:lang="fr">
    <lnk:url>javascript:displayInfo()</lnk:url>
    <lnk:description>Informations sur la méthode</lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url>javascript:displayInfo()</lnk:url>
    <lnk:description>Info</lnk:description>
   </lnk:translation>
  </lnk:link>
  <lnk:link display="text" name="wap" type="XML">
   <lnk:translation xml:lang="fr">
    <lnk:url> http://trafic.wml</lnk:url>
    <lnk:description>Cette page peut également être accessible par un
terminal wap par le biais de l&apos;adresse : </lnk:description>
   </lnk:translation>
   <lnk:translation xml:lang="en">
    <lnk:url> http://trafic.wml</lnk:url>
    <lnk:description>This page... </lnk:description>
   </lnk:translation>
  </lnk:link>
 </links>
 <!-- <!DOCTYPE translations SYSTEM "result_trans.dtd">-->
 <translations xmlns:trl="http://bigfoot.com/~audresssy/translations/1.0">
  <trl:date>04.08.00 10:36:00</trl:date>
  <trl:page file_name="result" type="HTML">
   <trl:link name="index">true</trl:link>
   <trl:link name="new_query">true</trl:link>
   <trl:link name="map">true</trl:link>
   <trl:link name="stop">true</trl:link>
   <trl:link name="info">true</trl:link>
   <trl:link name="wap">false</trl:link>
   <trl:page_translation xml:lang="fr">
    <trl:title>Informations sur le trafic routier</trl:title>
    <trl:h1>Informations sur le trafic routier</trl:h1>
    <trl:data_info>Données du </trl:data_info>
    <trl:intro/>
    <trl:head_col1>Rue</trl:head_col1>
    <trl:head_col2>Taux d&apos;occupation</trl:head_col2>
    <trl:head_col3>Nb de vehicule par heure</trl:head_col3>
    <trl:head_col4>Tendance</trl:head_col4>
    <trl:increase>Augmentation</trl:increase>
    <trl:diminution>Diminution</trl:diminution>
    <trl:stable>Stable</trl:stable>
    <trl:finally/>
   </trl:page_translation>
  </trl:page>
 </translations>
 <points>
  <date_cnt>14.09.2000 10:05:21</date_cnt>
  <ville>Gland</ville>
  <point id="4">
   <val_vol>
    <taux_cnt>0</taux_cnt>
    <taux_occ>21</taux_occ>
    <nb_vehic>124</nb_vehic>
    <tendance>1</tendance>
    <alpha_min>0</alpha_min>
    <alpha_max>0</alpha_max>
   </val_vol>
   <val_ref>
    <nom>Test 4</nom>
    <nom_court>Test4</nom_court>
    <ref_cnt_fluide>43</ref_cnt_fluide>
    <ref_cnt_sature>86</ref_cnt_sature>
    <ref_occ_fluide>33</ref_occ_fluide>
    <ref_occ_sature>66</ref_occ_sature>
    <alpha_min_ref>0.27482765607130577</alpha_min_ref>
    <alpha_max_ref>0.5496553121426115</alpha_max_ref>
    <ref_plan>
     <zone>ab</zone>
     <x>18</x>
     <y>34</y>
    </ref_plan>
   </val_ref>
  </point>
 </points>
</result>

------------------------------------------





***********************


----- Original Message -----
From: "Robin Green" <greenrd@hotmail.com>
To: <cocoon-users@xml.apache.org>
Cc: <anouk.udressy@bigfoot.com>
Sent: Wednesday, September 20, 2000 12:02 AM
Subject: Re: Problem with Cocoon and namespace


> "Anouk Udressy" <udnana@freesurf.ch> wrote:
> >I would like to use Cocoon for transform XML file to WML and display the
> >result with the Nokia Developpement toolkit.
> >My problem is the following :
> >When I use namespaces in my XSL file*, the Nokia developpement toolkit
> >display the following error :
> >"Attribute is not declared".
>
> Just that? Any more details?
>
> Try faking the user agent on IE or Netscape, as described in the FAQ. You
> might get a better error message then.
>
> >Then, I can modifiy the source directly in the
> >NDK, I remove all the name space** and it's work !
>
> >** like this II :
> ><wml xmlns:fo="http://www.w3.org/1999/XSL/Format"
> >       xmlns:lng="http://toto.com/languages/1.0"
> >       xmlns:lnk="http://toto.com/links/1.0"
> >       xmlns:trl="http://toto.com/translations/1.0">
> >become
> ><wml>
>
> What, you mean <wml> on its own works?
>
> Do you use XSP? I have a hunch it's an XSP problem.
>
> >
> >If I remove the namespace directly in the XSL file, the Nokia
Developpement
> >toolkit display the following error : "MIME type text/html is not
> >supported".
>
> You need cocoon-format, but again I suggest you fake the user agent - it
is
> alot easier to find out what is going wrong.
>
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>



Mime
View raw message