473,609 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print the content of a element in a xml file using libxml2 parser.

how we can print the content of the element in a XML file using
libxml2
example:
this is my xml file
<record>
<firstname>myfi le</firstname>
<lastname>yourf ile</lastname>
</record>
know i want to print the content as "myfile" when
i give element firstname
as i m using libxml2 parser.
and i trying 'xpath1.c' given in www.xmlsoft.org code examples.
how can i do this
i m doing xpath2.c correctly.
thank u, in advance
hari
Jun 27 '08 #1
0 1777

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2181
by: laura | last post by:
newbie... expath vs libxml2... libxml2 is an implementation of dom expath is a sax parser both comes with php installation (ie 4.3) both need to have php recompiled:
2
2109
by: Rick | last post by:
Hi.. I've got some code I wrote in PHP that will generate a new argument string for the browser, but the xhtml parser in Firefox and Opera both complain about my use of &var=value pairs. Below is my code that generates the string : function InvokeURL(url_to_forward_to) { try {
6
9709
by: Dave Kuhlman | last post by:
Suppose that I have content that looks like what I've included at the end of this message. Is there something in the standard Python library that will help me parse it, break into the parts separated by the boundary strings, extract headers from each sub-part, etc? Do I need to add something like the following to the beginning? Content-Type: multipart/related; type="multipart/alternative";
6
1610
by: ai2003lian | last post by:
Assuming I have the following two xml file: source.xml: <AllFields> <Group name="G1"> <Field fieldName="f1">Value1</Field> <Field fieldName="f2">Value2</Field> <Field fieldName="f3">Value3</Field>
6
1671
by: Lord0 | last post by:
Hi there, How do I define in a schema that an element (<element>) may have any content i.e. text, other elements, partial elements, angle brackets etc? So all of the following would be valid: <element> aaaaaaa<foo/>bbbbbb<bar/>cccccc
1
4120
by: cesar.ortiz | last post by:
Hi all, I have created an example using libxml2 based in the code that appears in http://xmlsoft.org/python.html. My example processes an enough amount of html files to see that the memory consumption rises till the process ends (I check it with the 'top' command). I don´t know if I am forgetting something in the code, as I have not been able to find any example on the web.
6
4542
by: saumya.agarwal | last post by:
Hi, I am using libxml2 for xml parsing. When the client application sends data to libxml2 in UTF-8 format, it works fine. But, I have a scenarion in which the client application sends data to libxml2 parser in SHIFT-JIS format. The following error is thrown by libxml2 -
3
3543
by: jinendrashankar | last post by:
i am getting following error in my code help me to slove this issue $ gcc -Wall -g -I/usr/include/libxml2/libxml -c create_xml.c In file included from create_xml.c:2: /usr/include/libxml2/libxml/tree.h:20:31: libxml/xmlversion.h: No such file or directory /usr/include/libxml2/libxml/tree.h:880:30: libxml/xmlmemory.h: No such file or directory In file included from create_xml.c:3: /usr/include/libxml2/libxml/parser.h:12:25:...
0
398
by: sharan | last post by:
how we can print the content of the element in a XML file using libxml2 as i want to use it with "xpath" example: this is my xml file <record> <firstname>myfile</firstname> <lastname>yourfile</lastname> </record> know i want to print the content as "myfile" when i give element firstname
0
8091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4032
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4098
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.