How to define a "blacklist" schema type?

Discussion in 'XML' started by Peter Wang, May 15, 2007.

  1. Peter Wang

    Peter Wang Guest

    Hi all,
    I want to write a schema file to validate my xml file, and
    encounter a problem as follow.
    the xml file contains a <path> node£¬whose value should be a string not
    included by a blanklist(for instance, {"/bin", "/root", "/usr"}), how
    to define a "blanklist" type use simpleType to
    implement this, or any other advices?
    Thanks !!
     
    Peter Wang, May 15, 2007
    #1
    1. Advertising

  2. Enumeration won't do it, since you want to enumerate the forbidden
    values. You might be able to get this via regular expressions... or it
    might make more sense to just check it in the application rather than in
    the schema. Given your examples, I suspect that this may actually wind
    up wanting to be decided on a per-installation or per-user basis, which
    would be another reason to keep it in the application rather than the
    schema.

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, May 15, 2007
    #2
    1. Advertising

  3. Peter Wang

    Peter Wang Guest

    On 5ÔÂ15ÈÕ, ÏÂÎç8ʱ25·Ö, Joe Kesselman <> wrote:
    > Enumeration won't do it, since you want to enumerate the forbidden
    > values. You might be able to get this via regular expressions... or it
    > might make more sense to just check it in the application rather than in
    > the schema. Given your examples, I suspect that this may actually wind
    > up wanting to be decided on a per-installation or per-user basis, which
    > would be another reason to keep it in the application rather than the
    > schema.
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    thanks for your reply.
    Using regular expressions to describe such a "blacklist" is too hard.
    Actually, I use an xml as the configure file of my application,
    the configuration validation and the configuration loading are
    seprated,
    so i must do the restriction at the stage of configuration validation.
     
    Peter Wang, May 15, 2007
    #3
  4. Peter Wang wrote:
    > Using regular expressions to describe such a "blacklist" is too hard.


    The only alternative I can think of is application code. I'd love to be
    wrong about that. Good luck...

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, May 15, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,664
    Markus
    Nov 23, 2005
  2. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,329
    Stanimir Stamenkov
    Apr 25, 2005
  3. Yevgen Muntyan

    #define ALLOCIT(Type) ((Type*) malloc (sizeof (Type)))

    Yevgen Muntyan, Feb 9, 2007, in forum: C Programming
    Replies:
    10
    Views:
    944
    Yevgen Muntyan
    Feb 13, 2007
  4. Kenneth Stephen
    Replies:
    1
    Views:
    396
  5. Mike

    Net::Blacklist::Client use?

    Mike, Mar 18, 2008, in forum: Perl Misc
    Replies:
    2
    Views:
    149
    J. Gleixner
    Mar 18, 2008
Loading...

Share This Page