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,l oca tion,station_id,latitude,longitude,elevation,observation_time,observa tio n_time_rfc822,weather,temperature_string,temp_f,temp_c,relative_humid ity ,wind_string,wind_dir,wind_degrees,wind_mph,wind_gust_mph,pressure_st rin 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,wind chi ll_c,visibility_mi,icon_url_base,icon_name,two_day_history_url,icon_u rl_ base,icon_url_name,ob_url,disclaimer_url,copyright_url),privacy_polic y_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

Reply via email to