Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

IMPLIED

Posted on 2000-02-23
4
Medium Priority
?
747 Views
Last Modified: 2008-03-03
Hi,

I don't understand the way the IMPLIED works. In some tutorial I red that it means you are providing an implied default value for an attribute. As oposed to REQUIERED where you just mention that it will be checked if that attribute is there, but you do not provide any value for it.
This is done in the .dtd file.
But the tutorial does not provide any value for that attribute in the .dtd file ? Where will you provide the default value ?

That's from the tutorial:

<!ATTLIST Port
name            NMTOKEN #REQUIRED
hostName        NMTOKEN #IMPLIED
function        %funcType; #REQUIRED
number          CDATA #REQUIRED
type            %serverType;
serverPort      %fbool;
%basicAttrs;>



Thanks.
0
Comment
Question by:simi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 2554674
Over view:
Value Explanation
#DEFAULT value
 The attribute has a default value
 
#REQUIRED
 The attribute value must be included in the element
 
#IMPLIED
 The attribute does not have to be included
 
#FIXED value
 The attribute value is fixed
 


Detailed:
REQUIRED Default
The REQUIRED flag specifies that though there is no default value provided by the DTD, the attribute when actually implemented in an XML document must define a value. For example, suppose you wanted to define a standard PAGE_AUTHOR element that could be added to every page on any site that used it. Your intent is to make sure that every author provides contact information for bugs and broken links. However, you won't know in advance what the default values should be because everyone who implements your DTD will have different personal information. Thus, you can make the contact information attributes required, while not providing defaults.

IMPLIED Default
When you use the IMPLIED default, you will provide a default value for the document author. If the document author does not override your default, your default will be used.

FIXED Default
Sometimes you will want to provide a default value that the document author may not modify. In that case, you will use FIXED.

also check out:
http://hotwired.lycos.com/webmonkey/98/45/index3a_page2.html?tw=authoring

CJ
0
 

Author Comment

by:simi
ID: 2555301
Thanks but your answer is nothing but cut and paste from the same site I have posted the DTD example.
The reason why I was asking the question was because I did not understand from the tutorial exactly what your answer is stating.
What I do not understand is where do you specifi the implied value.
If not in the .dtd file then where ?
A .dtd file can be used by multiple .xml files as a document type definition.
When at creation of the .dtd you do not know what will be the value for a certain attribute, but you know you want all .xml files having such a value you use #REQUIRED.
When you use #IMPLIED you should provide a default value, that is used if the .xml file does not overrite it by providing one. That's why it is not necesarry needed, like with a required one.
If there was a place to put the implied value itself that would be the .dtd file, but the example we are both talking about is not doing that.
This is my question. Where do I place the default value of the #IMPLIED attribute ?

Thanks.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 2555750
not in the dtd but in the .xml (atleast thats what my reading lead me to believe, I will check more tonite)

CJ
0
 
LVL 1

Accepted Solution

by:
dmaryakh earned 100 total points
ID: 2559145
#IMPLIED - It is optional to supply a value for this attribute in the document instance; applications will beed to supply their own value if one is needed for processing.

#REQUIRED  - a value must be supplied for the attribute in the documents instance.

As for your question of where would you place the default value of the #IMPLIED attribute, you havr to place it in you application that will process the instance. However you might also have something like that in your DTD

<!ATTLIST doc
   status (draft|final|other) #IMPLIED
   audience (novice|expert) #REQUIRED


if you do not supply the value for your status attribute, it is understood by the parser that your application will use some predefined default value for this attribute. If you ommit your audience attribute however, the parser is going to complain that the instance is not valid, since it is required that this attribute have to be present in the instance

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question