Loading ...
Sorry, an error occurred while loading the content.

Re: Error : Element type not mapped as a class

Expand Messages
  • xmldbms
    In your map, you have the following namespace declaration: The prefix in this
    Message 1 of 2 , Nov 28, 2003
      In your map, you have the following namespace declaration:

      <Namespace Prefix=""
      URI="C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd" />

      The prefix in this declaration is "", which means that all unprefixed
      element type and attribute names are assumed to be in the
      C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd namespace.

      Because of this, the following ClassMap:

      <ElementType Name="Customer"/>
      <ToClassTable Schema="ocrvn" Name="CONSIGNEE"/>
      <Attribute Name="Code"/>
      <ToColumn Name="CONSIGNEE_ID"/>

      maps the Customer element in the
      C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd namespace.

      Your XML document is:

      <Customer Code="MJ00130745">

      In this document, the Customer element is not in any namespace. Your
      map does not map this element type -- it maps the Customer element
      type in the C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd

      There are two ways to fix this:

      1) In your XML document, declare the default namespace to be the
      C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd namespace:

      <Parties xmlns="C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd">

      2) In your XML document, prefix all your element types and attribute

      <up:Customer up:Code="MJ00130745">


      1) You probably shouldn't use the xsi prefix. By convention, this is
      used for the XML Schemas instance namespace and is used for
      attributes such as xsi:type. While it is technically correct to use
      this prefix for other namespaces, it is likely to confuse people.

      2) What class returned this error? I would have thought that nothing
      would have happened, rather than this error being returned.

      -- Ron

      --- In xml-dbms@yahoogroups.com, "chinu76" <chinu76@y...> wrote:
      > *****I have the following MAp file **************

      [map snipped]
      > ******XML File***********
      > <?xml version="1.0" encoding="UTF-8"?>
      > <Parties
      > xmlns:xsi="C:/EASEONLINE/dpss/public_html/xsd/FileUpload.xsd">
      > <Customer Code="MJ00130745">
      > <Address1>09201</Address1>
      > <Address2>09</Address2>
      > <City>werwr</City>
      > <StateCode>CA</StateCode>
      > <CountryCode>JA</CountryCode>
      > <PostalCode>43543</PostalCode>
      > <Status>A</Status>
      > <LastScreened>09/15/2003</LastScreened>
      > </Customer>
      > </Parties>
      > What am i doing wrong to get error 'Element type not mapped as a
      > class:Customer'. Could it be something to do with the xsd referred
      > the namespace. This xsd is for the xml file.
      > Thanks
    Your message has been successfully submitted and would be delivered to recipients shortly.