Results 1 to 4 of 4

Thread: Re: Catution when using XML for Logic

  1. #1
    Join Date
    Mar 2005
    Posts
    163
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Catution when using XML for Logic

    The issue here is that you must always TRIM any values that you perfrom logic on, else you will obviously get an error


    e.g you XML might be
    <text>
    Default
    <text>

    And when you run your code you find out that

    If text = "Default" Then

    doesn't work.

    Its becuase the value of text might actually be "Default " (see the space)

  2. #2
    Join Date
    Oct 2005
    Posts
    256
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not a problem if you serialize and deserialize objects to xml . Remains very consistent then.

    Humans are the problem here!

    (yes i have actually done that before!)

  3. #3
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    This also occurs in other areas, one in particular is when reading a CHAR value from an MS SQL database and is something that I have seen cause many problems.

    In my opinion, however, this should be caught at the data validation point during entry and corrected before being written. In the case of the CHAR for SQL databases you know the field length and hence can work with that or use an RTRIM().

  4. #4
    Join Date
    Oct 2005
    Posts
    256
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah yes - dealt with that one today ironically. Some muppet put 2 character ISO country codes in one table with a CHAR(10) and the other with a CHAR(2) and of course did the joins work - nope!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Merge XML and XSL with ASP
    By Rappie in forum ASP (VBScript)
    Replies: 4
    Last Post: 27th June 2006, 11:57 PM
  2. XMl/XSLT/CSS Sitemap
    By jaimalchohan in forum XML
    Replies: 3
    Last Post: 28th February 2006, 10:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •