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

conversion exception

Expand Messages
  • gyuresz2002
    Hi! My xml file is:
    Message 1 of 2 , Mar 26, 2002
      Hi!

      My xml file is:

      <!DOCTYPE ann SYSTEM "egyseg.dtd">
      <ann nev="pelda_ann">
      <egyseg nev="be1" tipus="sigmoid" csoport="1" />
      <egyseg nev="be2" tipus="sigmoid" csoport="1" />
      <egyseg nev="rejt1" tipus="sigmoid" csoport="2" />
      <egyseg nev="rejt2" tipus="exp" csoport="2" />
      <egyseg nev="ki1" tipus="sigmoid" csoport="3" />
      </ann>

      The map file is:

      <?xml version='1.0'?>
      <!DOCTYPE XMLToDBMS SYSTEM "xmldbms2.dtd" >
      <XMLToDBMS Version="2.0"
      xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
      <Options>
      </Options>
      <Databases>
      <Database Name="Default">
      <Catalog>
      <Schema>
      <Table Name="EGYSEG">
      <Column Name="ann_nev"
      DataType="VARCHAR" Length="255" Nullable="No"/>
      <Column Name="nev"
      DataType="VARCHAR" Length="255" Nullable="No"/>
      <Column Name="tipus"
      DataType="VARCHAR" Length="12" Nullable="No" />
      <Column Name="csoport"
      DataType="VARCHAR" Length="12" Nullable="No"/>
      <PrimaryKey>
      <UseColumn Name="ann_nev"/>
      <UseColumn Name="nev"/>
      </PrimaryKey>
      </Table>
      </Schema>
      </Catalog>
      </Database>
      </Databases>


      <Maps>
      <ClassMap>
      <ElementType Name="ann"/>
      <ToClassTable Name="EGYSEG"/>
      <PropertyMap>
      <Attribute Name="nev"/>
      <ToColumn Name="ann_nev"/>
      </PropertyMap>
      <InlineMap>
      <ElementType Name="egyseg"/>
      <PropertyMap>
      <Attribute Name="nev"/>
      <ToColumn Name="nev"/>
      </PropertyMap>
      <PropertyMap>
      <Attribute Name="tipus"/>
      <ToColumn Name="tipus"/>
      </PropertyMap>
      <PropertyMap>
      <Attribute Name="csoport"/>
      <ToColumn Name="csoport"/>
      </PropertyMap>
      </InlineMap>
      </ClassMap>
      </Maps>
      </XMLToDBMS>

      If I run the program, I have an error message:
      >>org.xmlmiddleware.conversions.ConversionException: Object must be
      a String.

      Is the map file wrong or I missed something?

      Thanks!
    • Ronald Bourret
      This is the same bug I discussed in message 2107: http://groups.yahoo.com/group/xml-dbms/message/2107 You also have the same problem as in 2107. That is, you
      Message 2 of 2 , Mar 29, 2002
        This is the same bug I discussed in message 2107:

        http://groups.yahoo.com/group/xml-dbms/message/2107

        You also have the same problem as in 2107. That is, you can't use
        InlineMaps to get the result you want. Like the case in 2107, you need
        to use XSLT to modify your document to the following. Your map document
        will then work correctly.

        <anns>
        <ann nev="pelda_ann">
        <egyseg nev="be1" tipus="sigmoid" csoport="1" />
        </ann>
        <ann nev="pelda_ann">
        <egyseg nev="be2" tipus="sigmoid" csoport="1" />
        </ann>
        <ann nev="pelda_ann">
        <egyseg nev="rejt1" tipus="sigmoid" csoport="2" />
        </ann>
        <ann nev="pelda_ann">
        <egyseg nev="rejt2" tipus="exp" csoport="2" />
        </ann>
        <ann nev="pelda_ann">
        <egyseg nev="ki1" tipus="sigmoid" csoport="3" />
        </ann>
        </anns>

        -- Ron

        gyuresz2002 wrote:
        >
        > Hi!
        >
        > My xml file is:
        >
        > <!DOCTYPE ann SYSTEM "egyseg.dtd">
        > <ann nev="pelda_ann">
        > <egyseg nev="be1" tipus="sigmoid" csoport="1" />
        > <egyseg nev="be2" tipus="sigmoid" csoport="1" />
        > <egyseg nev="rejt1" tipus="sigmoid" csoport="2" />
        > <egyseg nev="rejt2" tipus="exp" csoport="2" />
        > <egyseg nev="ki1" tipus="sigmoid" csoport="3" />
        > </ann>
        >
        > The map file is:
        >
        > <?xml version='1.0'?>
        > <!DOCTYPE XMLToDBMS SYSTEM "xmldbms2.dtd" >
        > <XMLToDBMS Version="2.0"
        > xmlns="http://www.xmlmiddleware.org/xmldbms/v2">
        > <Options>
        > </Options>
        > <Databases>
        > <Database Name="Default">
        > <Catalog>
        > <Schema>
        > <Table Name="EGYSEG">
        > <Column Name="ann_nev"
        > DataType="VARCHAR" Length="255" Nullable="No"/>
        > <Column Name="nev"
        > DataType="VARCHAR" Length="255" Nullable="No"/>
        > <Column Name="tipus"
        > DataType="VARCHAR" Length="12" Nullable="No" />
        > <Column Name="csoport"
        > DataType="VARCHAR" Length="12" Nullable="No"/>
        > <PrimaryKey>
        > <UseColumn Name="ann_nev"/>
        > <UseColumn Name="nev"/>
        > </PrimaryKey>
        > </Table>
        > </Schema>
        > </Catalog>
        > </Database>
        > </Databases>
        >
        > <Maps>
        > <ClassMap>
        > <ElementType Name="ann"/>
        > <ToClassTable Name="EGYSEG"/>
        > <PropertyMap>
        > <Attribute Name="nev"/>
        > <ToColumn Name="ann_nev"/>
        > </PropertyMap>
        > <InlineMap>
        > <ElementType Name="egyseg"/>
        > <PropertyMap>
        > <Attribute Name="nev"/>
        > <ToColumn Name="nev"/>
        > </PropertyMap>
        > <PropertyMap>
        > <Attribute Name="tipus"/>
        > <ToColumn Name="tipus"/>
        > </PropertyMap>
        > <PropertyMap>
        > <Attribute Name="csoport"/>
        > <ToColumn Name="csoport"/>
        > </PropertyMap>
        > </InlineMap>
        > </ClassMap>
        > </Maps>
        > </XMLToDBMS>
        >
        > If I run the program, I have an error message:
        > >>org.xmlmiddleware.conversions.ConversionException: Object must be
        > a String.
        >
        > Is the map file wrong or I missed something?
        >
        > Thanks!
        >
        >
        > To post a message, send it to: xml-dbms@yahoogroups.com
        > To unsubscribe, send a blank message to: xml-dbms-unsubscribe@yahoogroups.com
        > Or join the newsgroup at: news://news.barkto.com/homeless.xml.xml-dbms
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

        --
        Ronald Bourret
        Programming, Writing, and Research
        XML, Databases, and Schemas
        http://www.rpbourret.com
      Your message has been successfully submitted and would be delivered to recipients shortly.