list of posible values for a tag content

Discussion in 'XML' started by Sergei, Nov 19, 2005.

  1. Sergei

    Sergei Guest

    Hello everybody,
    I need to validate an XML document with a DTD file.
    The problem is that <lang> tag is empty some times, (but it should
    contain ENG,RUS,SPA...)
    which causes en error later in the program. How can I catch this with
    DTD validation ?
    Is there a way to specify a list of posible values for a tag content ?
    Or it only can be done for attributes ?
    Any suggestions are greatly appreciated.
    --Sergei
    Sergei, Nov 19, 2005
    #1
    1. Advertising

  2. Sergei

    Peter Flynn Guest

    Sergei wrote:

    > Hello everybody,
    > I need to validate an XML document with a DTD file.


    See http://xml.silmaril.ie/authors/parsers/

    > The problem is that <lang> tag


    Element. See http://xml.silmaril.ie/authors/makeup/

    > is empty some times, (but it should
    > contain ENG,RUS,SPA...)
    > which causes en error later in the program. How can I catch this with
    > DTD validation ?


    Is this your own DTD that you have written
    or someone else's that you have been given?

    > Is there a way to specify a list of posible values for a tag content ?


    No. Not with a DTD. If you need to check element content you can write
    an XSLT program that will do this. Or use a Schema.

    > Or it only can be done for attributes ?


    Correct.

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Nov 20, 2005
    #2
    1. Advertising

  3. Sergei

    Sergei Guest

    Thanks a lot!
    That really helps!
    -- Sergei
    Sergei, Nov 25, 2005
    #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. shruds
    Replies:
    1
    Views:
    778
    John C. Bollinger
    Jan 27, 2006
  2. koli
    Replies:
    0
    Views:
    332
  3. jose luis fernandez diaz
    Replies:
    7
    Views:
    20,204
    Rob Williscroft
    Apr 21, 2004
  4. RC
    Replies:
    1
    Views:
    396
    Mark Holland
    Mar 21, 2007
  5. Sergio E.
    Replies:
    2
    Views:
    391
    Sergio E.
    Jul 25, 2007
Loading...

Share This Page