LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-30-2006, 05:42 AM   #1
SybaseLu
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
Encounter a big problem while using phaser of Expat


Hi guys
Even thought Expat was successfully compiled through, I was still stuck in a big problem, I done like this:
Code:
#cd example
#gcc -g -I/usr/local/include elements.c -o elements  -L/usr/local/lib -lexpat
#./element
(nothing happen, it was suspended forever)
so, I have to press CTRL+C to paused it. I checked over the source of this file and found that it readed XML file from STDIN, so I edited this file :
Code:
#vi element.c
...
FILE *pFile = NULL;
pFile = fopen("test.xml", "rb");
...
size_t len = fread(buf, 1, sizeof(buf), pFile);
...
#gcc -g -I/usr/local/include elements.c -o elements  -L/usr/local/lib -lexpat
#./element
[root@root examples]# ./elements 
Authentication
 user
  username
  password
 user
  username
  password
[root@root examples]#
[root@root examples]#less test.xml 
<?xml version="1.0" encoding="UTF-8" ?> 
 <Authentication>
    <user id="1">
      <username>root</username> 
      <password>root</password> 
    </user>
    <user id="2">
      <username>ctgu</username> 
      <password>ctgu</password> 
   </user>
</Authentication> 
[root@root examples]#
finaly, my question is that how to obtain the context and attributes of element ?
Thanks

Last edited by SybaseLu; 05-30-2006 at 05:47 AM.
 
Old 05-30-2006, 09:10 PM   #2
SybaseLu
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Well, I tried others pharser of XML likes libxml2 etc. But I didn't think that it has good API interface (i.e it so ugly) ,right? In my mind , same as Expat.
 
Old 05-31-2006, 04:31 AM   #3
SybaseLu
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Is there anybody else? Both you are sleeping? Well, I am working now, Because...
Please
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
libxml or Expat slzckboy Programming 0 12-25-2005 07:29 PM
<n00bie> FEAR (First Encounter Assault and Recon) ntgaston98 Linux - Games 1 10-20-2005 10:20 PM
Installing RH 9 with RAID 5 --Big, big Problem!!! rhonneil Linux - Software 2 09-25-2003 09:13 PM
expat!!! hhegab Linux - Software 6 07-20-2003 09:46 AM
php? expat? apache? tisource Linux - Software 3 04-20-2003 02:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration