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

Re: [xml-dbms] Re: Storing XML fragments

Expand Messages
  • Ronald Bourret
    ... OK. I understand now. XML-DBMS cannot support this directly. However, you can get the same effect by doing the following: 1) Use XSLT to add an element to
    Message 1 of 24 , Mar 7, 2001
      pfajeau@... wrote:
      >
      > Actually, my original question was whether I could store part of an
      > XML document as an XML string in the database. As an example:
      >
      > <Customer>
      > <ID>123</ID>
      > <Phone>123</Phone>
      > <Address>121 Main street</Address>
      > <Type>Residential</Type>
      > </Customer>
      >
      > I want to store customers in the database. But, I really want to have
      > two columns: one for the ID, the other one containing the remaining
      > fields as an XML fragment, i.e:
      >
      > <Phone>123<//Phone>
      > <Address>121 Main street</Address>
      > <Type>Residential</Type>
      >
      > The database schema would look like:
      >
      > Customer
      > ID
      > Attributes <-- XML fragment goes there.
      >
      > This is useful when dealing with schema that have "volatile"
      > sections. Modifying a database schema can be quite a pain... If XML
      > is stored as XML, The application is now responsible to handle new
      > attributes that might appear in the Customer DTD.

      OK. I understand now.

      XML-DBMS cannot support this directly. However, you can get the same
      effect by doing the following:

      1) Use XSLT to add an element to "wrap" the volatile section. For
      example:

      <Customer>
      <ID>123</ID>
      <Attributes>
      <Phone>123</Phone>
      <Address>121 Main street</Address>
      <Type>Residential</Type>
      </Attributes>
      </Customer>

      Now map the wrapper to the Attributes column using a PropertyMap as I
      described in my previous email. Its content (an XML fragment) will be
      stored in the column as you want.

      --
      Ronald Bourret
      Programming, Writing, and Training
      XML, Databases, and Schemas
      http://www.rpbourret.com
    • Fajeau, Philippe
      Thanks Ron, this does respond to my question. Looks like a reasonable workaround. Is there any intent to allow the storage of XML fragments (as described in
      Message 2 of 24 , Mar 7, 2001
        Thanks Ron, this does respond to my question. Looks like a reasonable
        workaround. Is there any intent to allow the storage of XML fragments (as
        described in the example and without going through a transformation) in a
        future release? Is it a feature that people would consider useful?

        Philippe

        > -----Original Message-----
        > From: Ronald Bourret [mailto:rpbourret@...]
        > Sent: Wednesday, March 07, 2001 3:09 PM
        > To: xml-dbms@yahoogroups.com
        > Subject: Re: [xml-dbms] Re: Storing XML fragments
        >
        >
        > pfajeau@... wrote:
        > >
        > > Actually, my original question was whether I could store part of an
        > > XML document as an XML string in the database. As an example:
        > >
        > > <Customer>
        > > <ID>123</ID>
        > > <Phone>123</Phone>
        > > <Address>121 Main street</Address>
        > > <Type>Residential</Type>
        > > </Customer>
        > >
        > > I want to store customers in the database. But, I really
        > want to have
        > > two columns: one for the ID, the other one containing the remaining
        > > fields as an XML fragment, i.e:
        > >
        > > <Phone>123<//Phone>
        > > <Address>121 Main street</Address>
        > > <Type>Residential</Type>
        > >
        > > The database schema would look like:
        > >
        > > Customer
        > > ID
        > > Attributes <-- XML fragment goes there.
        > >
        > > This is useful when dealing with schema that have "volatile"
        > > sections. Modifying a database schema can be quite a pain... If XML
        > > is stored as XML, The application is now responsible to handle new
        > > attributes that might appear in the Customer DTD.
        >
        > OK. I understand now.
        >
        > XML-DBMS cannot support this directly. However, you can get the same
        > effect by doing the following:
        >
        > 1) Use XSLT to add an element to "wrap" the volatile section. For
        > example:
        >
        > <Customer>
        > <ID>123</ID>
        > <Attributes>
        > <Phone>123</Phone>
        > <Address>121 Main street</Address>
        > <Type>Residential</Type>
        > </Attributes>
        > </Customer>
        >
        > Now map the wrapper to the Attributes column using a PropertyMap as I
        > described in my previous email. Its content (an XML fragment) will be
        > stored in the column as you want.
        >
        > --
        > Ronald Bourret
        > Programming, Writing, and Training
        > XML, Databases, and Schemas
        > http://www.rpbourret.com
        >
        > ------------------------ Yahoo! Groups Sponsor
        > ---------------------~-~>
        > Find software faster. Search more than 20,000
        > software solutions on KnowledgeStorm. Register
        > now and get started.
        > http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/2n6YlB/TM
        > --------------------------------------------------------------
        > -------_->
        >
        > 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/
        >
        >
      • Fruetel John
        I consider this very useful. We store XML in the database all the time around here, although we usually store it inside CLOB columns. I think that this
        Message 3 of 24 , Mar 7, 2001
          I consider this very useful. We store XML in the database all the time
          around here, although we usually store it inside CLOB columns.

          I think that this particular 'feature' wil happen when CLOB support is
          added... I'm going to propose to Ron that XML-DBMS store CLOBs the same way
          that our VB XMLToSQL does; by first encoding them as MIME data inside the
          XML then decoding it inside XML-DBMS. This is really the only way I can
          think of to get BLOB/CLOB data inside the XML.

          Once encoded into MIME, data of any format can be stored directly inside the
          XML.

          -----Original Message-----
          From: Fajeau, Philippe [mailto:pfajeau@...]
          Sent: Wednesday, March 07, 2001 3:37 PM
          To: 'xml-dbms@yahoogroups.com'
          Subject: RE: [xml-dbms] Re: Storing XML fragments


          Thanks Ron, this does respond to my question. Looks like a reasonable
          workaround. Is there any intent to allow the storage of XML fragments (as
          described in the example and without going through a transformation) in a
          future release? Is it a feature that people would consider useful?

          Philippe

          > -----Original Message-----
          > From: Ronald Bourret [mailto:rpbourret@...]
          > Sent: Wednesday, March 07, 2001 3:09 PM
          > To: xml-dbms@yahoogroups.com
          > Subject: Re: [xml-dbms] Re: Storing XML fragments
          >
          >
          > pfajeau@... wrote:
          > >
          > > Actually, my original question was whether I could store part of an
          > > XML document as an XML string in the database. As an example:
          > >
          > > <Customer>
          > > <ID>123</ID>
          > > <Phone>123</Phone>
          > > <Address>121 Main street</Address>
          > > <Type>Residential</Type>
          > > </Customer>
          > >
          > > I want to store customers in the database. But, I really
          > want to have
          > > two columns: one for the ID, the other one containing the remaining
          > > fields as an XML fragment, i.e:
          > >
          > > <Phone>123<//Phone>
          > > <Address>121 Main street</Address>
          > > <Type>Residential</Type>
          > >
          > > The database schema would look like:
          > >
          > > Customer
          > > ID
          > > Attributes <-- XML fragment goes there.
          > >
          > > This is useful when dealing with schema that have "volatile"
          > > sections. Modifying a database schema can be quite a pain... If XML
          > > is stored as XML, The application is now responsible to handle new
          > > attributes that might appear in the Customer DTD.
          >
          > OK. I understand now.
          >
          > XML-DBMS cannot support this directly. However, you can get the same
          > effect by doing the following:
          >
          > 1) Use XSLT to add an element to "wrap" the volatile section. For
          > example:
          >
          > <Customer>
          > <ID>123</ID>
          > <Attributes>
          > <Phone>123</Phone>
          > <Address>121 Main street</Address>
          > <Type>Residential</Type>
          > </Attributes>
          > </Customer>
          >
          > Now map the wrapper to the Attributes column using a PropertyMap as I
          > described in my previous email. Its content (an XML fragment) will be
          > stored in the column as you want.
          >
          > --
          > Ronald Bourret
          > Programming, Writing, and Training
          > XML, Databases, and Schemas
          > http://www.rpbourret.com
          >
          > ------------------------ Yahoo! Groups Sponsor
          > ---------------------~-~>
          > Find software faster. Search more than 20,000
          > software solutions on KnowledgeStorm. Register
          > now and get started.
          > http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/2n6YlB/TM
          > --------------------------------------------------------------
          > -------_->
          >
          > 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/
          >
          >


          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/
        • Hani Elabed
          Greetings, I am a newbie to this list, not a newbie to XML, Messaging, and SQL and Java though... I looked at Ron s Data Transfer and DtdToDatabases Power
          Message 4 of 24 , Mar 7, 2001
            Greetings,

            I am a newbie to this list,
            not a newbie to XML, Messaging, and SQL
            and Java though...

            I looked at Ron's Data Transfer and DtdToDatabases
            Power point presentations... Excellent work Ron's

            I can even say... "we are not worthy !!"

            Anyway, I am in a discovery stage of the
            xml-dbms work, so my only question is...

            Are there any open source MIME Encoders and Decoders
            for Java??

            Any reference URLs to such a site would be appreciated...

            Thanks again Ron for the great presentations...

            Hani Elabed

            PS: Did John Fruetel get a chance to post
            his VB XmlToSQL specification document ??

            Fruetel John wrote:

            > I consider this very useful. We store XML in the database all the time
            > around here, although we usually store it inside CLOB columns.
            >
            > I think that this particular 'feature' wil happen when CLOB support is
            > added... I'm going to propose to Ron that XML-DBMS store CLOBs the same way
            > that our VB XMLToSQL does; by first encoding them as MIME data inside the
            > XML then decoding it inside XML-DBMS. This is really the only way I can
            > think of to get BLOB/CLOB data inside the XML.
            >
            > Once encoded into MIME, data of any format can be stored directly inside the
            > XML.
            >
            > -----Original Message-----
            > From: Fajeau, Philippe [mailto:pfajeau@...]
            > Sent: Wednesday, March 07, 2001 3:37 PM
            > To: 'xml-dbms@yahoogroups.com'
            > Subject: RE: [xml-dbms] Re: Storing XML fragments
            >
            > Thanks Ron, this does respond to my question. Looks like a reasonable
            > workaround. Is there any intent to allow the storage of XML fragments (as
            > described in the example and without going through a transformation) in a
            > future release? Is it a feature that people would consider useful?
            >
            > Philippe
            >
            > > -----Original Message-----
            > > From: Ronald Bourret [mailto:rpbourret@...]
            > > Sent: Wednesday, March 07, 2001 3:09 PM
            > > To: xml-dbms@yahoogroups.com
            > > Subject: Re: [xml-dbms] Re: Storing XML fragments
            > >
            > >
            > > pfajeau@... wrote:
            > > >
            > > > Actually, my original question was whether I could store part of an
            > > > XML document as an XML string in the database. As an example:
            > > >
            > > > <Customer>
            > > > <ID>123</ID>
            > > > <Phone>123</Phone>
            > > > <Address>121 Main street</Address>
            > > > <Type>Residential</Type>
            > > > </Customer>
            > > >
            > > > I want to store customers in the database. But, I really
            > > want to have
            > > > two columns: one for the ID, the other one containing the remaining
            > > > fields as an XML fragment, i.e:
            > > >
            > > > <Phone>123<//Phone>
            > > > <Address>121 Main street</Address>
            > > > <Type>Residential</Type>
            > > >
            > > > The database schema would look like:
            > > >
            > > > Customer
            > > > ID
            > > > Attributes <-- XML fragment goes there.
            > > >
            > > > This is useful when dealing with schema that have "volatile"
            > > > sections. Modifying a database schema can be quite a pain... If XML
            > > > is stored as XML, The application is now responsible to handle new
            > > > attributes that might appear in the Customer DTD.
            > >
            > > OK. I understand now.
            > >
            > > XML-DBMS cannot support this directly. However, you can get the same
            > > effect by doing the following:
            > >
            > > 1) Use XSLT to add an element to "wrap" the volatile section. For
            > > example:
            > >
            > > <Customer>
            > > <ID>123</ID>
            > > <Attributes>
            > > <Phone>123</Phone>
            > > <Address>121 Main street</Address>
            > > <Type>Residential</Type>
            > > </Attributes>
            > > </Customer>
            > >
            > > Now map the wrapper to the Attributes column using a PropertyMap as I
            > > described in my previous email. Its content (an XML fragment) will be
            > > stored in the column as you want.
            > >
            > > --
            > > Ronald Bourret
            > > Programming, Writing, and Training
            > > XML, Databases, and Schemas
            > > http://www.rpbourret.com
            > >
            > > ------------------------ Yahoo! Groups Sponsor
            > > ---------------------~-~>
            > > Find software faster. Search more than 20,000
            > > software solutions on KnowledgeStorm. Register
            > > now and get started.
            > > http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/2n6YlB/TM
            > > --------------------------------------------------------------
            > > -------_->
            > >
            > > 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/
            > >
            > >
            >
            > 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/
            >
            >
            > 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/
          • adam flinton
            ... On the newsgroup. Adam
            Message 5 of 24 , Mar 8, 2001
              > -----Original Message-----
              > From: Hani Elabed [mailto:hani@...]
              > Sent: 08 March 2001 02:50
              > To: xml-dbms@yahoogroups.com; hani; hani.elabed
              > Subject: Re: [xml-dbms] Re: Storing XML fragments
              >
              > PS: Did John Fruetel get a chance to post
              > his VB XmlToSQL specification document ??
              >

              On the newsgroup.

              Adam
            • Fruetel John
              The Giant Java Tree (www.gjt.org) has some open source MIME (Base64) encoders/decoders. ... From: Hani Elabed [mailto:hani@elabed.net] Sent: Wednesday, March
              Message 6 of 24 , Mar 8, 2001
                The Giant Java Tree (www.gjt.org) has some open source MIME (Base64)
                encoders/decoders.

                -----Original Message-----
                From: Hani Elabed [mailto:hani@...]
                Sent: Wednesday, March 07, 2001 6:50 PM
                To: xml-dbms@yahoogroups.com; hani; hani.elabed
                Subject: Re: [xml-dbms] Re: Storing XML fragments


                Greetings,

                I am a newbie to this list,
                not a newbie to XML, Messaging, and SQL
                and Java though...

                I looked at Ron's Data Transfer and DtdToDatabases
                Power point presentations... Excellent work Ron's

                I can even say... "we are not worthy !!"

                Anyway, I am in a discovery stage of the
                xml-dbms work, so my only question is...

                Are there any open source MIME Encoders and Decoders
                for Java??

                Any reference URLs to such a site would be appreciated...

                Thanks again Ron for the great presentations...

                Hani Elabed

                PS: Did John Fruetel get a chance to post
                his VB XmlToSQL specification document ??

                Fruetel John wrote:

                > I consider this very useful. We store XML in the database all the time
                > around here, although we usually store it inside CLOB columns.
                >
                > I think that this particular 'feature' wil happen when CLOB support is
                > added... I'm going to propose to Ron that XML-DBMS store CLOBs the same
                way
                > that our VB XMLToSQL does; by first encoding them as MIME data inside the
                > XML then decoding it inside XML-DBMS. This is really the only way I can
                > think of to get BLOB/CLOB data inside the XML.
                >
                > Once encoded into MIME, data of any format can be stored directly inside
                the
                > XML.
                >
                > -----Original Message-----
                > From: Fajeau, Philippe [mailto:pfajeau@...]
                > Sent: Wednesday, March 07, 2001 3:37 PM
                > To: 'xml-dbms@yahoogroups.com'
                > Subject: RE: [xml-dbms] Re: Storing XML fragments
                >
                > Thanks Ron, this does respond to my question. Looks like a reasonable
                > workaround. Is there any intent to allow the storage of XML fragments (as
                > described in the example and without going through a transformation) in a
                > future release? Is it a feature that people would consider useful?
                >
                > Philippe
                >
                > > -----Original Message-----
                > > From: Ronald Bourret [mailto:rpbourret@...]
                > > Sent: Wednesday, March 07, 2001 3:09 PM
                > > To: xml-dbms@yahoogroups.com
                > > Subject: Re: [xml-dbms] Re: Storing XML fragments
                > >
                > >
                > > pfajeau@... wrote:
                > > >
                > > > Actually, my original question was whether I could store part of an
                > > > XML document as an XML string in the database. As an example:
                > > >
                > > > <Customer>
                > > > <ID>123</ID>
                > > > <Phone>123</Phone>
                > > > <Address>121 Main street</Address>
                > > > <Type>Residential</Type>
                > > > </Customer>
                > > >
                > > > I want to store customers in the database. But, I really
                > > want to have
                > > > two columns: one for the ID, the other one containing the remaining
                > > > fields as an XML fragment, i.e:
                > > >
                > > > <Phone>123<//Phone>
                > > > <Address>121 Main street</Address>
                > > > <Type>Residential</Type>
                > > >
                > > > The database schema would look like:
                > > >
                > > > Customer
                > > > ID
                > > > Attributes <-- XML fragment goes there.
                > > >
                > > > This is useful when dealing with schema that have "volatile"
                > > > sections. Modifying a database schema can be quite a pain... If XML
                > > > is stored as XML, The application is now responsible to handle new
                > > > attributes that might appear in the Customer DTD.
                > >
                > > OK. I understand now.
                > >
                > > XML-DBMS cannot support this directly. However, you can get the same
                > > effect by doing the following:
                > >
                > > 1) Use XSLT to add an element to "wrap" the volatile section. For
                > > example:
                > >
                > > <Customer>
                > > <ID>123</ID>
                > > <Attributes>
                > > <Phone>123</Phone>
                > > <Address>121 Main street</Address>
                > > <Type>Residential</Type>
                > > </Attributes>
                > > </Customer>
                > >
                > > Now map the wrapper to the Attributes column using a PropertyMap as I
                > > described in my previous email. Its content (an XML fragment) will be
                > > stored in the column as you want.
                > >
                > > --
                > > Ronald Bourret
                > > Programming, Writing, and Training
                > > XML, Databases, and Schemas
                > > http://www.rpbourret.com
                > >
                > > ------------------------ Yahoo! Groups Sponsor
                > > ---------------------~-~>
                > > Find software faster. Search more than 20,000
                > > software solutions on KnowledgeStorm. Register
                > > now and get started.
                > > http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/2n6YlB/TM
                > > --------------------------------------------------------------
                > > -------_->
                > >
                > > 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/
                > >
                > >
                >
                > 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/
                >
                >
                > 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/



                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
                ... I ll add it to the feature list. Yours is the first request for it, whereas I ve gotten numerous requests for the other functionality (flattening
                Message 7 of 24 , Mar 8, 2001
                  "Fajeau, Philippe" wrote:
                  >
                  > Thanks Ron, this does respond to my question. Looks like a reasonable
                  > workaround. Is there any intent to allow the storage of XML fragments (as
                  > described in the example and without going through a transformation) in a
                  > future release? Is it a feature that people would consider useful?

                  I'll add it to the feature list. Yours is the first request for it,
                  whereas I've gotten numerous requests for the other functionality
                  (flattening structure, as described in the previous email).

                  One tricky thing about both is setting the ground rules for the cases in
                  which they can be used. For example, the other functionality (as
                  currently envisioned) won't work in all cases. Fortunately, it will work
                  in many useful cases. I'll have to think about your proposed
                  functionality to see if any restrictions are needed. (My initial guess
                  is no, but you never know until you dig.)

                  --
                  Ronald Bourret
                  Programming, Writing, and Training
                  XML, Databases, and Schemas
                  http://www.rpbourret.com
                • Ronald Bourret
                  ... There is a definite difference between BLOBs and CLOBs here. Assuming the JDBC driver is correctly written (and enough memory is available) CLOBs are
                  Message 8 of 24 , Mar 8, 2001
                    Fruetel John wrote:
                    > I'm going to propose to Ron that XML-DBMS store CLOBs the same way
                    > that our VB XMLToSQL does; by first encoding them as MIME data inside the
                    > XML then decoding it inside XML-DBMS. This is really the only way I can
                    > think of to get BLOB/CLOB data inside the XML.
                    >
                    > Once encoded into MIME, data of any format can be stored directly inside the
                    > XML.

                    There is a definite difference between BLOBs and CLOBs here. Assuming
                    the JDBC driver is correctly written (and enough memory is available)
                    CLOBs are already supported. At the transfer level, they simply result
                    in a String that represents the CLOB. This is added directly to the XML
                    document.

                    A useful addition in the future would be to add streaming support for
                    CLOBs so less memory is required.

                    BLOBs, on the other hand, are not currently supported. I don't know
                    enough about MIME to understand what "encoded into MIME" means. However,
                    I'm guessing that this is encoding into Base64?

                    The other possibility is to use unparsed entities and simply place the
                    binary data in an external file/URL. The current problem with this is
                    that DOM level 1 doesn't allow you to create new entities (I'm not sure
                    about level 2), so this can't be used to transfer data from the database
                    to XML.

                    -- Ron
                  • Fruetel John
                    Yes, MIME is another name for Base64 encoding. Storing the BLOBs in an external file is a bad idea. Here s why; I envision XML-DBMS being an EJB service
                    Message 9 of 24 , Mar 9, 2001
                      Yes, MIME is another name for Base64 encoding. Storing the BLOBs in an
                      external file is a bad idea. Here's why;

                      I envision XML-DBMS being an EJB service someday where EVERYTHING is passed
                      to it via RMI. This means that all the data related will have to be encoded
                      inside the XML.

                      As far as CLOB support already being there, I guess your right. Since a
                      clob is just a form of a string, I suppose that this could be used now. I'm
                      not quite clear how this works though; does XML-DBMS expect that the CLOB
                      data be contained inside an Attribute? Isn't there a limit to how long an
                      attribute can be?

                      -----Original Message-----
                      From: Ronald Bourret [mailto:rpbourret@...]
                      Sent: Thursday, March 08, 2001 2:27 PM
                      To: xml-dbms@yahoogroups.com
                      Subject: Re: [xml-dbms] Re: Storing XML fragments


                      Fruetel John wrote:
                      > I'm going to propose to Ron that XML-DBMS store CLOBs the same way
                      > that our VB XMLToSQL does; by first encoding them as MIME data inside the
                      > XML then decoding it inside XML-DBMS. This is really the only way I can
                      > think of to get BLOB/CLOB data inside the XML.
                      >
                      > Once encoded into MIME, data of any format can be stored directly inside
                      the
                      > XML.

                      There is a definite difference between BLOBs and CLOBs here. Assuming
                      the JDBC driver is correctly written (and enough memory is available)
                      CLOBs are already supported. At the transfer level, they simply result
                      in a String that represents the CLOB. This is added directly to the XML
                      document.

                      A useful addition in the future would be to add streaming support for
                      CLOBs so less memory is required.

                      BLOBs, on the other hand, are not currently supported. I don't know
                      enough about MIME to understand what "encoded into MIME" means. However,
                      I'm guessing that this is encoding into Base64?

                      The other possibility is to use unparsed entities and simply place the
                      binary data in an external file/URL. The current problem with this is
                      that DOM level 1 doesn't allow you to create new entities (I'm not sure
                      about level 2), so this can't be used to transfer data from the database
                      to XML.

                      -- Ron


                      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
                      ... Fair enough. As I mentioned before, there are technical problems creating unparsed entities anyway. ... It is used right now. One thing to note is that,
                      Message 10 of 24 , Mar 13, 2001
                        Fruetel John wrote:
                        >
                        > Yes, MIME is another name for Base64 encoding. Storing the BLOBs in an
                        > external file is a bad idea. Here's why;
                        >
                        > I envision XML-DBMS being an EJB service someday where EVERYTHING is passed
                        > to it via RMI. This means that all the data related will have to be encoded
                        > inside the XML.

                        Fair enough. As I mentioned before, there are technical problems
                        creating unparsed entities anyway.

                        > As far as CLOB support already being there, I guess your right. Since a
                        > clob is just a form of a string, I suppose that this could be used now.

                        It is used right now. One thing to note is that, although the JDBC spec
                        states that CLOBs can be mapped to Strings, not all drivers support
                        this. (In particular, the JDBC-ODBC bridge from Sun does not support
                        this.) Something that should be changed in the future is to have
                        XML-DBMS use the streaming interfaces to pass data to and from CLOBs in
                        pieces. However, nobody has asked for this yet, so it is low priority.

                        > I'm
                        > not quite clear how this works though; does XML-DBMS expect that the CLOB
                        > data be contained inside an Attribute? Isn't there a limit to how long an
                        > attribute can be?

                        The data can come from an element or an attribute. XML places no limits
                        on the length of either.

                        Note that, with respect to the original question about storing document
                        fragments, when an element type is mapped as a property, XML-DBMS
                        serializes the element's content as XML. For PCDATA-only elements, this
                        is just text, but for elements with element or mixed content, this has
                        markup as well. For example, consider the following XML:

                        <Part>
                        <Number>123</Number>
                        <Description>My <b>bold</b> description.</Description>
                        </Part>

                        If Number and Description are mapped as properties, the content of
                        Number is:

                        123

                        and the content of Description is:

                        My <b>bold</b> description.

                        The latter shows how you can store document fragments in the database.

                        --
                        Ronald Bourret
                        Programming, Writing, and Training
                        XML, Databases, and Schemas
                        http://www.rpbourret.com
                      • adam flinton
                        ... You can often use Long VarChar instead. That seems to map both the LVC es & CLOBS (Don t know why but it works). I say that as the DB2 CLOB JDBC driver
                        Message 11 of 24 , Mar 14, 2001
                          > > As far as CLOB support already being there, I guess your
                          > right. Since a
                          > > clob is just a form of a string, I suppose that this could
                          > be used now.
                          >
                          > It is used right now. One thing to note is that, although the
                          > JDBC spec
                          > states that CLOBs can be mapped to Strings, not all drivers support
                          > this. (In particular, the JDBC-ODBC bridge from Sun does not support
                          > this.) Something that should be changed in the future is to have
                          > XML-DBMS use the streaming interfaces to pass data to and
                          > from CLOBs in
                          > pieces. However, nobody has asked for this yet, so it is low priority.
                          >

                          You can often use Long VarChar instead. That seems to map both the LVC'es &
                          CLOBS (Don't know why but it works). I say that as the DB2 CLOB <> JDBC
                          driver / handling used to be pretty poor but it's handling of LVC'es (inc
                          CLOBs in the DB) was pretty faultless.

                          Maybe it's just DB2.....

                          Adam
                        • Ronald Bourret
                          What makes a long varchar different from a CLOB? I always thought they were the same. Perhaps there is a length limit to LVCs and not to CLOBs? -- Ron
                          Message 12 of 24 , Mar 14, 2001
                            What makes a long varchar different from a CLOB? I always thought they
                            were the same. Perhaps there is a length limit to LVCs and not to CLOBs?

                            -- Ron

                            adam flinton wrote:
                            >
                            > You can often use Long VarChar instead. That seems to map both the LVC'es &
                            > CLOBS (Don't know why but it works). I say that as the DB2 CLOB <> JDBC
                            > driver / handling used to be pretty poor but it's handling of LVC'es (inc
                            > CLOBs in the DB) was pretty faultless.
                          • adam flinton
                            ... CLOBS BLOBS & similar things (e.g. autoinc ing fields) are handled differently (@ all.....) by differing DB vendors. It sounds weird I know. Personally I
                            Message 13 of 24 , Mar 15, 2001
                              > -----Original Message-----
                              > From: Ronald Bourret [mailto:rpbourret@...]
                              > Sent: 15 March 2001 00:22
                              > To: xml-dbms@yahoogroups.com
                              > Subject: Re: [xml-dbms] Re: Storing XML fragments
                              >
                              >
                              > What makes a long varchar different from a CLOB? I always thought they
                              > were the same. Perhaps there is a length limit to LVCs and
                              > not to CLOBs?

                              CLOBS BLOBS & similar things (e.g. autoinc'ing fields) are handled
                              differently (@ all.....) by differing DB vendors.

                              It sounds weird I know. Personally I just reckon they should mirror the
                              exact same types as SQL92. Sometimes dealing with CLOBS VARCHAR will do
                              sometimes LVC.

                              Go figure... maybe it was just the immaturity of the JDBC drivers.

                              Adam
                            • Fruetel John
                              Well, something that always used to burn us with ODBC is that no one ever really seemed to follow the spec to the letter. Like it or not, I can see the day
                              Message 14 of 24 , Mar 15, 2001
                                Well, something that always used to burn us with ODBC is that no one ever
                                really seemed to follow the spec to the letter. Like it or not, I can see
                                the day when XML-DBMS has stuff like 'If this is DB2, do it this way, if
                                it's Oracle, then do it this way, if it's SQL*Server, do it this way'.

                                This is ugly, but at least it shields the XML-DBMS users from the ugliness
                                that may be going on under the hood.


                                -----Original Message-----
                                From: adam flinton [mailto:aflinton@...]
                                Sent: Wednesday, March 14, 2001 2:10 AM
                                To: 'xml-dbms@yahoogroups.com'
                                Subject: RE: [xml-dbms] Re: Storing XML fragments



                                > > As far as CLOB support already being there, I guess your
                                > right. Since a
                                > > clob is just a form of a string, I suppose that this could
                                > be used now.
                                >
                                > It is used right now. One thing to note is that, although the
                                > JDBC spec
                                > states that CLOBs can be mapped to Strings, not all drivers support
                                > this. (In particular, the JDBC-ODBC bridge from Sun does not support
                                > this.) Something that should be changed in the future is to have
                                > XML-DBMS use the streaming interfaces to pass data to and
                                > from CLOBs in
                                > pieces. However, nobody has asked for this yet, so it is low priority.
                                >

                                You can often use Long VarChar instead. That seems to map both the LVC'es &
                                CLOBS (Don't know why but it works). I say that as the DB2 CLOB <> JDBC
                                driver / handling used to be pretty poor but it's handling of LVC'es (inc
                                CLOBs in the DB) was pretty faultless.

                                Maybe it's just DB2.....

                                Adam


                                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/
                              • Fruetel John
                                Don t count on it Adam. The ODBC stuff never really standardized, I don t see why the JDBC vendors would. ... From: adam flinton
                                Message 15 of 24 , Mar 15, 2001
                                  Don't count on it Adam. The ODBC stuff never really standardized, I don't
                                  see why the JDBC vendors would.

                                  -----Original Message-----
                                  From: adam flinton [mailto:aflinton@...]
                                  Sent: Thursday, March 15, 2001 3:13 AM
                                  To: 'xml-dbms@yahoogroups.com'
                                  Subject: RE: [xml-dbms] Re: Storing XML fragments




                                  > -----Original Message-----
                                  > From: Ronald Bourret [mailto:rpbourret@...]
                                  > Sent: 15 March 2001 00:22
                                  > To: xml-dbms@yahoogroups.com
                                  > Subject: Re: [xml-dbms] Re: Storing XML fragments
                                  >
                                  >
                                  > What makes a long varchar different from a CLOB? I always thought they
                                  > were the same. Perhaps there is a length limit to LVCs and
                                  > not to CLOBs?

                                  CLOBS BLOBS & similar things (e.g. autoinc'ing fields) are handled
                                  differently (@ all.....) by differing DB vendors.

                                  It sounds weird I know. Personally I just reckon they should mirror the
                                  exact same types as SQL92. Sometimes dealing with CLOBS VARCHAR will do
                                  sometimes LVC.

                                  Go figure... maybe it was just the immaturity of the JDBC drivers.

                                  Adam




                                  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/
                                • adam flinton
                                  ... Yup. I suggested this a while back. A Quick & easy example is the simple fact that Oracle has it s own f***ing date type....Which is loony....so believe it
                                  Message 16 of 24 , Mar 15, 2001
                                    > -----Original Message-----
                                    > From: Fruetel John [mailto:jfruetel@...]
                                    > Sent: 15 March 2001 16:53
                                    > To: 'xml-dbms@yahoogroups.com'
                                    > Subject: RE: [xml-dbms] Re: Storing XML fragments
                                    >
                                    >
                                    > Well, something that always used to burn us with ODBC is that
                                    > no one ever
                                    > really seemed to follow the spec to the letter. Like it or
                                    > not, I can see
                                    > the day when XML-DBMS has stuff like 'If this is DB2, do it
                                    > this way, if
                                    > it's Oracle, then do it this way, if it's SQL*Server, do it this way'.
                                    >
                                    > This is ugly, but at least it shields the XML-DBMS users from
                                    > the ugliness
                                    > that may be going on under the hood.

                                    Yup. I suggested this a while back. A Quick & easy example is the simple
                                    fact that Oracle has it's own f***ing date type....Which is loony....so
                                    believe it or not I have to have a method such as:

                                    public String formatForOracleNoWrapper(Date D) {

                                    return (new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S").format(D) );
                                    }


                                    Adam
                                  • Fruetel John
                                    That s right. And so far, it s my experience that it gets even uglier with LOB data.... ... From: adam flinton [mailto:aflinton@armature.com] Sent: Thursday,
                                    Message 17 of 24 , Mar 15, 2001
                                      That's right. And so far, it's my experience that it gets even uglier with
                                      LOB data....

                                      -----Original Message-----
                                      From: adam flinton [mailto:aflinton@...]
                                      Sent: Thursday, March 15, 2001 9:23 AM
                                      To: 'xml-dbms@yahoogroups.com'
                                      Subject: RE: [xml-dbms] Re: Storing XML fragments




                                      > -----Original Message-----
                                      > From: Fruetel John [mailto:jfruetel@...]
                                      > Sent: 15 March 2001 16:53
                                      > To: 'xml-dbms@yahoogroups.com'
                                      > Subject: RE: [xml-dbms] Re: Storing XML fragments
                                      >
                                      >
                                      > Well, something that always used to burn us with ODBC is that
                                      > no one ever
                                      > really seemed to follow the spec to the letter. Like it or
                                      > not, I can see
                                      > the day when XML-DBMS has stuff like 'If this is DB2, do it
                                      > this way, if
                                      > it's Oracle, then do it this way, if it's SQL*Server, do it this way'.
                                      >
                                      > This is ugly, but at least it shields the XML-DBMS users from
                                      > the ugliness
                                      > that may be going on under the hood.

                                      Yup. I suggested this a while back. A Quick & easy example is the simple
                                      fact that Oracle has it's own f***ing date type....Which is loony....so
                                      believe it or not I have to have a method such as:

                                      public String formatForOracleNoWrapper(Date D) {

                                      return (new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S").format(D) );
                                      }


                                      Adam


                                      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/
                                    • Roy Rivers
                                      I m trying to set things up so I can retrieve data from any one of a number of database tables using a single map file. For instance, say I have two database
                                      Message 18 of 24 , Apr 9, 2001
                                        I'm trying to set things up so I can retrieve data from any one of a number
                                        of database tables using a single map file. For instance, say I have two
                                        database tables, TableA, and TableB. I'd like to be able to use result sets
                                        from queries such as the following to retrieve data via
                                        dbmsToDOM.retrieveDocument using a common map file:
                                        SELECT * FROM TableA
                                        SELECT * FROM TableB
                                        The sales_rs1 map from the examples clearly shows how to structure a map
                                        file to support a single table. Trying to extend this to multiple tables
                                        produces "InvalidMapException: More than one class mapped to the table:
                                        Result Set." Is there a way to achieve this?
                                        Thanks.
                                      Your message has been successfully submitted and would be delivered to recipients shortly.