- Add p5-XML-XML2JSON 0.05

XML::XML2JSON is a Perl module to convert XML to JSON (and JSON to XML) using
the following rules from Google (http://code.google.com/apis/gdata/json.html):

Basic:
- The feed is represented as a JSON object; each nested element or attribute
  is represented as a name/value property of the object.
- Attributes are converted to String properties.
- Child elements are converted to Object properties.
- Elements that may appear more than once are converted to Array properties.
- Text values of tags are converted to $t properties.

Namespace:
- If an element has a namespace alias, the alias and element are concatenated
  using "$". For example, ns:element becomes ns$element.

XML:
- XML version and encoding attributes are converted to version and encoding
  attributes of the root element, respectively.

WWW: http://search.cpan.org/dist/XML-XML2JSON/
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2011-07-14 06:50:52 +00:00
parent 3680587ef9
commit 68d1ea6142
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277666
5 changed files with 79 additions and 0 deletions

View File

@ -923,6 +923,7 @@
SUBDIR += p5-XML-Validator-Schema
SUBDIR += p5-XML-Writer
SUBDIR += p5-XML-XBEL
SUBDIR += p5-XML-XML2JSON
SUBDIR += p5-XML-XPath
SUBDIR += p5-XML-XPathEngine
SUBDIR += p5-XML-XQL

View File

@ -0,0 +1,51 @@
# New ports collection makefile for: p5-XML-XML2JSON
# Date created: 2011-07-11
# Whom: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= XML-XML2JSON
PORTVERSION= 0.05
CATEGORIES= textproc perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Convert XML into JSON (and back again) using XML::LibXML
RUN_DEPENDS= p5-XML-LibXML>=1.59:${PORTSDIR}/textproc/p5-XML-LibXML
# the order of options follows the search order of JSON module by XML::XML2JSON
OPTIONS= JSON_SYCK "Use JSON::Syck" on \
JSON_XS "Use JSON::XS" off \
JSON "Use JSON" off \
JSON_DWIW "Use JSON::DWIW" off
PERL_CONFIGURE= yes
MAN3= XML::XML2JSON.3
.include <bsd.port.options.mk>
.if defined(WITHOUT_JSON_SYCK) && !defined(WITH_JSON_XS) && !defined(WITH_JSON) && !defined(WITH_JSON_DWIW)
IGNORE= You must choose at least one JSON module.
.endif
.if !defined(WITHOUT_JSON_SYCK)
RUN_DEPENDS+= p5-YAML-Syck>=0:${PORTSDIR}/textproc/p5-YAML-Syck
.endif
.if defined(WITH_JSON_XS)
RUN_DEPENDS+= p5-JSON-XS>=0:${PORTSDIR}/converters/p5-JSON-XS
.endif
.if defined(WITH_JSON)
RUN_DEPENDS+= p5-JSON>=0:${PORTSDIR}/converters/p5-JSON
.endif
.if defined(WITH_JSON_)
RUN_DEPENDS+= p5-JSON-DWIW>=0:${PORTSDIR}/converters/p5-JSON-DWIW
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (XML-XML2JSON-0.05.tar.gz) = a287c1bd058bf5aa2cd8c8e9d57647c92317d713a5c03a91ee23c3785bc7e7d7
SIZE (XML-XML2JSON-0.05.tar.gz) = 23882

View File

@ -0,0 +1,20 @@
XML::XML2JSON is a Perl module to convert XML to JSON (and JSON to XML) using
the following rules from Google (http://code.google.com/apis/gdata/json.html):
Basic:
- The feed is represented as a JSON object; each nested element or attribute
is represented as a name/value property of the object.
- Attributes are converted to String properties.
- Child elements are converted to Object properties.
- Elements that may appear more than once are converted to Array properties.
- Text values of tags are converted to $t properties.
Namespace:
- If an element has a namespace alias, the alias and element are concatenated
using "$". For example, ns:element becomes ns$element.
XML:
- XML version and encoding attributes are converted to version and encoding
attributes of the root element, respectively.
WWW: http://search.cpan.org/dist/XML-XML2JSON/

View File

@ -0,0 +1,5 @@
%%SITE_PERL%%/XML/XML2JSON.pm
%%SITE_PERL%%/%%PERL_ARCH%%/auto/XML/XML2JSON/.packlist
@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/XML/XML2JSON
@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/XML
@dirrmtry %%SITE_PERL%%/XML