Hi guys, keep getting an error: Cannot find the deceleration of element test when writing the xml. I have declared the element test in the schema but it appears to ignore it.

The schema is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="Test"/>
<xs:simpleType name="Stringtype">   
    <xs:restriction base="xs:string"/>
<xs:simpleType name="Yeartype">   
    <xs:restriction base="xs:integer">
        <xs:pattern value="[0-9][0-9][0-9][0-9]"/>

<xs:simpleType name="Inttype">   
        <xs:restriction base="xs:positiveInteger"/>
<xs:simpleType name="Pagetype">
    <xs:restriction base="xs:string">
        <xs:pattern value="([0-9])*--([0-9])*"/>
<xs:simpleType name="Datetype">   
    <xs:restriction base="xs:date"/>
<xs:element name="Top" type="Stringtype"/>    
<xs:element name="Author" type="Stringtype"/>
<xs:complexType name="Titles">
        <xs:element name="Title" type="Stringtype"/>
        <xs:element name="BookTitle" type="Stringtype" minOccurs="0"/>

<xs:complexType name="Journal">
        <xs:element name="Journal" type="Stringtype" minOccurs="0"/>

<xs:complexType name="Publication">
            <xs:element name="Year" type="Yeartype"/>
            <xs:element name="Volume" type="Inttype" minOccurs="0"/>
<xs:element name="Pages" type="Pagetype"/>
<xs:complexType name="Number">
        <xs:element name="Number" type="Inttype" minOccurs="0"/>
<xs:element name="Month" type="Stringtype"/>
<xs:element name="DOI" type="Stringtype"/>
<xs:element name="Owner" type="Stringtype"/>
<xs:element name="Timestamp" type="Datetype"/>

The XML is:

<?xml version="1.0" encoding="UTF-8"?>

<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Schema.xsd">
    <Author>Allen, G. and Davis, K. and Goodale, T. and Hutanu, A. and Kaiser,
        H. and Kielmann, T. and Merzky, A. and van Nieuwpoort, R. and Reinefeld,
        A. and Schintke, F. and Schott, T. and Seidel, E. and Ullmer, B.</Author>
    <Title>The grid application toolkit: toward generic and easy application
    programming interfaces for the grid</Title>
    <Journal>Proceedings of the IEEE</Journal>

Any help would go a long way.

I tried with two parsers and got no error. You could try with Kernow IDE (freeware from Saxonica.com).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.