[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: DTD 2 Schema
At 2009-07-23 11:31 -0700, Paul M wrote: >Hi: > >I attempted to use DTDinst on sample dtd. I always receive syntax >error on 1st line, column 0. > >Sample dtd ><!DOCTYPE note [ ><!ELEMENT note (to,from,heading,body)> ><!ELEMENT to (#PCDATA)> ><!ELEMENT from (#PCDATA)> ><!ELEMENT heading (#PCDATA)> ><!ELEMENT body (#PCDATA)> >]> > > > >p.s. any other recommend dtd 2 schema translators? Sorry, I should have also mentioned that a DTD (document type definition) does *not* contain a DOCTYPE (document type declaration). You've quoted an entire document type declaration, which is not valid as a standalone DTD (and never has been valid as a standalone DTD even though a prominent vendor supported it as such in both SGML and XML tools, much to the consternation of other vendors who were being told by customers they were wrong). Perhaps your DTDinst you are using just needs to see a DTD and not a document type declaration (I am not familiar with the tool): <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> For example, this is the output from Trang on the above: T:\ftemp>copy con paul.dtd <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ^Z 1 file(s) copied. T:\ftemp>trang -I dtd -O xsd paul.dtd con <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element ref="to"/> <xs:element ref="from"/> <xs:element ref="heading"/> <xs:element ref="body"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:schema> T:\ftemp> I hope this helps. . . . . . . . . Ken -- XQuery/XSLT/XSL-FO hands-on training - Oakland, CA, USA 2009-08-03 Crane Softwrights Ltd. http://www.CraneSoftwrights.com/x/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/x/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|