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

Possible bug - PCDATA elements with attributes

Expand Messages
  • bdaici
    I modified the original orders.dtd (XMLDBMS 2.0) as follows: original: modified:
    Message 1 of 3 , Oct 8, 2002
      I modified the original orders.dtd (XMLDBMS 2.0) as follows:

      original:
      <!ELEMENT Price (#PCDATA)>

      modified:
      <!ELEMENT Price (#PCDATA)>
      <!ATTLIST Price
      priceatt CDATA #REQUIRED>

      Here is the answer from manage.bat:

      java.lang.IllegalArgumentException: xmlName name must be null when
      type is PCDATA.
      at org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDTD
      (MapManager.java:614)
      at org.xmlmiddleware.xmldbms.tools.MapManager.dispatch
      (MapManager.java:407)
      at org.xmlmiddleware.xmldbms.tools.MapManager.main
      (MapManager.java:348)

      I further investigated and it seems the code is inconsistent. The
      method PropertyMap.setXMLName(XMLName xmlName, int type) throws the
      exception above because it is passed a non null xmlName for a PCDATA
      ClassMap.

      I will continue the investigation, but, if someone realizes I am
      missing something, please let me know so I wouldn't waste my time.

      Thank you

      Ben
    • bdaici
      In order to make the XMLDBMS MapManager work with the modified orders.dtd I made the following change into the
      Message 2 of 3 , Oct 8, 2002
        In order to make the XMLDBMS MapManager work with the modified
        orders.dtd I made the following change into the
        org.xmlmiddleware.xmldbms.maps.factories.MapFactory_DTD.java
        addPropertyMap method:

        original code:
        propMap = PropertyMap.create(name, type);

        modified code:
        XMLName modifName =
        type==PropertyMap.PCDATA ? null : name;
        propMap = PropertyMap.create(modifName, type);

        ...and it worked.

        Ben



        --- In xml-dbms@y..., "bdaici" <bdaici@a...> wrote:
        > I modified the original orders.dtd (XMLDBMS 2.0) as follows:
        >
        > original:
        > <!ELEMENT Price (#PCDATA)>
        >
        > modified:
        > <!ELEMENT Price (#PCDATA)>
        > <!ATTLIST Price
        > priceatt CDATA #REQUIRED>
        >
        > Here is the answer from manage.bat:
        >
        > java.lang.IllegalArgumentException: xmlName name must be null when
        > type is PCDATA.
        > at
        org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDTD
        > (MapManager.java:614)
        > at org.xmlmiddleware.xmldbms.tools.MapManager.dispatch
        > (MapManager.java:407)
        > at org.xmlmiddleware.xmldbms.tools.MapManager.main
        > (MapManager.java:348)
        >
        > I further investigated and it seems the code is inconsistent. The
        > method PropertyMap.setXMLName(XMLName xmlName, int type) throws the
        > exception above because it is passed a non null xmlName for a
        PCDATA
        > ClassMap.
        >
        > I will continue the investigation, but, if someone realizes I am
        > missing something, please let me know so I wouldn't waste my time.
        >
        > Thank you
        >
        > Ben
      • Ronald Bourret
        Thanks for the fix. I ve added it to the CVS tree. -- Ron
        Message 3 of 3 , Oct 30, 2002
          Thanks for the fix. I've added it to the CVS tree.

          -- Ron

          bdaici wrote:
          >
          > In order to make the XMLDBMS MapManager work with the modified
          > orders.dtd I made the following change into the
          > org.xmlmiddleware.xmldbms.maps.factories.MapFactory_DTD.java
          > addPropertyMap method:
          >
          > original code:
          > propMap = PropertyMap.create(name, type);
          >
          > modified code:
          > XMLName modifName =
          > type==PropertyMap.PCDATA ? null : name;
          > propMap = PropertyMap.create(modifName, type);
          >
          > ...and it worked.
          >
          > Ben
          >
          > --- In xml-dbms@y..., "bdaici" <bdaici@a...> wrote:
          > > I modified the original orders.dtd (XMLDBMS 2.0) as follows:
          > >
          > > original:
          > > <!ELEMENT Price (#PCDATA)>
          > >
          > > modified:
          > > <!ELEMENT Price (#PCDATA)>
          > > <!ATTLIST Price
          > > priceatt CDATA #REQUIRED>
          > >
          > > Here is the answer from manage.bat:
          > >
          > > java.lang.IllegalArgumentException: xmlName name must be null when
          > > type is PCDATA.
          > > at
          > org.xmlmiddleware.xmldbms.tools.MapManager.createMapFromDTD
          > > (MapManager.java:614)
          > > at org.xmlmiddleware.xmldbms.tools.MapManager.dispatch
          > > (MapManager.java:407)
          > > at org.xmlmiddleware.xmldbms.tools.MapManager.main
          > > (MapManager.java:348)
          > >
          > > I further investigated and it seems the code is inconsistent. The
          > > method PropertyMap.setXMLName(XMLName xmlName, int type) throws the
          > > exception above because it is passed a non null xmlName for a
          > PCDATA
          > > ClassMap.
          > >
          > > I will continue the investigation, but, if someone realizes I am
          > > missing something, please let me know so I wouldn't waste my time.
        Your message has been successfully submitted and would be delivered to recipients shortly.