Jump to content

libxml2 retrieving entities


arthur130237
 Share

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...