Author: Michael J. Babcock, MCP
Posted: 2004-04-01 10:52:14 Link
Here we go again!! Argh...
<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
<Record>
<Notes>
<ManagerName>Tom Jones</ManagerName>
<ManagerPhone>555-1212</ManagerPhone>
<TownNumber>0100</TownNumber>
<DeptNumber>105</DeptNumber>
<AltLogo>No</AltLogo>
<DirectLine>570.385.7600</DirectLine>
<ShipVia>Next Day Air Saver</ShipVia>
</Notes>
</Record>
Here's the error:
http://mbsoftwaresolutions.com/images/xmlerror.JPG
Everything seems to have a closing tag, yet it doesn't like the
DirectLine for some reason. Perhaps someone can see what I am not???
Many TIA!
--
Michael J. Babcock, MCP
President/CSA, MB Software Solutions, LLC
http://mbsoftwaresolutions.com
"Bettering your bottom line by helping you work smarter, not harder,
with custom software solutions."
Author: Derek J. Kalweit
Posted: 2004-04-01 10:57:07 Link
> Here we go again!! Argh...
> <DirectLine>570.385.7600</DirectLine>
> Here's the error:
> http://mbsoftwaresolutions.com/images/xmlerror.JPG
>
> Everything seems to have a closing tag, yet it doesn't like the
> DirectLine for some reason. Perhaps someone can see what I am not???
It looks like VFP might be trying to interpret the DirectLine value as a numeric, and it's choking on two decimal points.
--
Derek
Author: Michael J. Babcock
Posted: 2004-04-01 11:19:16 Link
Derek J. Kalweit wrote:
>>Here we go again!! Argh...
>
>
>><DirectLine>570.385.7600</DirectLine>
>
>
>>Here's the error:
>>http://mbsoftwaresolutions.com/images/xmlerror.JPG
>>
>>Everything seems to have a closing tag, yet it doesn't like the
>>DirectLine for some reason. Perhaps someone can see what I am not???
>
>
> It looks like VFP might be trying to interpret the DirectLine value as a numeric, and it's choking on two decimal points.
>
>
Looks like you're right...I'll mandate the dashes instead of the
periods....thanks a million, Derek!
--
Michael J. Babcock, MCP
President/CSA, MB Software Solutions, LLC
http://mbsoftwaresolutions.com
"Bettering your bottom line by helping you work smarter, not harder,
with custom software solutions."
On Apr 1, 2004, at 11:19 AM, Michael J. Babcock wrote:
> Looks like you're right...I'll mandate the dashes instead of the
> periods....thanks a million, Derek!
If this is an interactive form, don't "mandate" anything to your
users. It is trivial to substitute dashes for the periods in code.
I really hate websites that have stuff like "Enter your credit card
number. DO NOT USE SPACES OR DASHES - digits only". That tells me that
the person who coded that site doesn't even know how to strip out
non-numeric characters before processing, and makes me wonder what
other junk they've written in the programming.
___/
/
__/
/
____/
Ed Leafe
Linux Love:
unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
Author: Steve the Cook
Posted: 2004-04-01 11:32:27 Link
Cotton Mr Jerry P wrote:
> AMEN!
>
> Just like enter your phone number format xxx-xxx-xxxx
>
> But the worst one, Enter your City, State and Zip Code. Don't those
> idiots know how to look up zip codes?
>
Why do that?
Bad Steve!
Stephen Russell
S.R. & Associates
Memphis TN 38115
901.246-0159
"When a man assumes a public trust, he should consider himself as
public property." - Thomas Jefferson, 1807
Author: Cotton Mr Jerry P
Posted: 2004-04-01 11:34:11 Link
AMEN!
Just like enter your phone number format xxx-xxx-xxxx
But the worst one, Enter your City, State and Zip Code. Don't those idiots
know how to look up zip codes?
SET RANT OFF
Jerry Cotton, MCP
2nd Marine Aircraft Wing
Management Training and Assistance Team
Cherry Point, NC 28533
(252)466-4854
mailto:cottonjp.ctr@2mawcp.usmc.mil
Some people spend a lifetime wondering if they made a difference.
MARINES don't have that problem!
> -----Original Message-----
> From: Ed Leafe [mailto:ed@leafe.com]
> Sent: Thursday, April 01, 2004 11:24 AM
> To: ProFox Email List
> Subject: Re: What's wrong with this XML that VFP barfs?
>
> On Apr 1, 2004, at 11:19 AM, Michael J. Babcock wrote:
>
> > Looks like you're right...I'll mandate the dashes instead of the
> > periods....thanks a million, Derek!
>
> If this is an interactive form, don't "mandate"
> anything to your users. It is trivial to substitute dashes
> for the periods in code.
>
> I really hate websites that have stuff like "Enter your
> credit card number. DO NOT USE SPACES OR DASHES - digits
> only". That tells me that the person who coded that site
> doesn't even know how to strip out non-numeric characters
> before processing, and makes me wonder what other junk
> they've written in the programming.
>
> ___/
> /
> __/
> /
> ____/
> Ed Leafe
>
> Linux Love:
> unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
>
>
[excessive quoting removed by server]
Author: Derek J. Kalweit
Posted: 2004-04-01 11:35:13 Link
> But the worst one, Enter your City, State and Zip Code.
> Don't those idiots know how to look up zip codes?
Typically, adding a zip code is a confirmation of the city/state, and vice versa. I'm surprised that people would get so pissed at this...
--
Derek
Author: Derek J. Kalweit
Posted: 2004-04-01 11:39:01 Link
> >><DirectLine>570.385.7600</DirectLine>
> >>Here's the error:
> >>http://mbsoftwaresolutions.com/images/xmlerror.JPG
> >>
> >>Everything seems to have a closing tag, yet it doesn't like the
> >>DirectLine for some reason. Perhaps someone can see what I
> am not???
> > It looks like VFP might be trying to interpret the
> DirectLine value as a numeric, and it's choking on two decimal points.
> Looks like you're right...I'll mandate the dashes instead of the
> periods....thanks a million, Derek!
I would report it as a bug to Microsoft, as well. VFP should be smart enough to know that a 'number' with two decimals is actually a string-- the data type matching code should be easy enough to change to 'must be ONLY ONE decimal point'...
If you were using an XSD schema, I believe this would have worked as it should. I've never used an XSD schema with XMLTOCURSOR(), but I believe it's possible... I really don't use XMLTOCURSOR() that much, as I rarely have XML data that simple...
--
Derek
Author: Stuart Dunkeld
Posted: 2004-04-01 11:47:16 Link
> I would report it as a bug to Microsoft, as well. VFP should
> be smart enough to know that a 'number' with two decimals is
> actually a string-- the data type matching code should be
> easy enough to change to 'must be ONLY ONE decimal point'...
This would mean VFP would have to parse the whole data set before determining the datatypes just in case the final record has two periods in one string. Bound to be a performance hit from that.
> If you were using an XSD schema, I believe this would have
> worked as it should. I've never used an XSD schema with
> XMLTOCURSOR(), but I believe it's possible... I really don't
> use XMLTOCURSOR() that much, as I rarely have XML data that simple...
Without a schema, how can VFP be expected to *know* what field types you require? It has to guess, and sometimes it will get it wrong. It's a simple matter to generate a schema (inline or external
depending on requirements) and then you never need to worry about fieldtypes again.
Stuart
[excessive quoting removed by server]
Author: Derek J. Kalweit
Posted: 2004-04-01 11:51:14 Link
> > I would report it as a bug to Microsoft, as well. VFP should
> > be smart enough to know that a 'number' with two decimals is
> > actually a string-- the data type matching code should be
> > easy enough to change to 'must be ONLY ONE decimal point'...
> This would mean VFP would have to parse the whole data set
> before determining the datatypes just in case the final
> record has two periods in one string. Bound to be a
> performance hit from that.
VFP already does this. Read the docs on XMLTOCURSOR(). How else does it figure out what datatype to make the new field? It obviously has to do content-inspection already, and for content length reasons, it must examine ALL of the content before transfering any of it...
> > If you were using an XSD schema, I believe this would have
> > worked as it should. I've never used an XSD schema with
> > XMLTOCURSOR(), but I believe it's possible... I really don't
> > use XMLTOCURSOR() that much, as I rarely have XML data that
> simple...
> Without a schema, how can VFP be expected to *know* what
> field types you require? It has to guess, and sometimes it
> will get it wrong. It's a simple matter to generate a schema
> (inline or external
> depending on requirements) and then you never need to worry
> about fieldtypes again.
A schema is always better, but the 'guessing' code can still be improved, it appears. Quite honestly, requiring a schema for an XML dataset that's already simple enough to work with XMLTOCURSOR() in the first place, is quite unreasonable, IMO...
--
Derek