Does libxml2 support XPath 2.0 or not? - objective-c

I've tried to use the XPath 2.0 exp //span/string(.) in libxml2, but it doesn't work.
So, my question is: does libxml2 support XPath 2.0 or not?

According to this 2007 email from the maintainer of libxml2, libxml2 does not, and will not, support XPath 2.0.

As far as I know -- not. The prevailing majority of XPath 2.0 implementations are part of XSLT 2.0 processors or XQuery processors.

you might be interested in an XPath 2.0 extension to libxml2 - however, 2 caveats apply: it's work in progress and it's free for non-commercial use only.
hope this helps,
best regards, carsten
ps:
i am neither affiliated with the guys working on libx nor have i any personal experience on using it or knowledge beyond the info from their website.

Libxml2 implements a number of existing standards related to markup languages:
the XML standard: http://www.w3.org/TR/REC-xml
Namespaces in XML: http://www.w3.org/TR/REC-xml-names/
XML Base: http://www.w3.org/TR/xmlbase/
RFC 2396 : Uniform Resource Identifiers http://www.ietf.org/rfc/rfc2396.txt
XML Path Language (XPath) 1.0: http://www.w3.org/TR/xpath
HTML4 parser: http://www.w3.org/TR/html401/
XML Pointer Language (XPointer) Version 1.0: http://www.w3.org/TR/xptr
XML Inclusions (XInclude) Version 1.0: http://www.w3.org/TR/xinclude/
ISO-8859-x encodings, as well as rfc2044 [UTF-8] and rfc2781 [UTF-16] Unicode encodings, and more if using iconv support
part of SGML Open Technical Resolution TR9401:1997
XML Catalogs Working Draft 06 August 2001: http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
Canonical XML Version 1.0: http://www.w3.org/TR/xml-c14n and the Exclusive XML Canonicalization CR draft http://www.w3.org/TR/xml-exc-c14n
Relax NG, ISO/IEC 19757-2:2003, http://www.oasis-open.org/committees/relax-ng/spec-20011203.html
W3C XML Schemas Part 2: Datatypes REC 02 May 2001
W3C xml:id Working Draft 7 April 2004
Since libxml2 supports XPath 1.0, the syntax is incorrect:
//span/string(.)
Should be:
string(//span/.)
For clarification, the string method is part of XPath 1.0 as well. For future reference:
libxml2 supports XPath 1.0
Objective-C supports XPath 2.0 via the nodesForXPath method of NSXMLNode in GNUStep/NextStep
The Cocoa implementation uses XPath 2.0, which is a World Wide Web Consortium recommendation.
References
NSXML Concepts: XML Glossary
NSXML Concepts: Querying an XML Document
NSXMLNode: nodesForXPath
GNUStep: NSXMLNode Class Documentation
GalaXquery
PsychoPathXPathProcessor
CoreServicesLayer
libxml, a.k.a. gnome-xml

Related

Does DocToolChain support Python?

I came across docToolChain (http://doctoolchain.org/) for generating Docs. Wanted to know if this can support other programming languages such as Python, Go etc? Or will it only support Java?
yes, it does - depending on your needs :-)
When we incremented the version of docToolchain from 1.x to 2.0, the biggest feature was that the technology is now hidden behind a wrapper.
You still need java installed (v8-v14), but you don't have any code any more in your repository.
But regarding Python - it is quite likely that you want to use restructuredText as your markup language.
Until now, docToolchain focussed on AsciiDoc (based on ruby) as the markup language for your projects documentation.
There is now a feature coming up: jBake, the static site generator used by docToolchain is already able to render markdown.
But there is now also a PoC which shows that it can also render restructuredText with a little help of a small python script:
http://doctoolchain.org/multi-markup-demo/demo/asciidoc.html
PS: I am the maintainer of docToolchain, so my answer might be biased

Convert XML/SOAP to Maps in Community edition

I know Datamapper can easily convert an XML structure to a map easily. But what is the best way to do this in Community edition? Note I want Maps rather than a concrete class sung Jaxb.
The json-to-object-transformer allows you to easily convert to a map but is there anything similar for XML?
As of now Mule Community Edition doesn't provide any out of the box solution for this.
You can always crate a Custom transformer and use some API like XStream to convert the XML to map.
Following Stackoverflow post give you a sample of how to use XStream API.
How to convert XML to java.util.Map and vice versa
Hope this helps.

Convert internal wiki page into PDF

My team uses internal wiki pages for all kinds of stuff. The pages are created with MediaWiki. I wonder if there is any way to convert the wiki pages into PDF format. I have to use it to convert the user documentation to PDF format, so that it can be shipped with the next release. I have seen the 'Download as PDF' option on wikipedia but our internal wiki does not have it. Is there any plugin available which would allow me to convert it?
The Collection Extension has been decommissioned. The last long term support version supporting it will end of life in June 2019 according to
https://www.mediawiki.org/wiki/Version_lifecycle.
The Wikimedia foundation has stopped any development of a replacement after some failed attempts according to https://www.mediawiki.org/w/index.php?title=Topic:Uxkv0ib36m3i8vol&topic_showPostId=uxsjbpkqfmgq1jyx#flow-post-uxsjbpkqfmgq1jyx.
Closed source alternatives are under development by a least two companies. A working open source solution is available as a Debian package, Windows binary, and online converter http://mediawiki2latex.wmflabs.org/, which has been developed by a German worker in a cowshed using the Haskell programming language.
Wikipedia uses the Collection extension with OfflineContentGenerator (OCG) for this purpose.

Parsing and Writing XML in MAC 10.3.9 Cocoa?

What is the Best way i can do Parsing or Writing into XML using cocoa for mac10.3.9.?
Im mentioning the version of OS specifically because, i read in the documentation like, Mac 10.3.9 sdk does not support NSXML class.?
I Found an OpenSource libaray (libxml), is it the only library i can use????
Please give me some suggestion regarding the above....
Kindly reply Soon...
Thank you
Pradeep.
According to my copy of the documentation, the NSXMLParser class is available on Mac OS X 10.3 and later.
If for some reason you cannot use that, you can also use the Core Foundation XML Parser functions (search for CFXMLParser). This is a C-based API also developed by Apple. It will be deprecated in future versions of Mac OS X (after Snow Leopard), but since you're working on 10.3 that won't be a concern for you.
Many who cannot use those two also use libxml. Objective-C is able to use any C-based libraries with no penalty. I'm fairly certain Mac OS X ships with a copy of libxml you can link to (no need to download, build, or ship the library yourself; though if you want to, you certainly can).
What's best is going to depend on what features you need. Namespaces, for example, aren't fully supported by NSXMLParser in 10.3, but they are supported in 10.4.
Thanks for the replies....
I used libxml for xml parsing, it was working fine.
But still it has some problems like, even if the xml file is half consistent(i mean if the xml is corrupt, it loads the xml file).
libxml with xpath made things quite easy for xml parsing.

Documentation Framework like JavaDoc for Objective C

Does Objective C have a documentation framework similar to JavaDoc where documentation can be generated from the source code?
Doxygen! You can use it for many languages, including Objective-c
Good news for all! :D Finally after waiting a long time Apple has introduced a parser comments for our projects. According to the new features in XCode 5:
Project documentation from framework API reference documentation and
structured comments in your own source code are displayed in the quick
help panel and in code completion popover views. Doxygen and HeaderDoc
structured comments are supported formats.
and from the Clang 3.2 release notes:
Clang parses the comments and can detect syntactic and semantic errors
in comments. These warnings are off by default. Pass -Wdocumentation
flag to enable warnings about documentation comments.
If you want to see an example of this new feature I recommend you take a look at the following article: Documentation in Xcode 5
Doxygen is quite popular among Obj-C developers.
You could have a look to HeaderDoc wich is the apple documentation framework similar to Java.
Appledoc has become very popular. . . version 1 was based on Doxygen, whereas version 2 was written from the ground up.
It doesn't quite have all the features of Doxygen (charts, enums, C++ classes, etc), but what it does offer is beautifully formatted docs in HTML of IDE integrated format.
Also interesting to note is the following:
The CocoaPods tool includes Appledoc documentation for the libraries that it installs. Quite handy.