Giter VIP home page Giter VIP logo

wurfl-xslt-tools's Introduction

WURFL XSLT Tools

by Roland Guelle [email protected], http://guelle.de

The WURFL information is stored in XML. So the simpliest way to manipulate and transform WURFL is XSLT.

These stylesheets are tested with xsltproc from the package libxslt (http://xmlsoft.org/XSLT). I only use this on the command line, if you need a GUI - there are lot of tools that helps you working with XSLT. Some exslt extensions are used, so please check if your XSLT processor supports this.

If you have never worked with a XSLT processor or the command line before, add to WURFL and open the file with Firefox.

check_wurfl.xsl

Check your patched/modified WURFL consistency:

  • id attribute is present and unique

  • user_agent attribute is present and unique

  • fall_back is available and could be resolved

    xsltproc check_wurfl.xsl wurfl.xml

convert_2_html.xsl

Create a simple WURFL.xml HTML page

xsltproc convert_2_html.xsl wurfl.xml > wurfl.html

convert_wurfl_markups.xsl

Convert the WURFL markups to ''outdated'' names. Some years ago the markup names have changed from wml11 to wml_1_1.

xsltproc convert_wurfl_markups.xsl wurfl.xml > wurfl_converted.xml

count_useragents.xsl

Answer the question "how many useragents/capabilities are stored in WURFL?"

xsltproc count_useragents.xsl wurfl.xml

get_capabilities.xsl

Get capabilities (without groups) from WURFL.

xsltproc --stringparam 'ua' "Nokia3650" get_capabilities.xsl wurfl.xml
xsltproc --stringparam 'id' "nokia_3650_ver1" get_capabilities.xsl wurfl.xml

patch_wurfl.xsl

Patch WURFL with your own devices, groups and capabilities.

xsltproc --stringparam 'file' "your_patch_file" patch_wurfl.xsl wurfl.xml > wurfl_patched.xml

remove_elements.xsl / remove_elements.xml

WURFL has many capabilities and groups. If you don't need all capabilities, you could remove them.

xsltproc --stringparam 'file' "remove_elements.xml" remove_elements.xsl wurfl.xml > my_wurfl.xml

remove_elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<elements>
  !--
  configuration file for remove_elements.xsl,
  send comments, questions to roland guelle <[email protected]>
  -->
  <groups>
    <group>wta</group>
    <group>object_download</group>
    <group>streaming</group>
    <group>wap_push</group>
    <group>j2me</group>
    <group>mms</group>
    <group>sms</group>
    <group>sound_format</group>
  </groups>
  <capabilities>
    <capability>tiff</capability>
    <capability>bmp</capability>
  </capabilities>
</elements>

roll_out_into_sql.xsl / roll_out_capabilities.xml

Resolve WURFL fallbacks for all values and capabilities defined in roll_out_capabilities.xml and create SQL statements for insert WURFL into a SQL database.

xsltproc roll_out_into_sql.xsl wurfl.xml > wurfl.sql

roll_out_into_txt.xsl / roll_out_capabilities.xml

Resolve WURFL fallbacks for all values and capabilities defined in roll_out_capabilities.xml and create text/csv output.

xsltproc roll_out_into_txt.xsl wurfl.xml > wurfl.txt

roll_out_into_xml.xsl / roll_out_capabilities.xml

Resolve WURFL fallbacks for all values and capabilities defined in roll_out_capabilities.xml and create XML output.

xsltproc roll_out_into_xml.xsl wurfl.xml > wurfl_resolved.xml

tidy_config

Useful tidy (http://tidy.sourceforge.net/tidy) configuration.

To combine multiple xslt transformations use the pipe syntax:

xsltproc --stringparam file "web_browsers_patch.xml" patch_wurfl.xsl wurfl.xml | \
     xsltproc --stringparam file "remove_elements.xml" remove_elements.xsl \
     - > wurfl_patched.xml

wurfl-xslt-tools's People

Contributors

max-arnold avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.