Version of XSLT in iPhone

前端 未结 5 498
情歌与酒
情歌与酒 2020-12-01 04:17

I plan to use XML/XSLT in my iPhone application.

What version of XSLT is currently supported on the iPhone? Can I use XSLT 2.0 or just 1.0 ?

5条回答
  •  星月不相逢
    2020-12-01 04:26

    For everyone updating to XCode 5 + iOS7 baseSDK, you will notice that if you included libxslt-1.1.26 in your project and compiled from source, it was using the prior version of libxml. In the latest base SDK libxml has been updated and as such you will need to update to libxslt-1.1.28.

    When you download the latest .tar.gz file all you need to include into your project for the first time are:

    • config.h
    • libxslt/*.h
    • libxslt/*.c

    But config.h and libxslt/xsltconfig.h don't exist just yet. They have the .in suffix. You will need to either run the ./configure script or if that isn't working straight out of the box for you then cheat like I did.

    Step 1 - 0 differences

    Simply create a new copy of config.h.in named config.h.

    Step 2 - 12 differences

    Simply create a new copy of libxslt/xsltconfig.h.in named libxslt/xsltconfig.h.

    The first four changes are simply version numbers.

    1. #define LIBXSLT_DOTTED_VERSION "1.1.28"
    2. #define LIBXSLT_VERSION 10128
    3. #define LIBXSLT_VERSION_STRING "10128"
    4. #define LIBXSLT_VERSION_EXTRA "-GITv1.1.28"

    The next four

    1. #if @WITH_XSLT_DEBUG@ -> #if 1 //Simply replace @WITH_XSLT_DEBUG@ with 1
    2. #if @WITH_MEM_DEBUG@ -> #if 1
    3. #if @WITH_TRIO@ -> #if 0
    4. #if @WITH_DEBUGGER@ -> #if 1

    The last four

    1. #if @WITH_MODULES@ -> #if 1
    2. #define LIBXSLT_DEFAULT_PLUGINS_PATH() "@LIBXSLT_DEFAULT_PLUGINS_PATH@" -> #define LIBXSLT_DEFAULT_PLUGINS_PATH() "/usr/lib/libxslt-plugins"
    3. #if @XSLT_LOCALE_XLOCALE@ -> #if 1
    4. #if @XSLT_LOCALE_WINAPI@ -> #if 0

      Step 3

    Now that you have manually performed the steps that ./configure would have performed you can follow the instructions outlined earlier for adding the libxslt files to your project:

    • config.h
    • libxslt/*.h
    • libxslt/*.c

提交回复
热议问题