How can I get an attribute datatype?

Gebhardt, Uwe gebhardt at integraliscentaur.de
Tue Jun 8 18:41:43 BST 1999


Hello!

I created a XML-File with its DTD an a schema. Then I wrote a
program in Java which works with my XML data. I used the
DataChannel XJParser.
It is necessary for me to save the datatypes of elements and
attributes. For instance, I have an element "EXTRAS". This
element is empty, but it has attributes, which are from type
boolean. (EXTRAS is a tag from a car-description and it should
save what extras the car has, for instance: car includes Airbages: 
Airbag="1" else Airbag="0". )
Therefor the attribute "Airbag" has to be from type "boolean".
So I tried to make my attributes from type boolean, but it doesnt
work.
My schema looks like this:

<?xml version="1.0"?>
<Schema name="myschema" xmlns="urn:schemas-microsoft-com:xml-data"
 
xmlns:dt="urn:schemas-microsoft-com:datatypes">
  <AttributeType name="Airbag" dt:type="boolean" />
  <ElementType name="CAR">
     <ElementType name="MODEL" dt:type="string" />
     ...
     <ElementType name="EXTRAS">
       <attribute type="Airbag" />
     </ElementType>
     ...
  </ElementType>
</Schema>

In this case even the parsing goes wrong. I get the message:
XMLDOMException18
If I change <attribute type="Airbag/> in <Attribute type="Airbag/>,
my program gets the datatype of MODEL (from all elements) but
not from Airbag (from all attributes). The dt of attributes are "null".
Can anybody help me any further?

Thank you, Uws
-- 
Uwe Gebhardt
Connect-X GmbH
Tel.: 07131/799-100 


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list