Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to define a "blacklist" schema type?

Reply
Thread Tools

How to define a "blacklist" schema type?

 
 
Peter Wang
Guest
Posts: n/a
 
      05-15-2007
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 !!

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      05-15-2007
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
 
Reply With Quote
 
 
 
 
Peter Wang
Guest
Posts: n/a
 
      05-15-2007
On 5月15日, 下午8时25分, Joe Kesselman <(E-Mail Removed)> 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.

 
Reply With Quote
 
Joseph Kesselman
Guest
Posts: n/a
 
      05-15-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
About typedef -- define the function pointer or define function model? robin liu C Programming 3 04-21-2006 03:26 PM
#define _ and #define __ Brian Takita Ruby 0 01-23-2006 04:34 AM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
How to define a define that defines some defines ? theotyflos C Programming 3 02-19-2004 05:07 PM



Advertisments