   | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | |  | Occurrence constraints and fixed values | Occurrence constraints and fixed values 2003-12-17 - By Andrea Bigger
Back Hi.
In the W3C Recommendation I found following statement:
<< [...]. The fixed attribute is used in both attribute and element declarations to ensure that the attributes and elements are set to particular values. For example, po.xsd contains a declaration for the country attribute, which is declared with a fixed value US. This declaration means that the appearance of a country attribute in an instance document is optional [...], although if the attribute does appear, its value must be US, and if the attribute does not appear, the schema processor will provide a country attribute with the value US. [...] >> (see W3C Recommendation, 2 May 2001, XML Schema Part0: Primer, ?2.1.1 Occurrence Constraints)
I'm currently using JDOM v1.0b8 and IBM XML Parser for Java v3.2.1 (based on Apache Xerces-J v.1.4.x), and every time I try to get a value of an unset atribute/value which should have a fixed value, I get a null reference. JDOM uses a org.apache.xerces.parsers.SAXParser , validation is enabled and feature http://apache.org.xml.features/validation/schema is true. What am I doing wrong? I am missing something?
Thanks for help/hints. Andrea Bigger
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected) .com
Earn $52 per hosting referral at Lunarpages.
|
|
 |