Re: [PyWrapper-devel] Schema structure under TAPIR
Status: Alpha
Brought to you by:
jatorre
|
From: <m.d...@bg...> - 2007-07-23 10:06:54
|
Milko,
pywrapper cant handle mixed content yet so you should assign it a
simple datatype.
in your example this would be sth like this (note the extension base
xs:string):
<xs:element name="Dataset" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="identifier"
type="xs:string"/>
<xs:attribute name="domain"
type="xs:string"/>
<xs:attribute name="URN"
type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
markus
On Jul 20, 2007, at 5:47 PM, Skofic A. Milko (Bioversity - HQ) wrote:
> Hi Markus,
>
> I have installed TAPIR in Peru and Colombia, as I told you we had
> some problems in Peru with the libraryes, but we managed to solve
> them, in Colombia everything went well and the service is running.
>
> I am creating new structures and I was trying to implement a
> construct in which an element has both attributes and a simple
> type, here is an example of the XML:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Datasets
> xmlns="http://grinfo.net/test"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://grinfo.net/test http://localhost/cns/
> test/Schema/test.xsd">
> <Dataset identifier="ID1">Dataset 1</Dataset>
> <Dataset identifier="ID2">Dataset 2</Dataset>
> <Dataset identifier="ID3" URN="http://someurl"
> domain="Taxonomy">Dataset 3</Dataset>
> </Datasets>
>
> The schema that I use is as follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://grinfo.net/test"
> targetNamespace="http://grinfo.net/test"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="Datasets">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Dataset" maxOccurs="unbounded">
> <xs:complexType mixed="true">
> <xs:attribute name="identifier" type="xs:string"/>
> <xs:attribute name="domain" type="xs:string"/>
> <xs:attribute name="URN" type="xs:string"/>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> When I feed the schema to TAPIR's alias file generator, TAPIR will
> generate an ID for the <Dataset> attributes, but not for the
> element itself. I tried to add manually the ID of the element in
> the alias file, but when I tried to query with this structure TAPIR
> returned in the end the following warning:
>
> <diagnostic time="2007-07-20T17:18:39.10" level="WARNING">
> The element /Datasets/Dataset was emptied 1 times because of
> missing xml datatype in the view structure
> </diagnostic>
>
> From that message I understand that TAPIR skipped the element
> because it cannot make up its data type. I am not an expert in XML,
> so is there is a way to indicate a simple data type of an element
> that has attributes, or must I add an element with a simple type?
>
> Thanks for the help
>
> Ciao!
>
> Milko
|