You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Seth Bunke <sb...@miller.cs.uwm.edu> on 2001/07/24 22:35:50 UTC

XML to WML

I am having problems with trying to generate content dymanically
for wml and html browsers in a manner similar to that which is
included in the cocoon/samples/wap directory for Cocoon 1.
I believe that my Apache/Tomcat/Cocoon (Windows 98) setup and
configuration is correct because I am able to access
cocoon/wap/example-portfolio.xml properly with both IE and
Phone.com's UP.Simulator - all of the questions/answers
on the mailing list concerning this issue suggest to people
that there is probably something wrong with their
setup/configuration. While I am able to access my xml
document properly with IE, the simulator presents a
"Content-type Error" statement to the screen. When examining
the DOS window for the simulator it states that:

Uncompiled data from HTTP is 2590 bytes.
...found Content-Type: text/html
Content-Type: text/html is not handled by UP.Simulator.
No translator for content-type: text/html

I believe that this is the crux of my problem. My xml file
(test.xml) is located at webapps/cocoon/test/test.xml. I have attempted
to move it to within the cocoon/samples directory (along with
its corresponding xsl files), but this has not solved the problem.
I have included the contents of my xml and xsl files below.
I do not know anyone that is working with Cocoon and consequently
do not have any resources for advice or help on this matter.
Any information that you can provide me on dealing with this
problem will be greatly appreciated.

Thank you,
Seth Bunke

===============================================================
<!-- test.xml -->
<?xml version="1.0"?>
<?xml-stylesheet href="html.xsl" type="text/xsl"?>
<?xml-stylesheet href="wml.xsl" type="text/xsl" media="wap"?>
<?cocoon-process type="xslt"?>

<document>
	<string1>This is the html page</string1>
	<string2>This is the wml page</string2>
</document>
===============================================================
<!-- html.xsl -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="document">
		<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
		<html>
			<pre>This is just a test of the html written in
the xsl</pre>
			<xsl:value-of select="string1"/>
		</html>
	</xsl:template>
</xsl:stylesheet>
================================================================
<!-- wml.xsl -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="document">
		<xsl:processing-instruction
name="cocoon-format">type="text/wml"</xsl:processing-instruction>
		<wml>
			<card id="index" title="test wml">
				<p align="center">
					<a href="#card1">Card1</a><br/>
					<a href="#card2">Card2</a><br/>
				</p>
			</card>
			<card id="card1" title="Card 1">
				<p>this is just the text of Card1</p>
				<do type="prev" label="Back">
					<prev/>
				</do>
			</card>
			<card id="card2" title="Card 2">
				<p>this is just the text of Card2</p>
				<do type="prev" label="Back">
					<prev/>
				</do>
			</card>
		</wml>
	</xsl:template>
</xsl:stylesheet>


---------------------------------------------------------------------
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>


Re: XML to WML

Posted by Terry Paddy <te...@yahoo.com>.
Hi,

I hope your first line in each file is not a comment
(as in your code below). The first line must be the
XML declaration.

Remember if Cocoon finds an error, it will return an
error page in HTML (regardless of the media your
delivering too), so "Content-Type: text/html is not
handled by UP.Simulator"  is probably an error page
saying the the first line must be the XML declearation
:-)

I have run your code successfully (minus the opening
comment) on Cocoon 1.8.2 and the SmartPhone Emulator.

Hope this helps ...


=====
_______________________________________
Terry Paddy - Christchurch, New Zealand

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
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>


RE: XML to WML

Posted by Seth Bunke <sb...@miller.cs.uwm.edu>.
I appreciate your advice. It seems that I would always use IE
to check to make sure that Apache/Tomcat was up and running
properly and then attempt to access the XML document with
the simulator. Now just using the simulator works fine.
Apparently this is just one of those "quirks" that makes
programming "interesting" - and time consuming. So,
thank you very much. SB

On Tue, 24 Jul 2001, Paul Nock wrote:

> This sounds like something weird that happens to me with the UP simulator...
>
> Try exiting the UP simulator, starting it again and then accesing your page.
>
> I've found that there's some peculiar behavior that something somewhere
> 'remembers' the user-agent of the most recent request from this IP address.
> If you have IE and UP running at the same time, access page.xml with IE,
> _then_ access page.xml with UP, you get HTML sent to the user-agent.
>
> If you kill and restart UP after anytime you access page.xml from IE, then
> it'll come up fine in UP.
>
> Also, if you explicitly do a page.xml?user-Agent=UP in the request, I think
> it'll work OK too.
>
> Paul
>
> -----Original Message-----
> From: Seth Bunke [mailto:sbun9629@miller.cs.uwm.edu]
> Sent: Tuesday, July 24, 2001 1:36 PM
> To: cocoon-users@xml.apache.org
> Subject: XML to WML
>
>
> I am having problems with trying to generate content dymanically
> for wml and html browsers in a manner similar to that which is
> included in the cocoon/samples/wap directory for Cocoon 1.
> I believe that my Apache/Tomcat/Cocoon (Windows 98) setup and
> configuration is correct because I am able to access
> cocoon/wap/example-portfolio.xml properly with both IE and
> Phone.com's UP.Simulator - all of the questions/answers
> on the mailing list concerning this issue suggest to people
> that there is probably something wrong with their
> setup/configuration. While I am able to access my xml
> document properly with IE, the simulator presents a
> "Content-type Error" statement to the screen. When examining
> the DOS window for the simulator it states that:
>
> Uncompiled data from HTTP is 2590 bytes.
> ...found Content-Type: text/html
> Content-Type: text/html is not handled by UP.Simulator.
> No translator for content-type: text/html
>
> I believe that this is the crux of my problem. My xml file
> (test.xml) is located at webapps/cocoon/test/test.xml. I have attempted
> to move it to within the cocoon/samples directory (along with
> its corresponding xsl files), but this has not solved the problem.
> I have included the contents of my xml and xsl files below.
> I do not know anyone that is working with Cocoon and consequently
> do not have any resources for advice or help on this matter.
> Any information that you can provide me on dealing with this
> problem will be greatly appreciated.
>
> Thank you,
> Seth Bunke
>
> ===============================================================
> <!-- test.xml -->
> <?xml version="1.0"?>
> <?xml-stylesheet href="html.xsl" type="text/xsl"?>
> <?xml-stylesheet href="wml.xsl" type="text/xsl" media="wap"?>
> <?cocoon-process type="xslt"?>
>
> <document>
> 	<string1>This is the html page</string1>
> 	<string2>This is the wml page</string2>
> </document>
> ===============================================================
> <!-- html.xsl -->
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:template match="document">
> 		<xsl:processing-instruction
> name="cocoon-format">type="text/html"</xsl:processing-instruction>
> 		<html>
> 			<pre>This is just a test of the html written in
> the xsl</pre>
> 			<xsl:value-of select="string1"/>
> 		</html>
> 	</xsl:template>
> </xsl:stylesheet>
> ================================================================
> <!-- wml.xsl -->
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:template match="document">
> 		<xsl:processing-instruction
> name="cocoon-format">type="text/wml"</xsl:processing-instruction>
> 		<wml>
> 			<card id="index" title="test wml">
> 				<p align="center">
> 					<a href="#card1">Card1</a><br/>
> 					<a href="#card2">Card2</a><br/>
> 				</p>
> 			</card>
> 			<card id="card1" title="Card 1">
> 				<p>this is just the text of Card1</p>
> 				<do type="prev" label="Back">
> 					<prev/>
> 				</do>
> 			</card>
> 			<card id="card2" title="Card 2">
> 				<p>this is just the text of Card2</p>
> 				<do type="prev" label="Back">
> 					<prev/>
> 				</do>
> 			</card>
> 		</wml>
> 	</xsl:template>
> </xsl:stylesheet>
>
>
> ---------------------------------------------------------------------
> 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>
>
>
> ---------------------------------------------------------------------
> 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>
>
>


---------------------------------------------------------------------
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>


RE: XML to WML

Posted by Paul Nock <pn...@medicineplanet.com>.
This sounds like something weird that happens to me with the UP simulator...

Try exiting the UP simulator, starting it again and then accesing your page.

I've found that there's some peculiar behavior that something somewhere
'remembers' the user-agent of the most recent request from this IP address.
If you have IE and UP running at the same time, access page.xml with IE,
_then_ access page.xml with UP, you get HTML sent to the user-agent.

If you kill and restart UP after anytime you access page.xml from IE, then
it'll come up fine in UP.

Also, if you explicitly do a page.xml?user-Agent=UP in the request, I think
it'll work OK too.

Paul

-----Original Message-----
From: Seth Bunke [mailto:sbun9629@miller.cs.uwm.edu]
Sent: Tuesday, July 24, 2001 1:36 PM
To: cocoon-users@xml.apache.org
Subject: XML to WML


I am having problems with trying to generate content dymanically
for wml and html browsers in a manner similar to that which is
included in the cocoon/samples/wap directory for Cocoon 1.
I believe that my Apache/Tomcat/Cocoon (Windows 98) setup and
configuration is correct because I am able to access
cocoon/wap/example-portfolio.xml properly with both IE and
Phone.com's UP.Simulator - all of the questions/answers
on the mailing list concerning this issue suggest to people
that there is probably something wrong with their
setup/configuration. While I am able to access my xml
document properly with IE, the simulator presents a
"Content-type Error" statement to the screen. When examining
the DOS window for the simulator it states that:

Uncompiled data from HTTP is 2590 bytes.
...found Content-Type: text/html
Content-Type: text/html is not handled by UP.Simulator.
No translator for content-type: text/html

I believe that this is the crux of my problem. My xml file
(test.xml) is located at webapps/cocoon/test/test.xml. I have attempted
to move it to within the cocoon/samples directory (along with
its corresponding xsl files), but this has not solved the problem.
I have included the contents of my xml and xsl files below.
I do not know anyone that is working with Cocoon and consequently
do not have any resources for advice or help on this matter.
Any information that you can provide me on dealing with this
problem will be greatly appreciated.

Thank you,
Seth Bunke

===============================================================
<!-- test.xml -->
<?xml version="1.0"?>
<?xml-stylesheet href="html.xsl" type="text/xsl"?>
<?xml-stylesheet href="wml.xsl" type="text/xsl" media="wap"?>
<?cocoon-process type="xslt"?>

<document>
	<string1>This is the html page</string1>
	<string2>This is the wml page</string2>
</document>
===============================================================
<!-- html.xsl -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="document">
		<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
		<html>
			<pre>This is just a test of the html written in
the xsl</pre>
			<xsl:value-of select="string1"/>
		</html>
	</xsl:template>
</xsl:stylesheet>
================================================================
<!-- wml.xsl -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="document">
		<xsl:processing-instruction
name="cocoon-format">type="text/wml"</xsl:processing-instruction>
		<wml>
			<card id="index" title="test wml">
				<p align="center">
					<a href="#card1">Card1</a><br/>
					<a href="#card2">Card2</a><br/>
				</p>
			</card>
			<card id="card1" title="Card 1">
				<p>this is just the text of Card1</p>
				<do type="prev" label="Back">
					<prev/>
				</do>
			</card>
			<card id="card2" title="Card 2">
				<p>this is just the text of Card2</p>
				<do type="prev" label="Back">
					<prev/>
				</do>
			</card>
		</wml>
	</xsl:template>
</xsl:stylesheet>


---------------------------------------------------------------------
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>


---------------------------------------------------------------------
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>