discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: GSXPathContext examples ?


From: Nicola Pero
Subject: RE: GSXPathContext examples ?
Date: Sat, 5 Jan 2008 14:56:15 +0100 (CET)

Yes, GSXPathContext has been/is being used succesfully in production systems. 
:-)

Here is a trivial example which I just made up:

<test>
  <item>
    <description>This is an item</description>
    <number>1</number>
  </item>
  <item>
    <description>This is another item</description>
    <number>2</number>
  </item>
</test>

Here are a few demo XPath queries (tested with gnustep-base 1.14.0 + libxml 
2.6.16):

'string(/test/item[1]/description/text())' returns the GSXPathString 'This is 
an item'

'string(/test/item[2]/description/text())' returns the GSXPathString 'This is 
another item'

'//number' returns a GSXPathNodeSet containing two XML_ELEMENT_NODEs, for the 
two
tags <number>

You can find lot more examples on the web.  It's a very nice tool to quickly 
extract
a piece of information from an XML file. :-)

Thanks


-----Original Message-----
From: Philippe Roussel <p.o.roussel@free.fr>
Sent: Thursday, January 3, 2008 3:37pm
To: discuss-gnustep@gnu.org
Subject: GSXPathContext examples ?

Hi all,

I know that GSXPathContext's documentation says I just have to learn
xpath syntax but I would like to know if someone uses GSXPathContext
and its friends successfully.

Any example (xml file and xpath query) verified to work with GNUstep
would be great.

Thanks,
Philippe
-- 
Il est temps pour la race humaine d'entrer dans le système solaire. Dan Quayle



_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep






reply via email to

[Prev in Thread] Current Thread [Next in Thread]