Parsing Error

D

Dana

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) "nopartmarks"
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

C. M. Sperberg-McQueen

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) "nopartmarks"
pool (exercise |
quiz |
mandatoryrand |
modpretest |
modposttest |
courseposttest |
tests) "exercise" ' >

I don't see a problem with this; neither do nsgmls or rxp.
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.

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
 
A

arnold m. slotnik

(e-mail address removed) (C. M. Sperberg-McQueen) wrote in

Michael, Michael, Michael...here's the problem:

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

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

Dana

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.
 
R

Richard Tobin

arnold m. slotnik said:
XML doesn't do NUMBER--those should be NMTOKEN instead.
If rxp didn't catch it, that would be a bug.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top