This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Which of the following would raise an error if the empID attribute's data type were defined as type ID in the DTD? a. <name empID="17563">Joe Smith</name> b. <name empID="ft:17563">Joe Smith</name> c. <name empID="a17563">Joe Smith</name> d. <name empID="">Joe Smith</name> Multiple Select - Please select all of the correct answers (this question has 2 correct choices). Ans: a, d. - please explain.
Daniel, <name empID="ft:17563">Joe Smith</name> ft:17563 has nothing to do with prefix, namespace or some such. ft:17563 is the content of the text node of the attribute. All characters of "ft:17563" are allowed to qualify as legal xml name tokens. [ March 18, 2003: Message edited by: Axel Janssen ]
Joined: Oct 26, 2002
to Axel: the ":" in the string is not allowed,i test in xmlspy,she said:invalid value.when i del the ":",it's ok!
Joined: Aug 26, 2001
For the exam purpose, you should consider the XML recommendation as the absolute authoritative reference and not implementing tools like XMLSpy. In the recommendation, it is stated in 3.3.1 Attribute Types that "Values of type ID must match the Name production." and the Name (and NameChar) productions are specified as Name ::= (Letter | '_' | ':') (NameChar)* NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender As you can see, the : character is perfectly admissible in attribute values. XMLSpy must have skipped that part [ March 18, 2003: Message edited by: Valentin Crettaz ]