1
neda_barna
change to xml
  • 2008/2/27 12:47

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


hi i want get data from database and change it to xml
for example properties of one paper
i want get name,lastname,title,....
and change it to xml like this
what must i do??????????/
xml version="1.0" encoding="UTF-8"?>

  
    eng
    Popular Chemistry
    Botanical Magazine
    17497221
    2002-09-04
    98
    2
    1234
    1235
    1234567
    12345
    article
    Roses and Lilies
    Roses und Lilies
    
      
        Fritz Haber 
        fritz.haber@some.university.org
        1
        2
        3
      

    

    
      
        University of A     
      
      
        Universitaty of B
       
      
        University of C
      
    


    




 <= The language tag content must conform to the
    iso 639-2b standard.

 <= Here is the issn number of the journal in which
    the article has been published. If you have an eissn
    number instead then this line should be replaced by
    17497221. If you have both issn
    and eissn numbers then the eissn tag should occur
    after the issn tag. 



 <= If the title occurs in more than one language
    then you may list the titles here. The title tag
    has got the attribute language that must be set
    according to the ISO638.2 standard.



 <= Note that the affilitationId numbers denote the
    affilitations in the affiliationslist below. 

    
      The catalytic formation of ammonia from hydrogen
      and atmospheric nitrogen under conditions of high
      temperature and high pressure.
    
    
      http://www.science.org/articles/HaberBosch.pdf
    
        
      garden
      rose
    
  


  
   ...
  

   ...


2
neda_barna
Re: change to xml
  • 2008/3/1 10:39

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


who can help me???????????????

3
neda_barna
Re: change to xml
  • 2008/3/2 11:45

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


please see this code why it is work but i use it to XOOPS it dosent work
it is into php
$connection mysql_connect("localhost""root""") or die("Could not connect.");
$table_name 'xoops_papers';
$db mysql_select_db("aero2008");
$query "select * from " $table_name;
$result mysql_query($query$connection) or die("Could not complete database query");
$num mysql_num_rows($result);

if (
$num != 0) {

 
$filefopen("results.xml""w");
 
 
$_xml ="1.0" encoding="UTF-8" ?>rn";

 
$_xml .="rn";

 while (
$row mysql_fetch_array($result)) {
 
$ss=$row["sid"];

 if (
$row["sid"]) {

 
$_xml .="t$row["sid"] . "">rn";

 
$_xml .="tt" </span><span style="color: #007700">. </span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">"title"</span><span style="color: #007700">] . </span><span style="color: #DD0000">"rn";
$_xml .="trn";
 } else {

 
$_xml .="tNothing Returned">rn";
$_xml .="ttnonern";

 
$_xml .="trn";
 } }

 
$_xml .="";

 
fwrite($file$_xml);

 
fclose($file);

 echo 
"XML has been written.  results.xml">View the XML.";

 } else {

 echo 
"No Records found";

 }



?>



and it is into xoops
if ( is_http_var'sid' ) ) {
    
$sid get_http_var'sid' ) ;
    
$paper = new RefereePaper$sid );
}  



$title $paper->getVar'title' );
$filefopen("results.xml""w");

 
$_xml ="1.0" encoding="UTF-8" ?>rn";

 
$_xml .="rn";



 if (
$sid) {

 
$_xml .="t$sid . "">rn";

 
$_xml .="tt" </span><span style="color: #007700">. </span><span style="color: #0000BB">$title </span><span style="color: #007700">. </span><span style="color: #DD0000">"rn";
$_xml .="trn";
 } else {

 
$_xml .="tNothing Returned">rn";
$_xml .="ttnonern";

 
$_xml .="trn";
 } 

 
$_xml .="";

 
fwrite($file$_xml);
echo 
$file;
 
fclose($file);


 echo 
"XML has been written.  results.xml">View the XML.";

Login

Who's Online

468 user(s) are online (67 user(s) are browsing Support Forums)


Members: 0


Guests: 468


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits