MySQL Forums
Forum List  »  Connector/Node.js

Re: XML from mysql tables
Posted by: Virginia O'Connor
Date: December 03, 2007 12:37PM

To add to what Bill has mentioned, and because I work with the product daily, the XAware product lets you quickly build SQL requests. To give you an idea, a request that looks similar to this:

<xa:request>SELECT
ACCOUNTS.ACCOUNTREPS.REPID,
ACCOUNTS.ACCOUNTREPS.DIVNAME,
ACCOUNTS.ACCOUNTREPS.DIVID,
ACCOUNTS.ACCOUNTREPS.LASTNAME,
ACCOUNTS.ACCOUNTREPS.FIRSTNAME,
ACCOUNTS.ACCOUNTREPS.PHONE,
ACCOUNTS.ACCOUNTREPS.STARTDATE,
ACCOUNTS.ACCOUNTREPS.SALARY,
ACCOUNTS.ACCOUNTREPS.REVIEWDATE
FROM
ACCOUNTS.ACCOUNTREPS
WHERE
((ACCOUNTS.ACCOUNTREPS.DIVID LIKE ?))
</xa:request>

... can be mapped to a template, like this:

<xa:row_template>
<representatives>
<rep DivisionID="%DIVID%" DivisionName="%DIVNAME%">
<name>%FIRSTNAME% %LASTNAME%</name>
<start>%STARTDATE%</start>
<salary>%SALARY%</salary>
<reviewDate>%REVIEWDATE%</reviewDate>
</rep>
</representatives>
</xa:row_template>

... and produce XML like this:

<representatives>
<rep DivisionID="NW2" DivisionName="Northwest 2">
<name>Fred Sanders</name>
<start>1999-09-09</start>
<salary>34000.00</salary>
<reviewDate>2005-04-15</reviewDate>
</rep>
</representatives>
<representatives>
<rep DivisionID="NW2" DivisionName="Northwest 2">
<name>Sally Topper</name>
<start>2003-09-09</start>
<salary>43000.00</salary>
<reviewDate>2000-05-18</reviewDate>
</rep>
</representatives>

Of course, you probably have your own XML schema (or at least an idea of the XML structure you want your data to be plugged into). The XAware Designer will easily map the data from your tables to your XML hierarchy.

Good luck!

Virginia
Technical Writer, XAware, Inc.

Options: ReplyQuote


Subject
Written By
Posted
December 03, 2007 12:53AM
December 03, 2007 06:14AM
Re: XML from mysql tables
December 03, 2007 12:37PM
December 03, 2007 11:25PM
December 04, 2007 02:32PM
December 06, 2007 12:05PM
December 08, 2007 12:17AM
December 08, 2007 12:24PM
December 09, 2007 11:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.