[GeoNetwork-devel] XML Errors

Hi,

            I am implementing an extension to ISO 19115 and have come across
some errors that I don't understand.

            When in either Administration/New Metadata or Administration/XML
Metadata Insert, looking at the Default View form and I press the '+' button
to add a new 'contact', no new contact comes up in the form. When I look at
it in the XML View, I see that it has actually created the new contact, but
it has used the namespace declared at the top of the XML document. I can
change the namespace and it also changes the new contact elements (if I
repeat the procedure). This is the only element to do this. No other
elements use namespaces and do not create them when adding new instances.
I've added an entry to the schema-suggestions.xml file, but this did not
help. I can't see any reason for it to suddenly start using namespaces and
only on 1 element at that.

            My second unexplainable error is again to do with adding new
instances of elements. Many elements make use of the CI_Date structure to
declare date information. Any of these elements, including CI_Date itself,
will not create new instances and it crashes with an error saying:

            The requested operation could not be performed.

The name "null" is not legal for JDOM/XML elements: XML names cannot be null
or empty.

But I have no idea where it is getting null from or how to fix it. I think
this used to work, but is now consistently producing this error.

Any ideas on where to start looking would be appreciated.

Thank you.

--
Steven Smith <steven.smith@anonymised.com>
Software Developer / Analyst

Geometry Pty Ltd

Telephone

:

03 6223 1999

Facsimile

:

03 6223 1988

Web

:

www.geometryit.com
<file:///C:\Documents%20and%20Settings\ssmith.GEOMETRY\Application%20Data\Mi
crosoft\Signatures\www.geometryit.com>

Address

:

31 Salamanca Square, Battery Point, TAS 7004, Australia

Postal

:

PO Box 844, Sandy Bay, TAS 7006, Australia

Building Intelligent Business through the Power of Spatial

Ciao Steven,
the error you are reporting is can be caused by one of these:

(1) if you are using the latest 2.0.x (stable) version and are extending the iso19115 XML Schema, it probably it depends on how the schema extension is defined: the GeoNetwork editor does not fully understands XML schema, and different namespaces in the same metadata are not really supported in version 2.0.x;

(2) if you are using the latest alpha release, the editor is not stable at all; the current subversion code, not released yet as an installer, includes a working editor for iso19139, which is currently being tested.

So, for (1) I can try to have a look at your extended schema definition and see if it contains features not supported by the 2.0.x editor; if instead the case is (2) I would suggest you to wait until the beginning of february, when we should release a new alpha/beta version with the working editor.
Best regards,

        Roberto

On 12 Jan 2007, at 1:50, Steven Smith wrote:

Hi,

            I am implementing an extension to ISO 19115 and have come across some errors that I don’t understand.

            When in either Administration/New Metadata or Administration/XML Metadata Insert, looking at the Default View form and I press the ‘+’ button to add a new ‘contact’, no new contact comes up in the form. When I look at it in the XML View, I see that it has actually created the new contact, but it has used the namespace declared at the top of the XML document. I can change the namespace and it also changes the new contact elements (if I repeat the procedure). This is the only element to do this. No other elements use namespaces and do not create them when adding new instances. I’ve added an entry to the schema-suggestions.xml file, but this did not help. I can’t see any reason for it to suddenly start using namespaces and only on 1 element at that.

            My second unexplainable error is again to do with adding new instances of elements. Many elements make use of the CI_Date structure to declare date information. Any of these elements, including CI_Date itself, will not create new instances and it crashes with an error saying:

            The requested operation could not be performed.

The name "null" is not legal for JDOM/XML elements: XML names cannot be null or empty.

But I have no idea where it is getting null from or how to fix it. I think this used to work, but is now consistently producing this error.

Any ideas on where to start looking would be appreciated.

Thank you.

--
Steven Smith <steven.smith@anonymised.com>
Software Developer / Analyst

Geometry Pty Ltd

Telephone

:

03 6223 1999

Facsimile

:

03 6223 1988

Web

:

www.geometryit.com

Address

:

31 Salamanca Square, Battery Point, TAS 7004, Australia

Postal

:

PO Box 844, Sandy Bay, TAS 7006, Australia

Building Intelligent Business through the Power of Spatial

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Steven,
Can you indicate the version of GN you are working with?
Ciao,
Jeroen

On Jan 12, 2007, at 1:50 AM, Steven Smith wrote:


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Thanks Roberto and Jeroen,
  I should have mentioned that I am using Geonetwork 2.0.x (not sure
if it is 2.0.2 or 2.0.3, I thought it was 2.0.3, but the about box says
2.0.2).

  The XML Schema I am using does not specify any namespaces. I've
attached it if you want to have a look. The schema has been modified to fit
within Geonetwork, it originally had a different structure but we soon found
out it wouldn't load. Maybe the latest changes have introduced some
problems. I tried adding the schemaLocationNoNamespace attribute, but that
didn't fix it either.

  The problematic element is 'MD_Metadata/contact'.

  I may have just found the cause of my second problem, regarding
CI_Date. It seems that the definition of this has changed as it now uses

    <xs:element name="CI_Date">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="date" type="xs:date"/>
                <xs:element ref="dateType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

Which contains an inline element declaration. I believe this is not
supported by Geonetwork yet. This causes a problem though because there are
2 different date elements. Is there a better way to write the schema that
Geonetwork can understand? In the past, my client (who has control over the
schema) has introduced new elements to get around this (such as cdate rather
than date to signify a contact date). However, this breaks the ISO specs so
we are looking for ways around this.

--
Steven Smith <steven.smith@anonymised.com>
Software Developer / Analyst
Geometry Pty Ltd

Telephone : 03 6223 1999
Facsimile : 03 6223 1988
Web : www.geometryit.com
Address : 31 Salamanca Square, Battery Point, TAS 7004, Australia

Postal : PO Box 844, Sandy Bay, TAS 7006, Australia
     
Building Intelligent Business through the Power of Spatial

-----Original Message-----
From: Roberto Giaccio [mailto:r.giaccio@anonymised.com]
Sent: Friday, 12 January 2007 7:16 PM
To: Steven Smith
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] XML Errors

Ciao Steven,
the error you are reporting is can be caused by one of these:

(1) if you are using the latest 2.0.x (stable) version and are
extending the iso19115 XML Schema, it probably it depends on how the
schema extension is defined: the GeoNetwork editor does not fully
understands XML schema, and different namespaces in the same metadata
are not really supported in version 2.0.x;

(2) if you are using the latest alpha release, the editor is not
stable at all; the current subversion code, not released yet as an
installer, includes a working editor for iso19139, which is currently
being tested.

So, for (1) I can try to have a look at your extended schema
definition and see if it contains features not supported by the 2.0.x
editor; if instead the case is (2) I would suggest you to wait until
the beginning of february, when we should release a new alpha/beta
version with the working editor.
Best regards,

        Roberto

On 12 Jan 2007, at 1:50, Steven Smith wrote:

Hi,

            I am implementing an extension to ISO 19115 and have
come across some errors that I don't understand.

            When in either Administration/New Metadata or
Administration/XML Metadata Insert, looking at the Default View
form and I press the '+' button to add a new 'contact', no new
contact comes up in the form. When I look at it in the XML View, I
see that it has actually created the new contact, but it has used
the namespace declared at the top of the XML document. I can change
the namespace and it also changes the new contact elements (if I
repeat the procedure). This is the only element to do this. No
other elements use namespaces and do not create them when adding
new instances. I've added an entry to the schema-suggestions.xml
file, but this did not help. I can't see any reason for it to
suddenly start using namespaces and only on 1 element at that.

            My second unexplainable error is again to do with
adding new instances of elements. Many elements make use of the
CI_Date structure to declare date information. Any of these
elements, including CI_Date itself, will not create new instances
and it crashes with an error saying:

            The requested operation could not be performed.

The name "null" is not legal for JDOM/XML elements: XML names
cannot be null or empty.

But I have no idea where it is getting null from or how to fix it.
I think this used to work, but is now consistently producing this
error.

Any ideas on where to start looking would be appreciated.

Thank you.

--
Steven Smith <steven.smith@anonymised.com>
Software Developer / Analyst

Geometry Pty Ltd

Telephone

:

03 6223 1999

Facsimile

:

03 6223 1988

Web

:

www.geometryit.com

Address

:

31 Salamanca Square, Battery Point, TAS 7004, Australia

Postal

:

PO Box 844, Sandy Bay, TAS 7006, Australia

Building Intelligent Business through the Power of Spatial

----------------------------------------------------------------------
---
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?
page=join.php&p=sourceforge&CID=DEVDEV________________________________
_______________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork

(attachments)

schema.xsd (51.2 KB)

Hi Steven,

I gave a look at the schema and it seems ok regarding the MD_Metadata/contact
structure. As far as I remember GN should be able to handle inline definitions of
elements. Anyway, remember that the simple view does not show all elements
and new added elements may disappear.

Cheers,
Andrea

Thanks Roberto and Jeroen,
  I should have mentioned that I am using Geonetwork 2.0.x (not sure
if it is 2.0.2 or 2.0.3, I thought it was 2.0.3, but the about box says
2.0.2).

  The XML Schema I am using does not specify any namespaces. I've
attached it if you want to have a look. The schema has been modified to fit
within Geonetwork, it originally had a different structure but we soon found
out it wouldn't load. Maybe the latest changes have introduced some
problems. I tried adding the schemaLocationNoNamespace attribute, but that
didn't fix it either.

  The problematic element is 'MD_Metadata/contact'.

  I may have just found the cause of my second problem, regarding
CI_Date. It seems that the definition of this has changed as it now uses

    <xs:element name="CI_Date">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="date" type="xs:date"/>
                <xs:element ref="dateType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

Which contains an inline element declaration. I believe this is not
supported by Geonetwork yet. This causes a problem though because there are
2 different date elements. Is there a better way to write the schema that
Geonetwork can understand? In the past, my client (who has control over the
schema) has introduced new elements to get around this (such as cdate rather
than date to signify a contact date). However, this breaks the ISO specs so
we are looking for ways around this.