Simple JavaScript Object to XML string converter.
Convert JS object to XML string
Simple JavaScript Object to XML string converter.
Simple JavaScript Object to XML string converter.
Validate XML, Parse XML, Build XML without C/C++ based libraries
Fast and simple xml generator. Supports attributes, CDATA, etc. Includes tests and examples.
Create and parse HTTP Content-Type header
An evented streaming XML parser in JavaScript
DOMParser.parseFromString for XML with IE8 fallback
XML language support for the CodeMirror code editor
Simple RFC 6838 media type parser and formatter
A convertor between XML text and Javascript object / JSON text.
An evented streaming XML parser in JavaScript
Merge multiple XML sources
Apple's property list parser/builder for Node.js and browsers
Parses JavaScript objects into XML. This is a fork of the original js2xmlparser, with some additional features
Parse XML without Blowing Up Your Bundle Size
XML Serialization and Parsing module based on Python's ElementTree.
Converts JavaScript/JSON to XML (for RSS, Podcasts, AMP, etc.)
Beautifies XML documents by putting each tag and text node on their own line and correctly indents everything
Simple XML to JavaScript object converter.
Escape XML
Convert any object to XML
Validates whether a string matches the production for an XML name or qualified name
Generates an XML stylesheet or HTML string from a RecordX object.
Nmap::Parser
This gem allows to read an XML/Json file or string and access its elements using methods named after the tags. Also there are methods to return the object as an Hash or XML/Json string. See https://github.com/fboccacini/extreml for reference and usage.
BibTeX-Ruby is the Rubyist's swiss-army-knife for all things BibTeX. It includes a parser for all common BibTeX objects (@string, @preamble, @comment and regular entries) and a sophisticated name parser that tokenizes correctly formatted names; BibTeX-Ruby recognizes BibTeX string replacements, joins values containing multiple strings or variables, supports cross-references, and decodes common LaTeX formatting instructions to unicode; if you are in a hurry, it also allows for easy export/conversion to formats such as YAML, JSON, CSL, and XML (BibTeXML).
A jig is an ordered sequence of objects (usually strings) and named _gaps_. When rendered as a string by Jig#to_s, the objects are rendered calling #to_s on each object in order. The gaps are skipped. A new jig may be constructed from an existing jig by 'plugging' one or more of the named gaps. The new jig shares the objects and their ordering from the original jig but with the named gap replaced with the 'plug'. Gaps may be plugged by any object or sequence of objects. When a gap is plugged with another jig, the contents (including gaps) are incorporated into the new jig. Several subclasses (Jig::XML, Jig::XHTML, Jig::CSS) are defined to help in the construction of XML, XHTML, and CSS documents. This is a jig with a single gap named :alpha. Jig.new(:alpha) # => <#Jig: [:alpha]> This is a jig with two objects, 'before' and 'after' separated by a gap named :middle. j = Jig.new('before', :middle, 'after) # => #<Jig: ["before", :middle, "after"]> The plug operation derives a new jig from the old jig. j.plug(:middle, ", during, and") # => #<Jig: ["before", ", during, and ", "after"]> This operation doesn't change j. It can be used again: j.plug(:middle, " and ") # => #<Jig: ["before", " and ", "after"]> There is a destructive version of plug that modifies the jig in place: j.plug!(:middle, "filled") # => #<Jig: ["before", "filled", "after"]> j # => #<Jig: ["before", "filled", "after"]> There are a number of ways to construct a Jig and many of them insert an implicit gap into the Jig. This gap is identified as :___ and is used as the default gap for plug operations when one isn't provided:
cnuregexp allows tags to be placed inside a regex which function as labels for the matches. The matches within the MatchData object can then be accessed like a hash with the tag name as the key. cnuregexp also provides a greedy match which will return an array of all matches rather than just the first match. cnuregexp can also extract various data from an xml tag with the Regexp.xml_tag method. It uses Regexps to get the tag name, the attributes and their values, the tag content, and any other relevant data from an xml string. Lastly, cnuregexp allows commonly used regular expressions to be stored in a config file(lib/cnuregexp_config.yml) and accessed with Regexp.regular_expression_name notation eg. Regexp.ssn, Regexp.email_address. cnuregexp comes preloaded with a few common regular expressions which are located in lib/cnuregexp_config.yml.
# Fresh::Auth This gem makes it really, REALLY easy to use the Freshbooks API. It couldn't be easier. With only 3 functions you'll ever need to use, and only 2 required configuration values, it can't get any easier. ## Installation Add this line to your application's Gemfile: gem 'fresh-auth' And then execute: $ bundle Or install it yourself as: $ gem install fresh-auth ## Usage ### Configuration: You must define your Freshbooks subdomain and your OAuth Secret in your application code before using Fresh::Auth. For Ruby on Rails apps, a new file at config/initializers/fresh-auth.rb would be appropriate. Your configuration file should look like this (you fill in the three empty strings): Fresh::Auth.configure do |config| # The part of your login url between 'http://' and '.freshbooks.com' config.url.subdomain = "" # Under 'My Account' (on the top right when you're logged into Freshbooks) # -> 'Freshbooks API' -> 'OAuth Developer Access' -> 'OAuth Secret' # You'll need to request this from Freshbooks initially. config.oauth_secret = "" # Optional. Any string of your choice. Be creative or check out http://www.thebitmill.com/tools/password.html config.nonce_salt = "" end Fear not: If you try to use Fresh::Auth without configuring it first, an exception will be thrown that clearly describes the problem. ### Public API: There are two modules in this API: Fresh::Auth::Authentication and Fresh::Auth::Api #### Fresh::Auth::Authentication This module authenticates you with Freshbooks, storing the authentication in an array called `session`. This integrates seamlessly with Ruby on Rails' controller environment. If you're using some framework other than Ruby on Rails, make sure to define session in your class before including the Authentication module. This isn't recommended because your class will also need to define other objects called `params` and `request` and implement a `redirect_to` method. It gets complicated. Better leave it to Rails to handle this for you. The only public function of this module is AuthenticateWithFreshbooks. To use it, just add the following line of code to your controller: ` include Fresh::Auth::Authentication ` Then, the following line of code authenticates with Freshbooks from any method in your controller: ` AuthenticateWithFreshbooks() ` Note that, after authenticating with Freshbooks, the user will be redirected back to the same path using HTTP GET, so make sure the resource supports HTTP GET and that in the business logic executed on GET, AuthenticateWihFreshbooks() is called. #### Fresh::Auth::Api Once you've authenticated, you want to send XML requests to Freshbooks. The first step is preparing the XML with Fresh::Auth::Api.GenerateXml, which you'll supply with a block that defines all the nested XML that you want in your request. GenerateXml also takes two arguments before the block: the class and method that you want to call. First, in your controller: `include Fresh::Auth::Api` Then, in some method in that controller: my_xml = GenerateXml :invoice, :update do |xml| xml.client_id 20 xml.status 'sent' xml.notes 'Pick up the car by 5' xml.terms 'Cash only' xml.lines { xml.line { xml.name 'catalytic converter' xml.quantity 1 xml.unit_cost 450 xml.type 'Item' } xml.line { xml.name 'labor' xml.quantity 1 xml.unit_cost 60 xml.type 'Time' } } end Ok, you created the XML. Now you want to send it. Sounds pretty complicated, right? Not at all! Ready? Let's go! `_response = PostToFreshbooksApi my_xml` Now, are you wondering what's in `_response`? I'll tell you shortly, but before we discuss that, we have to know about the exception that PostToFreshbooksApi might raise. It raises a detailed error message if the response status is not 'ok'. Makes sense, right? Now, you still want to know what's in `_response`? Oh, nothing fancy. Just a Nokogiri XML object, representing the root element of the xml response. Could this get any easier? ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request