OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Default Entity when compose xml file

[ Lists Home | Date Index | Thread Index ]

Title: RE: [xml-dev] Default Entity when compose xml file

Many database vendors are now starting to integrate XQuery as a standard XML Query tool, which can be used against relational tables.  The following is an example of how it is implemented in Oracle, this is a little dirty as it is wrapped in SQL.

SELECT XMLQuery(
  '<countries>
  {
    for $c in ora:view("COUNTRIES")
    return
      <country>
        {$c/ROW/COUNTRY_NAME/text()}
      </country>
  }
  </countries>'
  RETURNING CONTENT )
FROM dual


-----Original Message-----
From: jj long [mailto:longjingjun@yahoo.com.cn]
Sent: 28 October 2005 11:03
To: Michael Rys; xml-dev@lists.xml.org
Subject: RE: [xml-dev] Default Entity when compose xml file


hi Michael,

I agree this is one solution. Perhaps I can not use
this methods if I want to get database independent
capability. Is there any uniform methods in database
which like SQL standard to do this? Since each
database vender has it's own methods and support
different language in the database.

Thansk and Regards,

Long

--- Michael Rys <mrys@microsoft.com> wrote:

> What database system are you using? Most relational
> database systems
> provide some form of rel->XML mapping functionality
> that will take care
> of the entitization. See the XML Publishing
> functions in Oracle or DB2
> or the "FOR XML" clause in SQL Server...
>
> In SQL Server 2005 for example, the following query
> would give you the
> required transformation (with taking care of
> entitization of <,> etc):
>
> SELECT "User name" as "name", description
> FROM table
> FOR XML PATH('person'), ROOT('Data')
>
> Best regards
> Michael
>
> > -----Original Message-----
> > From: jj long [mailto:longjingjun@yahoo.com.cn]
> > Sent: Thursday, October 27, 2005 1:22 AM
> > To: xml-dev@lists.xml.org
> > Subject: [xml-dev] Default Entity when compose xml
> file
> >
> > hi experts,
> >
> > I want to retrieve data from database and compose
> all
> > of the data in to a xml file. For example:
> > Data:
> > User name     description
> > -------------------------------------
> > Philips       This is a funny guy
> > adam          Administrator
> >
> > XML:
> > <Data>
> >     <person>
> >         <name>Philips</name>
> >         <description>This is a funny
> guy</description>
> >     </person>
> >     <person>
> >         <name>adam</name>
> >         <description>Administrator</description>
> >     </person>
> > </Data>
> >
> > My problem is:
> > Sometims, there are <,>,& or other character in
> the
> > data and these character can not directly used in
> xml
> > file.
> >
> > What is your suggestion from your expierence?
> >
> > One solution I am thinking about is:
> > Replace <,>,& and other characters that can not
> used
> > directly in xml data with &lt;, &gt;,&amp; and etc
> in
> > the data before I compose the xml file.
> >
> > An other problem is risen here. Are these entities
> > been defined as default entity in the parser
> (Xerces)?
> > I.e.: can I do not define these entities in the
> xml
> > file?
> >
> > Thanks,
> >
> > Long
> >
> >
> >
> > __________________________________
> > Yahoo! FareChase: Search multiple travel sites in
> one click.
> > http://farechase.yahoo.com
> >
> >
>
-----------------------------------------------------------------
> > The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an
> > initiative of OASIS <http://www.oasis-open.org>
> >
> > The list archives are at
> http://lists.xml.org/archives/xml-dev/
> >
> > To subscribe or unsubscribe from this list use the
> subscription
> > manager:
> <http://www.oasis-open.org/mlmanage/index.php>
>
>
>
-----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager:
> <http://www.oasis-open.org/mlmanage/index.php>
>
>



               
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>

************************************************************************

DISCLAIMER

The information contained in this e-mail is confidential and is intended

for the recipient only.

If you have received it in error, please notify us immediately by reply

e-mail and then delete it from your system. Please do not copy it or

use it for any other purposes, or disclose the content of the e-mail

to any other person or store or copy the information in any medium.

The views contained in this e-mail are those of the author and not

necessarily those of Admenta UK Group.

************************************************************************





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS