
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
= Lutaml::Xsd
== Overview
Lutaml::Xsd is a Ruby gem designed to parse and build XML Schema Definition (XSD) objects. It provides a robust framework for handling XSD elements, attributes, and complex types, allowing users to manipulate and generate XSD objects programmatically.
== Installation
To install Lutaml::Xsd, add this line to your application's Gemfile:
And then execute:
Or install it by running:
== Usage
=== Parsing XSD Files
To parse an XSD file, you can use the Lutaml::Xsd.parse
method. This method takes the content of an XSD file as a string and optional parameters such as the location of the XSD file for resolving relative paths.
require 'lutaml/xsd'
=== Working with Parsed Data
Once parsed, the data is represented as instances of various classes such as Lutaml::Xsd::Schema
, Lutaml::Xsd::Element
, and others. These objects reflect the structure of the XSD and can be manipulated or inspected in Ruby.
schema = <<~SCHEMA <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="root"> ... </xsd:element> <xsd:element name="root1"> ... </xsd:element> </xsd:schema> SCHEMA
parsed_schema = Lutaml::Xsd.parse(schema, location: 'http://example.com/')
elements = parsed_schema.element elements.each do |element| puts "Element Name: #{element.name}" end
Element Name: root Element Name: root1
=== Serialization
The gem supports serializing the schema back to XML. Each class like Lutaml::Xsd::Schema
has a method to_xml
that generates the XML representation of the object.
== Key Components
=== Schema Representation
The Lutaml::Xsd::Schema class represents an XSD schema. It includes attributes for various schema properties like target namespace, element form default, and others.
Schema
object.=== Include and Import Handling
The path provided in location
via Lutaml::Xsd.parse(schema, location: 'path/to/your/directory/')
is used for resolving relative paths provided in include and import element's schemaLocation attribute.
Make sure to provide the directory path/URL in location
parameter, as it will be used as base path for resolving relative paths.
For example, if URL is provided:
If local path is provided:
<xs:include schemaLocation="/directory2/metaschema.xsd"/>
All schemas specified in the include and/or import elements will be fetched from their schemaLocation, parsed and added to their parent Lutaml::Xsd::Schema object.
== Development
Dependencies: The gem depends on other gems like zeitwerk
for autoloading and lutaml-model
for model serialization. See the Gemfile
and lutaml-xsd.gemspec
for details on dependencies.
Testing: Tests are written using RSpec. Test files and fixtures are located in the spec
directory.
== About LutaML
The name "LutaML" is pronounced as "Looh-tah-mel".
The name "LutaML" comes from the Latin word for clay, "Lutum", and "ML" for "Markup Language". Just as clay can be molded and modeled into beautiful and practical end products, the Lutaml::Model gem is used for data modeling, allowing you to shape and structure your data into useful forms.
== License and Copyright
This project is licensed under the BSD 2-clause License. See the link:LICENSE.md[] file for details.
Copyright Ribose.
FAQs
Unknown package
We found that lutaml-xsd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.