LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: Re: DTD Problem
From: Paul Mahon <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Tue, 4 Jun 2002 15:55:58 +0100
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (230 lines)


Chris,

The structure of your XML file does not match what is expected from the
DTD.  The <item> element has children <VendorNumber>, <UniversalIdentifier>
etc. and subsequently <Programs> has child element <Program> which in turn
has children <ProgramTypeCode>, ProgramTypeCode> etc.

In order for your XML snippet to be Valid your DTD could be written as
documented below, alternatively you could modify your XML file to comply
with the rules set out in your original DTD.


<?xml version='1.0' encoding='UTF-8' ?>
<!ENTITY % USFPClientItemMasterGroup " Client_Customer_Nbr CDATA
'&quot;9999&quot;'
   SenderType          CDATA  #IMPLIED
   Version             CDATA  '&quot;6.0&quot;'">

<!ELEMENT USFPClientItemMaster (Event)>

<!ATTLIST USFPClientItemMaster  %USFPClientItemMasterGroup; >
<!ELEMENT Event (Item)>

<!ATTLIST Event  Type    CDATA    #IMPLIED
                   e-dtype NMTOKEN  #FIXED 'int' >
<!ELEMENT Item (VendorNumber , UniversalIdentifier , ItemIDType ,
ClientItemNumber , TypeCode ,
ProductDescription , UnitOfMeasure , DepartmentCode , CaseQuantity ,
Programs)>

<!ELEMENT VendorNumber (#PCDATA)>

<!ELEMENT UniversalIdentifier (#PCDATA)>

<!ELEMENT ItemIDType (#PCDATA)>

<!ELEMENT ProductDescription (#PCDATA)>

<!ELEMENT UnitOfMeasure (#PCDATA)>

<!ELEMENT DepartmentCode (#PCDATA)>

<!ELEMENT CaseQuantity (#PCDATA)>

<!ELEMENT Programs (Program)>

<!ELEMENT Program (ProgramTypeCode , RecallNumber , ItemCost , RetailCost)>

<!ELEMENT ProgramTypeCode (#PCDATA)>

<!ELEMENT RecallNumber (#PCDATA)>

<!ELEMENT ItemCost (#PCDATA)>

<!ELEMENT RetailCost (#PCDATA)>

<!ELEMENT ClientItemNumber (#PCDATA)>

<!ELEMENT TypeCode (#PCDATA)>

Regards,

Paul

Paul Mahon
Vodafone
Internet Development
Unit 5, Richview Office Park
Clonskeagh, Dublin 14 Ireland

Mobile 00 353 87 2602491
Desk 00 353 1 2038636
Email   [log in to unmask]





                    Chris Proctor
                    <cproctor@GARTSP        To:     [log in to unmask]
                    ORTS.COM>               cc:
                    Sent by: General        Subject:     DTD Problem
                    discussion of
                    Extensible
                    Markup Language
                    <[log in to unmask]
                    HEANET.IE>


                    04/06/2002 15:28
                    Please respond
                    to General
                    discussion of
                    Extensible
                    Markup Language






Hi all,

I'm fairly new to XML and I'm having problems with my DTD that I'm hoping
someone can help me with. First of all, I'm building the DTD based on some
specs given to me by a vendor.

My problem is that the DTD is telling me "USFPClientItemMaster":Unexpected
content at event.  It's probably something very simple that I'm not seeing,
or something I have quite grasped regarding DTDs. Anyway, if someone could
help me I'd really appreciate it!

Thanks

Chris Proctor
Gart Sports
Denver

Here's a sample of the XML document:

<?xml version="1.0" encoding = "UTF-8"?>

<USFPClientItemMaster Client_Customer_Nbr = "9999" SenderType = "Client"
Version="6.0">

<Event Type = "ClientItem">

<Item>

<VendorNumber>590010</VendorNumber>

<UniversalIdentifier>640135307133</UniversalIdentifier>

<ItemIDType>UPCA</ItemIDType>

<ClientItemNumber>13559577</ClientItemNumber>

<TypeCode>11.5 </TypeCode>

<ProductDescription>AIR ZOOM THREAT 3/4 11.5</ProductDescription>

<UnitOfMeasure>PR</UnitOfMeasure>

<DepartmentCode>912</DepartmentCode>

<CaseQuantity>1</CaseQuantity>

<Programs>

<Program>

<ProgramTypeCode>FWD</ProgramTypeCode>

<RecallNumber>0</RecallNumber>
<ItemCost>57.750</ItemCost>
<RetailCost>.000</RetailCost>
</Program>
</Programs>
</Item>
</Event>

 </USFPClientItemMaster>


This is the DTD I've created using Turbo XML:

<?xml version='1.0' encoding='UTF-8' ?>
<!ENTITY % USFPClientItemMasterGroup " Client_Customer_Nbr CDATA
'&quot;9999&quot;'
   SenderType          CDATA  #IMPLIED
   Version             CDATA  '&quot;6.0&quot;'">

<!ELEMENT USFPClientItemMaster (Event , Item , VendorNumber ,
UniversalIdentifier , ItemIDType , ClientItemNumber , TypeCode ,
ProductDescription , UnitOfMeasure , DepartmentCode , CaseQuantity ,
Programs)>

<!ATTLIST USFPClientItemMaster  %USFPClientItemMasterGroup; >
<!ELEMENT Event (#PCDATA)>

<!ATTLIST Event  Type    CDATA    #IMPLIED
                   e-dtype NMTOKEN  #FIXED 'int' >
<!ELEMENT Item (#PCDATA)>

<!ELEMENT VendorNumber (#PCDATA)>

<!ELEMENT UniversalIdentifier (#PCDATA)>

<!ELEMENT ItemIDType (#PCDATA)>

<!ELEMENT ProductDescription (#PCDATA)>

<!ELEMENT UnitOfMeasure (#PCDATA)>

<!ELEMENT DepartmentCode (#PCDATA)>

<!ELEMENT CaseQuantity (#PCDATA)>

<!ELEMENT Programs (Program , ProgramTypeCode , RecallNumber , ItemCost ,
RetailCost)>

<!ELEMENT Program (#PCDATA)>

<!ELEMENT ProgramTypeCode (#PCDATA)>

<!ELEMENT RecallNumber (#PCDATA)>

<!ELEMENT ItemCost (#PCDATA)>

<!ELEMENT RetailCost (#PCDATA)>

<!ELEMENT ClientItemNumber (#PCDATA)>

<!ELEMENT TypeCode (#PCDATA)>






****************************************************************
The information transmitted in this email is intended for the
addressee only and may contain confidential and/or privileged
material. Any review, retransmission,dissemination,reliance
upon or other use of, this information by persons or entities
other than the addressee is prohibited.If you received this
in error, please contact the sender and delete the material.

This message has been swept by Anti-Virus software
****************************************************************

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager