Simple validation question.
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Sat Nov 03, 2018 3:39 am
Simple validation question.
Hi I'm new to this forum and know this is probably really simple, but I cant work out how to make this code a valid XML document.
Any help would be greatly appreciated.
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE eMail [
<!ELEMENT eMail (to+, from+, topic?, message*)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT topic (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ATTLIST message urgency (high|low) #REQUIRED”> ]>
<!—
XML code will go here (comment tags will be removed)
-->
Write the shortest possible fragment of XML code that would make the code in the box above into a valid XML document.
Any help would be greatly appreciated.
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE eMail [
<!ELEMENT eMail (to+, from+, topic?, message*)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT topic (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ATTLIST message urgency (high|low) #REQUIRED”> ]>
<!—
XML code will go here (comment tags will be removed)
-->
Write the shortest possible fragment of XML code that would make the code in the box above into a valid XML document.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Simple validation question.
Hi,
The shortest XML code should be something like:
because all other elements inside "eMail" seem to be optional, "?" means 0 or 1, * means 0 or more but + means 1 ore more.
Regards,
Radu
The shortest XML code should be something like:
Code: Select all
<eMail>
<to></to>
<from></from>
</eMail>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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