LinuxQuestions.org
Register a domain and help support LQ
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, 04: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 04:47 AM.
 
Old 05-30-2006, 08: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, 03: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 06:29 PM
<n00bie> FEAR (First Encounter Assault and Recon) ntgaston98 Linux - Games 1 10-20-2005 09:20 PM
Installing RH 9 with RAID 5 --Big, big Problem!!! rhonneil Linux - Software 2 09-25-2003 08:13 PM
expat!!! hhegab Linux - Software 6 07-20-2003 08:46 AM
php? expat? apache? tisource Linux - Software 3 04-20-2003 01:38 PM


All times are GMT -5. The time now is 07:46 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration