What am I doing wrong? ("Debug" XML code help please.)

Discussion in 'XML' started by Asfand Yar Qazi, Sep 20, 2003.

  1. Hi,

    xmllint --valid gives error output on some code (included below:)

    file "Shotgun_Robot.dtd" (don't ask)

    <!ELEMENT Image (#PCDATA) > <!-- #PCDATA == image path -->

    <!-- x/y values default to 0, w/h values default to image w/h-->
    <!ATTLIST Image
    srcrect_x CDATA #IMPLIED
    srcrect_y CDATA #IMPLIED
    srcrect_w CDATA #IMPLIED
    srcrect_h CDATA #IMPLIED
    >


    <!-- If element content is empty, the Drawable name points to an
    already created Drawable. If it is not empty, it defines a
    Drawable of the name and type given. -->
    <!ELEMENT Drawable (EMPTY|Image|Mup)
    >


    <!ATTLIST Drawable
    name CDATA #REQUIRED
    >


    <!ELEMENT Mup (Drawable)* >


    file "image_test.xml"

    <?xml version="1.0"?>

    <!DOCTYPE root SYSTEM "Shotgun_Robot.dtd" [
    <!ELEMENT root ANY>
    ]>

    <root>

    <Drawable name="mup1">
    <Mup>
    <Drawable name="t43a">
    <Image>images/sprites/tank_ClassicTrackT43A.png</Image>
    </Drawable>
    <Drawable name="t43a" />
    <Drawable name="mup1" />
    </Mup>
    </Drawable>

    </root>


    error output:

    image_test.xml:14: validity error: Element Drawable content does not
    follow the DTD
    Expecting (EMPTY | Image | Mup), got
    <Drawable name="t43a" />
    ^
    image_test.xml:15: validity error: Element Drawable content does not
    follow the DTD
    Expecting (EMPTY | Image | Mup), got
    <Drawable name="mup1" />
    ^
    <?xml version="1.0"?>
    <!DOCTYPE root SYSTEM "Shotgun_Robot.dtd" [
    <!ELEMENT root ANY>
    ]>
    <root>

    <Drawable name="mup1">
    <Mup>
    <Drawable name="t43a">
    <Image>images/sprites/tank_ClassicTrackT43A.png</Image>
    </Drawable>
    <Drawable name="t43a"/>
    <Drawable name="mup1"/>
    </Mup>
    </Drawable>

    </root>


    Wha??

    Thanks,
    Asfand Yar



    --


    http://www.it-is-truth.org/
    Asfand Yar Qazi, Sep 20, 2003
    #1
    1. Advertising

  2. In article <bkhr6s$1l1$>,
    Asfand Yar Qazi <im_not_giving_it_here@i_hate_spam.com> wrote:

    % <!-- If element content is empty, the Drawable name points to an
    % already created Drawable. If it is not empty, it defines a
    % Drawable of the name and type given. -->
    % <!ELEMENT Drawable (EMPTY|Image|Mup)
    % >


    This says that Drawable takes one of three elements as content:
    EMPTY, Image, or Mup. What you want is

    <!ELEMENT Drawable (Image|Mup)?
    >


    This says that the content is zero or one of either Image or Mup.
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Sep 22, 2003
    #2
    1. Advertising

  3. Patrick TJ McPhee wrote:
    > In article <bkhr6s$1l1$>,
    > Asfand Yar Qazi <im_not_giving_it_here@i_hate_spam.com> wrote:
    >
    > % <!-- If element content is empty, the Drawable name points to an
    > % already created Drawable. If it is not empty, it defines a
    > % Drawable of the name and type given. -->
    > % <!ELEMENT Drawable (EMPTY|Image|Mup)
    > % >
    >
    >
    > This says that Drawable takes one of three elements as content:
    > EMPTY, Image, or Mup. What you want is
    >
    > <!ELEMENT Drawable (Image|Mup)?
    > >

    >
    > This says that the content is zero or one of either Image or Mup.


    (Sorry for the late reply...)

    Ohh... now I see...

    Thanks.

    --


    http://www.it-is-truth.org/
    Asfand Yar Qazi, Sep 26, 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. Miguel Dias Moura
    Replies:
    4
    Views:
    3,288
    Miguel Dias Moura
    Jun 23, 2004
  2. intrader
    Replies:
    1
    Views:
    467
    intrader
    Feb 6, 2006
  3. xeys_00
    Replies:
    6
    Views:
    421
    xeys_00
    Apr 10, 2005
  4. What-a-Tool
    Replies:
    4
    Views:
    587
    What-a-Tool
    Jul 2, 2004
  5. SirG
    Replies:
    17
    Views:
    203
Loading...

Share This Page