Parsing Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dana

    #1

    Parsing Error

    Hello. I'm new to XML and I have a question that looks to me like it
    should be easy to answer, but I have not found anything by searching
    google at all on this.

    We are using msxml.dll (Microsoft XML). The xml code that is getting
    the error is:

    <!ENTITY question.atts
    'id ID #IMPLIED
    diff NUMBER "50"
    discrim NUMBER "50"
    weight NUMBER "50"
    rand (yesrand | norand) "yesrand "
    mand (yesmand | nomand) "nomand"
    mustpass (yesmustpass | nomustpass) "nomustpass "
    partmarks (yespartmarks | nopartmarks) "nopartmark s"
    pool (exercise |
    quiz |
    mandatoryrand |
    modpretest |
    modposttest |
    courseposttest |
    tests) "exercise" ' >

    The error is: The character '>' was expected.
    Error code: -1072896758

    The line and column number are pointing to the 5 in this line:
    diff NUMBER "50"

    It looks to me like there may be a maximum line length allowed for an
    element, but I have found nothing to verify that.

    Any help would be very much appreciated.

    Thanks.
  • C. M. Sperberg-McQueen

    #2
    Re: Parsing Error

    danab@gemini.co m (Dana) writes:
    [color=blue]
    > Hello. I'm new to XML and I have a question that looks to me like it
    > should be easy to answer, but I have not found anything by searching
    > google at all on this.
    >
    > We are using msxml.dll (Microsoft XML). The xml code that is getting
    > the error is:
    >
    > <!ENTITY question.atts
    > 'id ID #IMPLIED
    > diff NUMBER "50"
    > discrim NUMBER "50"
    > weight NUMBER "50"
    > rand (yesrand | norand) "yesrand "
    > mand (yesmand | nomand) "nomand"
    > mustpass (yesmustpass | nomustpass) "nomustpass "
    > partmarks (yespartmarks | nopartmarks) "nopartmark s"
    > pool (exercise |
    > quiz |
    > mandatoryrand |
    > modpretest |
    > modposttest |
    > courseposttest |
    > tests) "exercise" ' >[/color]

    I don't see a problem with this; neither do nsgmls or rxp.
    [color=blue]
    > The error is: The character '>' was expected.
    > Error code: -1072896758
    >
    > The line and column number are pointing to the 5 in this line:
    > diff NUMBER "50"
    >
    > It looks to me like there may be a maximum line length allowed for an
    > element, but I have found nothing to verify that.[/color]

    Before I did anything else, I'd check to see whether there is an
    unclosed double-quoted string somewhere immediately preceding this
    declaration. An XML parser expects a > as the next non-whitespace
    character after a double quote when it believes the double quote
    ends an entity declaration.

    Next (but this is unrelated to your error message) I'd declare this as
    a parameter entity rather than as a general entity. You're going to
    want to use this entity in an ATTLIST declaration somewhere:

    <!ATTLIST question %question.atts; >

    It'll need to be a parameter entity (uses %), not a general entity
    (uses &).

    I hope this helps.

    -C. M. Sperberg-McQueen
    World Wide Web Consortium

    Comment

    • arnold m. slotnik

      #3
      Re: Parsing Error

      cmsmcq@acm.org (C. M. Sperberg-McQueen) wrote in
      news:87r84wk06v .fsf@acm.org:

      Michael, Michael, Michael...here' s the problem:
      [color=blue][color=green]
      >> diff NUMBER "50"
      >> discrim NUMBER "50"
      >> weight NUMBER "50"[/color][/color]

      XML doesn't do NUMBER--those should be NMTOKEN instead.

      If rxp didn't catch it, that would be a bug.

      --
      a. m. slotnik

      Comment

      • Dana

        #4
        Re: Parsing Error

        Thanks guys. It's nice to see XML parsing error messages are similar
        to some c++ compiler messages. They may not be specific, but I guess
        they generally point to the general location of the error.

        I'll fix up the xml and try again. I'll also look into the "parameter
        entity vs general entity" as well. Thanks again.



        cmsmcq@acm.org (C. M. Sperberg-McQueen) wrote in message news:<87n0fkjvf a.fsf@acm.org>. ..[color=blue]
        > "arnold m. slotnik" <slotnik@att.ne t> writes:
        >[color=green]
        > > cmsmcq@acm.org (C. M. Sperberg-McQueen) wrote in
        > > news:87r84wk06v .fsf@acm.org:
        > >
        > > Michael, Michael, Michael...here' s the problem:
        > >[color=darkred]
        > > >> diff NUMBER "50"
        > > >> discrim NUMBER "50"
        > > >> weight NUMBER "50"[/color]
        > >
        > > XML doesn't do NUMBER--those should be NMTOKEN instead.
        > >
        > > If rxp didn't catch it, that would be a bug.[/color]
        >
        > Ouch! Good eye!
        >
        > Yes, I think it would have to be classed as a bug. Richard, are you
        > paying attention to this?
        >
        > michael[/color]

        Comment

        • Richard Tobin

          #5
          Re: Parsing Error

          In article <Xns93B5E7DB3A9 7Eslotnikattnet @204.127.36.1>,
          arnold m. slotnik <slotnik@att.ne t> wrote:
          [color=blue]
          >XML doesn't do NUMBER--those should be NMTOKEN instead.[/color]
          [color=blue]
          >If rxp didn't catch it, that would be a bug.[/color]

          If the entity were actually *used*, then it would catch it. As it is,
          it's just some text, not an ATTLIST declaration. (And it would have
          to be a parameter entity, and referenced from the external subset.)

          -- Richard
          --
          Spam filter: to mail me from a .com/.net site, put my surname in the headers.

          FreeBSD rules!

          Comment

          Working...