You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Cindy Ballreich <ci...@ballreich.net> on 2001/02/22 05:51:30 UTC
WML and the FP taglib
I'm wondering if anyone can point me to any examples that use the FP taglib
to handle input from WML. I'm trying to do something similar to the "Simple
Form Handling" example that comes with Cocoon - changing a value in the
parent XML file from an input field of a form. I can get the data from the
parent XML file and build valid WML tags. The problem is that I can't
submit the data.
I've included some of the significant parts of my files. (I can supply more
if necessary.)
Here is a fragment of the type of WML I'm building with XSL...
<p>
quantity:
<input format="*N" name="quant" title="Set Quantity" value="12"/>
</p>
<p>
<anchor>
Save Changes
<go href="wml-edit.xml" method="post">
<postfield name="quantVal" value="$(quant:noesc)"/>
</go>
</anchor>
</p>
Here is the part of my "wml-edit.xml" that covers the appropriate tags.
(Everything else in the file seems to work. I can access and get values
from the original XML database with no problem.)...
<input name="quant" format="*N" title="Set Quantity">
<xsp:attribute name="value">
<fp:read select="quantity" from="external-item"/>
</xsp:attribute>
</input>
<go href="wml-edit.xml" method="post">
<postfield name="quantVal" value="$(quant)">
<fp:if-post>
<fp:write to="external-item" select="quantity">
<request:get-parameter name="quantity"/>
</fp:write>
</fp:if-post>
</postfield>
</go>
Here are the XSL templates that build the WML tags for the input card...
<xsl:template match="input">
<p>
quantity:
<input>
<xsl:call-template name="copy-form-attributes"/>
<xsl:attribute name="value">
<xsl:value-of select="number(@value)"/>
</xsl:attribute>
</input>
</p>
</xsl:template>
<xsl:template match="go">
<p>
<anchor>
Save Changes
<go>
<xsl:call-template name="copy-form-attributes"/>
<xsl:apply-templates select="//postfield"/>
</go>
</anchor>
</p>
</xsl:template>
<xsl:template match="postfield">
<postfield >
<xsl:call-template name="copy-form-attributes"/>
</postfield >
</xsl:template>
I'm using the Nokia WAP Toolkit 2.0 to emulate a WAP browser.
Unfortunately, verbose error reporting is not one of it's strong points.
When I try to save the input value it gives the following error...
MIME type "text/html" is not supported
(http://localhost/cocoon/servlets/catalog/wml-edit.xml)
...This error usually means that there's a syntax problem somewhere, but it
can also mean that the server is returning HTML instead of WAP. Everything
else is coming up as valid WAP, so I think the user agent is ok. I'm not
sure what the problem could be. I'd really appreciate it if some one could
take a look at this code and let me know where I'm screwing things up.
Thanks!
Cindy
Re: WML and the FP taglib
Posted by Irmund Thum <th...@web.de>.
Cindy Ballreich schrieb:
>
> I'm using the Nokia WAP Toolkit 2.0 to emulate a WAP browser.
> Unfortunately, verbose error reporting is not one of it's strong points.
> When I try to save the input value it gives the following error...
>
> MIME type "text/html" is not supported
> (http://localhost/cocoon/servlets/catalog/wml-edit.xml)
>
> ...This error usually means that there's a syntax problem somewhere, but it
> can also mean that the server is returning HTML instead of WAP. Everything
> else is coming up as valid WAP, so I think the user agent is ok. I'm not
> sure what the problem could be. I'd really appreciate it if some one could
> take a look at this code and let me know where I'm screwing things up.
>
> Thanks!
>
> Cindy
from my experience with WAP it's only this Nokia WAP toolkit producing
this errore message;
"MIME type "text/html" is not supported" means you cant produce
text/html - it doesnt work for Nokia;
must be wml;
just test the same with the various other toolkits (Ericsson, Siemens)
out there...
-- http://it97.dyn.dhs.org --
Irmund Thum
+49 179 6998564
+49 6374 992541
Re: WML and the FP taglib - SOLVED
Posted by Cindy Ballreich <ci...@ballreich.net>.
Irmund,
Yes, I've had the experience of getting that error for all kinds of reasons
with the Nokia Toolkit. But in this case it *was* the Cocoon error page
causing the toolkit error. (I confirmed this with the Up.Simulator.)
If you are interested, I found a solution to my problem:
I found that I was able to use an extra postfield tag as the "hidden" input
tag. I also found that the get-parameter name was wrong (it needs to be the
same as the postfield that sends the new value). Once I made these changes
all the errors stopped and I'm now able to change the value in my external
XML file.
I still have some WML issues, but at least the FP issues are working.
Thanks again!
Cindy
At 09:10 PM 2/22/01 +0100, Irmund Thum wrote:
>Cindy Ballreich wrote
>>
>> I have a little more info about this problem...
>> It turns out that the "text/html" being reported by my emulator was a
>> Cocoon error page. The primary error listed is
>
>you shouldn't be too sure that conclusions.
>I was working with WAP environments for 12snap.com
>and remember very good the
>"MIME type "text/html" is not supported"
>by the Nokia toolkit; the same worked in a Motorola WAP handy (toolkit)
>and others - try it.
>i.t
>
>-- http://it97.dyn.dhs.org --
> Irmund Thum
>+49 179 6998564
>+49 6374 992541
>Attachment Converted: "c:\eudora\attach\smime.p7s"
>
Re: WML and the FP taglib
Posted by Irmund Thum <th...@web.de>.
Cindy Ballreich wrote
>
> I have a little more info about this problem...
> It turns out that the "text/html" being reported by my emulator was a
> Cocoon error page. The primary error listed is
you shouldn't be too sure that conclusions.
I was working with WAP environments for 12snap.com
and remember very good the
"MIME type "text/html" is not supported"
by the Nokia toolkit; the same worked in a Motorola WAP handy (toolkit)
and others - try it.
i.t
-- http://it97.dyn.dhs.org --
Irmund Thum
+49 179 6998564
+49 6374 992541
Re: WML and the FP taglib
Posted by Cindy Ballreich <ci...@ballreich.net>.
I have a little more info about this problem...
It turns out that the "text/html" being reported by my emulator was a
Cocoon error page. The primary error listed is
"org.apache.xalan.xslt.XSLProcessorException: Warning: can't out put text
before document element! Ignoring..."
The tomcat window displays about 800 lines of error messages. (Apparently
this was happening all along and I never noticed it until this morning.)
Most of it is generic Java error stuff (listing all the classes), but there
are several groups of FP specific errors...
fp error-message: (init) No nodes match the given XPath expression
fp error-node-type: 1age
<java.lang.NullPointerException and a bunch of java errors>
fp error-node-type: unkown XPath expression error on:@name : null
<java.lang.NullPointerException and a bunch of java errors>
fp error-node-type: unkown No nodes match the given XPath expression:@name
fp error-message: (init) No nodes match the given XPath expression
fp error-node-type: 1age
<java.lang.NullPointerException and a bunch of java errors>
This pattern repeats listing all of the nodes that wml-edit.xml is supposed
to find in the external XML file.
Here's my take on what's going on:
In the "Simple Form Handling" example it appears that a hidden input tag is
being used to point the posted data back to the external XML file. I think
my problem stems from the lack of a mechanism like this in the WML. (I did
a test where I removed the data for the hidden tag from the XML in the
"Simple Form Handling" example and got identical results and errors.) So my
question remains, has anyone done this with WML and can you point me to an
example of how you did it?
Thanks again!
(and sorry for not providing all the info in the first post)
Cindy
At 08:51 PM 2/21/01 -0800, Cindy Ballreich wrote:
>I'm wondering if anyone can point me to any examples that use the FP taglib
>to handle input from WML. I'm trying to do something similar to the "Simple
>Form Handling" example that comes with Cocoon - changing a value in the
>parent XML file from an input field of a form. I can get the data from the
>parent XML file and build valid WML tags. The problem is that I can't
>submit the data.
>
>I've included some of the significant parts of my files. (I can supply more
>if necessary.)
>
>Here is a fragment of the type of WML I'm building with XSL...
>
><p>
> quantity:
> <input format="*N" name="quant" title="Set Quantity" value="12"/>
></p>
><p>
> <anchor>
> Save Changes
> <go href="wml-edit.xml" method="post">
> <postfield name="quantVal" value="$(quant:noesc)"/>
> </go>
> </anchor>
></p>
>
>Here is the part of my "wml-edit.xml" that covers the appropriate tags.
>(Everything else in the file seems to work. I can access and get values
>from the original XML database with no problem.)...
>
><input name="quant" format="*N" title="Set Quantity">
> <xsp:attribute name="value">
> <fp:read select="quantity" from="external-item"/>
> </xsp:attribute>
></input>
><go href="wml-edit.xml" method="post">
> <postfield name="quantVal" value="$(quant)">
> <fp:if-post>
> <fp:write to="external-item" select="quantity">
> <request:get-parameter name="quantity"/>
> </fp:write>
> </fp:if-post>
> </postfield>
></go>
>
>Here are the XSL templates that build the WML tags for the input card...
>
><xsl:template match="input">
> <p>
> quantity:
> <input>
> <xsl:call-template name="copy-form-attributes"/>
> <xsl:attribute name="value">
> <xsl:value-of select="number(@value)"/>
> </xsl:attribute>
> </input>
> </p>
></xsl:template>
><xsl:template match="go">
> <p>
> <anchor>
> Save Changes
> <go>
> <xsl:call-template name="copy-form-attributes"/>
> <xsl:apply-templates select="//postfield"/>
> </go>
> </anchor>
> </p>
></xsl:template>
><xsl:template match="postfield">
> <postfield >
> <xsl:call-template name="copy-form-attributes"/>
> </postfield >
></xsl:template>
>
>I'm using the Nokia WAP Toolkit 2.0 to emulate a WAP browser.
>Unfortunately, verbose error reporting is not one of it's strong points.
>When I try to save the input value it gives the following error...
>
>MIME type "text/html" is not supported
>(http://localhost/cocoon/servlets/catalog/wml-edit.xml)
>
>...This error usually means that there's a syntax problem somewhere, but it
>can also mean that the server is returning HTML instead of WAP. Everything
>else is coming up as valid WAP, so I think the user agent is ok. I'm not
>sure what the problem could be. I'd really appreciate it if some one could
>take a look at this code and let me know where I'm screwing things up.
>
>Thanks!
>
>Cindy
>
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>