I should be more specific. I write several apps that comm. with
witango and my data via webservices we have written in witango. I
have a set of methods to clean the xml before giving to witango in
basic.
generally, before handing to witango, I make sure three things happen.
1. no namespaces if possible.
2. covert the text encoding to iso-8859-1
(sometimes this can be done in the xml transformation, by adding
encoding="iso-8859-1" in the output method, but some xsl
implemenations only support utf-8. FORTUNATELY, witango's xsl allows
change of encoding this way, which is great, cuz it is the only way I
know of changing encoding in witango)
3. Change the declaration from UTF-8 to ISO if you had to convert
encoding manually, or remove the declaration altogher, cuz as far as
I can tell, witango just ignores the declaration.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Nov 2, 2005, at 1:12 PM, Robert Garcia wrote:
We have been working on a lot of methods to deal with some of
witangos quirks with xml. Here is a xsl I use to clean before
bringing in to witango.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/|comment()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</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>
This will strip the namespaces. Also, you should always change the
encoding of the xml to iso-8859-1, because witango always assumes
that.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On Nov 2, 2005, at 11:18 AM, Brian Humes wrote:
Thanks Ben.
I stripped out the namespace reference and all is well now.
Thanks for the help.
Brian
_____________________________________
On Nov 2, 2005, at 2:03 PM, Ben Johansen wrote:
Hi, I ran into this earlier. See thread "RE: Witango-Talk:
XPATH ??????" on
Witango-talk
Phil answered that it was a name space issue but I guess he
didn't get that
the issue was not using xpath, the issue is the @DOM fails
I have attached a test taf
There are 2 options
http://127.0.0.1/dom_namespace_test.taf?strip=yes
this options uses <@replace to strip the namespace elements
or
http://127.0.0.1/dom_namespace_test.taf?strip=no
this option just shoves the return xml into the <@dom with striping
namespace info
I have first saw this on server version 5.5.003 and just tested
it on
5.5.009 and still same problem.
Ben Johansen
-----Original Message-----
From: Brian Humes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 02, 2005 7:05 AM
To: Witango Talk
Subject: Witango-Talk: XML parse error
Hi all,
I'm getting an error message when I try to parse some XML from the
National Weather Service. This used to work just fine, but now it
doesn't for some reason. Here is the code in my .taf:
<@assign name="request$weather" value="<@url location='http://
www.nws.noaa.gov/data/current_obs/KBEH.xml'>">
<@assign name="request$weatherDom" value="<@DOM VALUE='@@request
$weather'>">
and here is the error I get:
File: portal.taf
Position: get_weather
Class: Internal
Main Error Number: -902
An error occurred while parsing the XML.
Element 'two_day_history_url' is not valid for content model:
'((credit,credit_URL,image,suggested_pickup,suggested_pickup_period,
loca
tion,station_id,latitude,longitude,elevation,observation_time,observ
atio
n_time_rfc822,weather,temperature_string,temp_f,temp_c,relative_humi
dity
,wind_string,wind_dir,wind_degrees,wind_mph,wind_gust_mph,pressure_s
trin
g,pressure_mb,pressure_in,dewpoint_string,dewpoint_f,dewpoint_c,heat
_ind
ex_string,heat_index_f,heat_index_c,windchill_string,windchill_f,win
dchi
ll_c,visibility_mi,icon_url_base,icon_name,two_day_history_url,icon_
url_
base,icon_url_name,ob_url,disclaimer_url,copyright_url),privacy_poli
cy_u
rl)'
I'm no XML expert, but the XML seems to be well-formed. Is this a
namespace issue?
As always, thanks!
Brian Humes
JohnsonRauhoff
_________________________________________
---
[This E-mail scanned for viruses by Declude Virus]
____________________________________________________________________
____
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
____________________________________________________________________
____
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
<DOM_Namespace_test.taf>
---
[This E-mail scanned for viruses by Declude Virus]
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf