DTD to XML
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Wed Mar 04, 2015 9:22 pm
DTD to XML
Hi! I have the following DTD file :
I'm trying to generate a xml file from this exact DTD but not every elements and child elements appear in the generated xml file. Here's my procedure, File, New, XML, Customize, Root Element : book and I've checked both Add optional content and Add first Choice particle.
Here's the xml output :
Do you have an idea why not all my elements and child elements are included in the final xml output?
Thanks a lot for your help!
Code: Select all
<!ELEMENT book (bookinfo,chapter*)>
<!ELEMENT chapter (title,section*)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT bookinfo (title,author,copyright)>
<!ELEMENT author (firstname,surname)>
<!ELEMENT copyright (year,holder)>
<!ENTITY % divers "para|programlisting|itemizedlist|orderedlist">
<!ELEMENT section (title,(%divers;)+)>
<!ELEMENT para (#PCDATA)>
<!ELEMENT programlisting (#PCDATA)>
<!ELEMENT holder (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT itemizedlist (listitem+)>
<!ELEMENT orderedlist (listitem+)>
<!ELEMENT listitem (%divers;)+>
Here's the xml output :
Code: Select all
<book>
<bookinfo>
<title></title>
<author>
<firstname></firstname>
<surname></surname>
</author>
<copyright>
<year></year>
<holder></holder>
</copyright>
</bookinfo>
<chapter>
<title></title>
<section>
<title></title>
<para></para>
</section>
</chapter>
</book>
Thanks a lot for your help!
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: DTD to XML
Hi,
Note that creating a new XML (File > New) doesn't generate a complete XML instance, just a skeleton XML. So, where you have:
The new document will have just the first element, 'para' and the others will be skipped.
Oxygen only provides an instance generator for XML Schema (not for DTD) in Tools > Generate Sample XML Files. You could convert the DTD to XML Schema (Document > Schema > Generate/Convert Schema)) and use the generator on the converted schema.
Regards,
Adrian
Note that creating a new XML (File > New) doesn't generate a complete XML instance, just a skeleton XML. So, where you have:
Code: Select all
<!ELEMENT section (title,(%divers;)+)>
<!ENTITY % divers "para|programlisting|itemizedlist|orderedlist">
Oxygen only provides an instance generator for XML Schema (not for DTD) in Tools > Generate Sample XML Files. You could convert the DTD to XML Schema (Document > Schema > Generate/Convert Schema)) and use the generator on the converted schema.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service