Schema and instance (again)

Hi! I’m currently working on a project where I have one schema and one pretty big .xml-file i want to import. Dunno if I’m doing something wrong, but i was hoping that each root-child-element (each -element, that is) would become it’s own instance with it’s own unique ID. Currently this only results in only one instance (cause of the doctype in the schema I guess) and if I query this datapool, and want to pick out every -element, they all have ino:id=1 :frowning: This is my schema file, which I defined with my topics-collection in Tamino.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!--W3C Schema generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)--> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tsd="http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:annotation> <xs:appinfo> <tsd:schemaInfo name="Topic_schema"> <tsd:collection name="topics" /> <tsd:doctype name="topicregistry"> <tsd:logical> <tsd:content>closed</tsd:content> </tsd:logical> </tsd:doctype> </tsd:schemaInfo> </xs:appinfo> </xs:annotation> <xs:element name="topic"> <xs:complexType> <xs:sequence> <xs:element ref="name"/> <xs:element ref="folionr" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="supercathegory" minOccurs="0"/> <xs:element ref="also" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="topicregistry"> <xs:complexType> <xs:sequence> <xs:element ref="topic" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="folionr" type="xs:string"/> <xs:element name="name" type="xs:string"/> <xs:element name="also" type="xs:string"/> <xs:element name="supercathegory" type="xs:string"/> </xs:schema>

This is an example of some of my .xml-file

<topicregistry> <topic> <name>almisse</name> <folionr>115</folionr> </topic> <topic> <name>allmuen</name> <folionr>75b</folionr> <folionr>80b</folionr> <folionr>100</folionr> <folionr>100b</folionr> <folionr>107</folionr> <folionr>107b</folionr> <folionr>115</folionr> <folionr>125</folionr> </topic> </topicregistry>

(the names have been translated into english, so any errors may be attributed to that, both schema and xml-file validates and is well-formed) Hope someone can help me :slight_smile:

Hi, Currently your doctype is “topicregistry”, and your example shows one instance of this doctype which happens to contain two topic elements. If you want each topic to be represented by a separate xml document instance in Tamino, you need to remove the “topicregistry” node from your schema, making the doctype “topic”. Now remove the “topicregistry” start and end tags from your xml. This will leave you with a non-well-formed file. If you make it well-formed again by wrapping it as shown below, you can use the Tamino Loader from the System Management Hub to load all of your separate topic instances. You can document the “topicregistry” node by naming your schema/collection “topicregistry”.

 <?xml version="1.0" encoding="utf-8"?> <ino:request xmlns:ino="http://namespaces.softwareag.com/tamino/response2"> <ino:object> <topic> <name>almisse</name> <folionr>115</folionr> </topic> </ino:object > <ino:object> <topic> <name>allmuen</name> <folionr>75b</folionr> <folionr>80b</folionr> <folionr>100</folionr> <folionr>100b</folionr> <folionr>107</folionr> <folionr>107b</folionr> <folionr>115</folionr> <folionr>125</folionr> </topic> </ino:object> </ino:request> 

HTH

Thank you! The finally cleared this mess up :slight_smile: