This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DTD Problem


In message <CC984993EECCD4118A570008C7246A776EB022@exch1.sacem.fr>,
ABHAY Andre <andre.abhay@sacem.fr> writes
>Good morning,
>
>       I have a problem with using ENTITY in my DTD file.
>As you can see, in below, when I have <TITLETYP>OT</TITLETYP> in my XML file
>and I try to load it with XML notepad in order to validate my XML file, 
>I have a  XML parse error: 
>
>Element content is invalid according to the DTD/Schema.
>Expecting: AT, OT.
>
>               <TITLETYP>OT</TITLETYP>
>Do you know why there is an error here?

Parameter entities are simply a short-hand, local to a DTD.  Thus
TITLETYP is simply a short-hand for the string "( AT | OT)".  Therefore
the content model for WORKTITLE is actually:

<!ELEMENT WORKTITLE (TITLE+, LNGCDE?, (( AT | OT))+)>

after the DTD has been parsed.  TITLETYP is not declared as an allowed
element type - hence the error.  (Note also that you have a redundant
pair of brackets around "AT | OT".)

Richard Light.

>Please, find in below the DTD file and the XML file:
>
>essai.dtd
>
><!ENTITY % TITLETYP "( AT | OT)">
>
><!ELEMENT MUSICALWORKS (WORK+)>
>
><!ELEMENT WORK (WORKTITLE+, DURATION?, CPRDT?, PUBDT?)>
>
><!ELEMENT WORKTITLE (TITLE+, LNGCDE?, (%TITLETYP;)+)>
><!ELEMENT TITLE (#PCDATA)>
><!ELEMENT LNGCDE (#PCDATA)>
><!ELEMENT TITLETYP (#PCDATA)>
>
><!ELEMENT DURATION (#PCDATA)>
><!ELEMENT CPRDT (#PCDATA)>
><!ELEMENT PUBDT (#PCDATA)>
>
>essai.xml
>
><?xml version="1.0" standalone="no"?>
><?xml-stylesheet type="text/xsl"
>href="http://etudev4/localengine3/essai.xsl"?>
><!DOCTYPE MUSICALWORKS SYSTEM "http://etudev4/localengine3/essai.dtd">
><MUSICALWORKS>
>       <WORK>
>               <WORKTITLE>
>                       <TITLE>A1254</TITLE>
>                       <LNGCDE>FR</LNGCDE>
>                       <TITLETYP>OT</TITLETYP>
>               </WORKTITLE>
>       </WORK> 
></MUSICALWORKS>
>
>
>Thanks a lot for your help and have a happy new year
>
>
>André ABHAY.
>_______________________________________________________________________
>Tel : (33) 1 47 15 47 50    E-mail : mailto:andre.abhay@sacem.fr    web site
>: http://www.sacem.fr
>Address : SACEM / 225 avenue Charles de Gaulle / 92521 Neuilly sur Seine
>cedex / France
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>

Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]