You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Cioe, Maureen" <Ma...@GD-CS.COM> on 2001/04/16 21:43:22 UTC
Validating mixed content with a DTD
Hi,
I am using Xerces 1.2.0 and am trying to validate an XML file using
a simple DTD (see below). The validation fails in the DTD when I put
#PCDATA in an element containing children. It gives me an error saying
it's expecting a ) after PCDATA. Is there something I am missing here?
Hopefully this is an easy question.
--------------------------------- DTD- tmp.dtd
----------------------------------
<!--Name of the mediators to be used for this screen in a given mode.-->
<!ELEMENT REQUIRED_MEDIATOR (#PCDATA)>
<!--Name of the adapters to be used for this screen in a given mode.-->
<!ELEMENT REQUIRED_ADAPTER (#PCDATA)>
<!--This element defines which mediator should be used for the Initial
Contact of a given mode.-->
<!ELEMENT INITIAL_MEDIATOR_NAME (#PCDATA)>
<!--This element defines the mode of the screen and the elements needed for
a given mode.-->
<!ELEMENT MODE
(#PCDATA,REQUIRED_MEDIATOR*,REQUIRED_ADAPTER?,INITIAL_MEDIATOR_NAME?)*>
----------------------------------------------------------------------------
xml file
---------------------------------------------------------------------------
<?xml version="1.0" standalone="no"?>
<!DOCTYPE SCREEN SYSTEM "tmp.dtd" >
<SCREEN>
<MODE> open
<REQUIRED_MEDIATOR> switch_enable </REQUIRED_MEDIATOR>
<REQUIRED_ADAPTER> sitma_adapter </REQUIRED_ADAPTER>
<INITIAL_MEDIATOR_NAME> initial_contact </INITIAL_MEDIATOR_NAME>
</MODE>
</SCREEN>
Maureen Cioe
General Dynamics
Communication Systems
400 John Quincy Adams Rd.
Taunton, MA 02780
508.880.4681
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: Validating mixed content with a DTD
Posted by Se...@cern.ch.
A mixed content does not have this form. It must be of the form (#PCDATA | ...)
(not ',').
See http://XMLwriter.net/xml_guide/element_declaration.shtml#DeclareMixed.
Sebastien
"Cioe, Maureen" wrote:
> Hi,
> I am using Xerces 1.2.0 and am trying to validate an XML file using
> a simple DTD (see below). The validation fails in the DTD when I put
> #PCDATA in an element containing children. It gives me an error saying
> it's expecting a ) after PCDATA. Is there something I am missing here?
> Hopefully this is an easy question.
>
> --------------------------------- DTD- tmp.dtd
> ----------------------------------
> <!--Name of the mediators to be used for this screen in a given mode.-->
> <!ELEMENT REQUIRED_MEDIATOR (#PCDATA)>
>
> <!--Name of the adapters to be used for this screen in a given mode.-->
> <!ELEMENT REQUIRED_ADAPTER (#PCDATA)>
>
> <!--This element defines which mediator should be used for the Initial
> Contact of a given mode.-->
> <!ELEMENT INITIAL_MEDIATOR_NAME (#PCDATA)>
>
> <!--This element defines the mode of the screen and the elements needed for
> a given mode.-->
> <!ELEMENT MODE
> (#PCDATA,REQUIRED_MEDIATOR*,REQUIRED_ADAPTER?,INITIAL_MEDIATOR_NAME?)*>
>
> ----------------------------------------------------------------------------
> xml file
> ---------------------------------------------------------------------------
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE SCREEN SYSTEM "tmp.dtd" >
>
> <SCREEN>
> <MODE> open
> <REQUIRED_MEDIATOR> switch_enable </REQUIRED_MEDIATOR>
>
> <REQUIRED_ADAPTER> sitma_adapter </REQUIRED_ADAPTER>
>
> <INITIAL_MEDIATOR_NAME> initial_contact </INITIAL_MEDIATOR_NAME>
> </MODE>
>
> </SCREEN>
>
> Maureen Cioe
> General Dynamics
> Communication Systems
> 400 John Quincy Adams Rd.
> Taunton, MA 02780
> 508.880.4681
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org