Jump to content
arthur130237

libxml2 retrieving entities

Recommended Posts

I wonder how could I retrieve the entity information by using libxml2 in the following xml document :

 

1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <?type-proto key="MIPRegistrationRequest" value="mip" ?>
4 <?avp-proto key="Example-AVP" value="data" ?>
5
6 <!DOCTYPE dictionary SYSTEM "dictionary.dtd" [
7 <!-- Any files added here need to be added to Makefile.am and
8 packaging/nsis/wireshark.nsi -->
9
10 <!ENTITY nasreq SYSTEM "nasreq.xml">
11 <!ENTITY eap SYSTEM "eap.xml">
12 <!ENTITY mobileipv4 SYSTEM "mobileipv4.xml">
13 <!ENTITY chargecontrol SYSTEM "chargecontrol.xml">
14 <!ENTITY sunping SYSTEM "sunping.xml">
15 <!ENTITY TGPP SYSTEM "TGPP.xml">
16 <!ENTITY TGPP2 SYSTEM "TGPP2.xml">
17 <!ENTITY sip SYSTEM "sip.xml">
18 <!ENTITY etsie2e4 SYSTEM "etsie2e4.xml">
19 <!ENTITY Ericsson SYSTEM "Ericsson.xml">
20 <!ENTITY mobileipv6 SYSTEM "mobileipv6.xml">
21 <!ENTITY Cisco SYSTEM "Cisco.xml">
22 <!ENTITY Starent SYSTEM "Starent.xml">
23 <!ENTITY Vodafone SYSTEM "Vodafone.xml">
24 <!ENTITY AlcatelLucent SYSTEM "AlcatelLucent.xml">
25 <!ENTITY Nokia SYSTEM "Nokia.xml">
26 <!ENTITY NokiaSolutionsAndNetworks SYSTEM "NokiaSolutionsAndNetworks.xml">
27 <!ENTITY HP SYSTEM "HP.xml">
28 <!ENTITY Oracle SYSTEM "Oracle.xml">
29 <!ENTITY Custom SYSTEM "Custom.xml">
30 ]>

<...>

...

</...>

For example, I want to retrieve all the entity names (for instance : nasreq), and their values (the uri after the word SYSTEM), so as to store them in a linked list (linked data structure in language c).

 

I am using language c, so please give me an answer in c.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...