DTD: Choice: Non-Alphanumeric

Discussion in 'XML' started by Shozi, Jul 1, 2003.

  1. Shozi

    Shozi Guest

    Dear All,

    My project is basically about the personal record keeping of user's
    data. Now user can customize their data entry form by adding/removing
    the desired fields for personal information (e.g. Add: Home Phone Pin
    Code, Remove: Personal ID Card No). All this was being done in
    database and was working fine.

    Some one recommend me to use DTD/XML to automate this whole process in
    a standardized way. I started off while searching on the web and on
    different forums and found some good examples. But at one point, I am
    stuck at creating chioce in DTD?

    Let's assume that I have three choices for some attribute. I define
    them as under in my output DTD file,

    ---------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>

    <!ELEMENT choice_testing (#PCDATA)>
    <!ATTLIST choice_testing value (True | False | Unknown ) "Unknown" >
    ---------------------------------------------

    Every thing seems to be fine except one thing, if I enter any
    non-Alphanumeric character in the value of this choice.

    e.g. ( <!ATTLIST email_address_domain value (@yahoo.com | @hotmail.com
    | Unknown ) "@yahoo.com" > ).

    After this, the parser gave me a parsing error. I have checked the
    validity of DTD file with XML Spy 4.3 and its validator won't let me
    pass through and gave me an error message that "Wild card character
    found, cannot proceed". As this is some basic funcationlity of the
    project. Any Comments / suggestion / help ?

    Thanks in Advance

    Waiting for your reply,

    Best Regards,
    Shozi
    Shozi, Jul 1, 2003
    #1
    1. Advertising

  2. Shozi

    Bob Foster Guest

    Re: Choice: Non-Alphanumeric

    "Shozi" <> wrote in message
    news:...
    > Let's assume that I have three choices for some attribute. I define
    > them as under in my output DTD file,
    >
    > ---------------------------------------------
    > <?xml version="1.0" encoding="UTF-8"?>
    >
    > <!ELEMENT choice_testing (#PCDATA)>
    > <!ATTLIST choice_testing value (True | False | Unknown ) "Unknown" >
    > ---------------------------------------------
    >
    > Every thing seems to be fine except one thing, if I enter any
    > non-Alphanumeric character in the value of this choice.
    >
    > e.g. ( <!ATTLIST email_address_domain value (@yahoo.com | @hotmail.com
    > | Unknown ) "@yahoo.com" > ).
    >
    > After this, the parser gave me a parsing error. I have checked the
    > validity of DTD file with XML Spy 4.3 and its validator won't let me
    > pass through and gave me an error message that "Wild card character
    > found, cannot proceed". As this is some basic funcationlity of the
    > project. Any Comments / suggestion / help ?


    A DTD attribute enumeration value must be an NMTokens, one or more NameChar.
    This can be letters, digits, etc. but not '@'.

    If this is essential to your application, switch to XML Schema or RELAX NG,
    where you can use any simple type value. If you already have a lot of time
    invested in your DTD, download trang and use it to convert your DTD to one
    of the other schema types.

    Bob Foster
    Bob Foster, Jul 2, 2003
    #2
    1. Advertising

  3. Shozi

    Shozi Guest

    Re: Choice: Non-Alphanumeric

    Dear Bob,

    Thank you very much for your reply, I am very thankful for the answer.
    I already have implemented a logic. I just add Text variables and do
    the work. By adding variables in the choice and assign values of email
    domains to that variable. That solution is working fine.

    I am unable to invest more time in changing my logic to xml schema.

    Thank you once again.

    Best Regards,

    Shozi

    "Bob Foster" <> wrote in message news:<FJyMa.84709$R73.10000@sccrnsc04>...
    > "Shozi" <> wrote in message
    > news:...
    > > Let's assume that I have three choices for some attribute. I define
    > > them as under in my output DTD file,
    > >
    > > ---------------------------------------------
    > > <?xml version="1.0" encoding="UTF-8"?>
    > >
    > > <!ELEMENT choice_testing (#PCDATA)>
    > > <!ATTLIST choice_testing value (True | False | Unknown ) "Unknown" >
    > > ---------------------------------------------
    > >
    > > Every thing seems to be fine except one thing, if I enter any
    > > non-Alphanumeric character in the value of this choice.
    > >
    > > e.g. ( <!ATTLIST email_address_domain value (@yahoo.com | @hotmail.com
    > > | Unknown ) "@yahoo.com" > ).
    > >
    > > After this, the parser gave me a parsing error. I have checked the
    > > validity of DTD file with XML Spy 4.3 and its validator won't let me
    > > pass through and gave me an error message that "Wild card character
    > > found, cannot proceed". As this is some basic funcationlity of the
    > > project. Any Comments / suggestion / help ?

    >
    > A DTD attribute enumeration value must be an NMTokens, one or more NameChar.
    > This can be letters, digits, etc. but not '@'.
    >
    > If this is essential to your application, switch to XML Schema or RELAX NG,
    > where you can use any simple type value. If you already have a lot of time
    > invested in your DTD, download trang and use it to convert your DTD to one
    > of the other schema types.
    >
    > Bob Foster
    Shozi, Jul 3, 2003
    #3
    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. Mickey Segal
    Replies:
    0
    Views:
    867
    Mickey Segal
    Feb 2, 2004
  2. Steven J Sobol
    Replies:
    8
    Views:
    5,664
    Thomas Weidenfeller
    Apr 30, 2004
  3. joe

    remove non alphanumeric characters

    joe, Mar 2, 2007, in forum: C Programming
    Replies:
    5
    Views:
    835
  4. Yasin Cepeci
    Replies:
    1
    Views:
    920
    Juan T. Llibre
    Apr 26, 2007
  5. miles.jg
    Replies:
    16
    Views:
    866
    Alf P. Steinbach
    Nov 14, 2007
Loading...

Share This Page