TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: XML ELEMENT value required? From:"Mark Baker" <listsub -at- analecta -dot- com> To:"TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Fri, 2 Apr 2004 15:33:28 -0500
David Spreadbury wrote
> Yes, in XML 1.0, it is specified in the DTD as #REQUIRED, which means the
element must explicitly provide a value for this attribute each time it is
used.
>
> Example:
>
> <!ATTLIST SPECIES
> LatinName CDATA #REQUIRED
> ReferenceType CDATA #IMPLIED
> ReferenceNum CDATA #IMPLIED
David,
This applies to specifying an attribute, not to specifying an element value.
In the following snippet, "the Duke" is the element content and "John Wayne"
is the value of the attribute "Name":
<actor name="John Wayne">the Duke</actor>
In a DTD you cannot specify that the actor element have a value, that is,
element content. In other words, you cannot make the parser complain if it
sees:
<actor name="John Wayne"></actor>
You can require that the attribute "name" be specified when the element
"actor" is used. That is what the #REQUIRED means. Note, however, that this
by itself only requires that the attribute be specified, not that it
actually have a meaningful value. So even if you specify that "name" is a
required attribute of an actor element, the parser still will not complain
if it sees:
<actor name="">the Duke</actor>
You can control what the parser will accept as a valid attribute value, to
some extent, but that is not what #REQUIRED does.
So, the answer to Ned's question really is no.
---
Mark Baker
Analecta Communications
www.analecta.com
+1 613 614 5881
Have you tried the latest in Help Authoring from RoboHelp?
Try ROBOHELP X5 for Free - Now with Word 2003 support, Content
Management, Multi-Author support, PDF and XML support and much more!
---
You are currently subscribed to techwr-l as:
archiver -at- techwr-l -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit http://www.raycomm.com/techwhirl/ for more resources and info.