[sql2xml] Define attributes and commented fields ?
| From: | Daniel García | Date: | Fri, 10 Sep 2004 08:06:58 +0000 |
| Subject: | [sql2xml] Define attributes and commented fields ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14483@lists.php.net to get a copy of this message | ||
Hello all,
I'm in the process of creating code to export the data in a table to an xml file, but instead of transforming all the fetched DB fields into elements, I need to parse some DB fields into attributes, and others as comments.
For example, the DB row is:
+----------+---------------------+-----------+--------+---------+------------+----------+-------------+
| textID | date | pageID | weight | visible | notes | text_es | text_en |+----------+---------------------+-----------+--------+---------+------------+----------+-------------+
| 430 | 2004-09-09 18:11:28 | 1 | 10 | 1 | Main screen| Volver | |+----------+---------------------+-----------+--------+---------+------------+----------+-------------+ <?xml version="1.0"?> <root>
<result>
<row>
<!-- Main screen -->
<text textID=430>Volver</text> </row>
</result>
</root>
That is, convert the "notes" field into a comment line, and use textID as an attribute.
This way, I can pass the generated xml file to a translator, who will be able to import it into a Translation tool and work only on the original text.
Any help / hint will be appreciated.
TIA
-- Daniel