[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Retriving a value of default attribute from schema(.xsd)


Subject: [xsl] Retriving a value of default attribute from schema(.xsd)
From: "Vadiraj" <Vadirajrk@xxxxxxxxxx>
Date: Fri, 12 Oct 2001 12:40:52 +0530

Hi there,

while parsing an xml file using xml schema as validator for that file, the
default value declared for a particular attribute is not been picked up by
the parser. while the code works fine with the dtd. As a result the java
source code returns null pointer exception.

the schema structure for the element ' fromTable ' is as follows :

<xs:complexType name="fromTableType">
		<xs:sequence>
			<xs:element name="table" type="tableType" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Unique Table </xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="joinType" default="equi">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="equi"/>
					<xs:enumeration value="nonequi"/>
					<xs:enumeration value="join"/>
					<xs:enumeration value="LeftOuterJoin"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="primaryTable" type="xs:string"/>
		<xs:attribute name="alias" type="xs:string"/>
	</xs:complexType>

The parser I am using is xerces.jar in the package XML4J-J-bin.3.2.1.  Does
this parser support validation of XML against XSD??? If yes, to what
level???  The default vlaue "equi" is not getting picked up by the parser.
Is there any other field I have to include in attribute element????

Thanx in advance :-)
Vadiraj


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords