Git Product home page Git Product logo

laravel-gramps-xml's Introduction

laravel-gramps-xml

This package provides easy-to-use services for reading and writing XML files in Laravel applications.

Installation

To install the package, run the following command in your Laravel project:

composer require liberu/laravel-gramps-xml

Usage

XmlReader

To read an XML file, use the XmlReader service. Here's a basic example:

// Import the XmlReader class
use LaravelGrampsXml\XmlReader;

// Create an instance of the XmlReader
$xmlReader = new XmlReader();

try {
    // Attempt to read the XML file
    $xmlContent = $xmlReader->read('path/to/your/file.xml');
    // If successful, $xmlContent will contain the contents of the XML file
} catch (Exception $e) {
    // Handle any errors that occur during the read operation
    echo "Error reading XML file: " . $e->getMessage();
}

XmlWriter

To write to an XML file in the GRAMPS XML format, use the XmlWriter service. Here's an example:

use LaravelGrampsXml\XmlWriter;

$xmlWriter = new XmlWriter();
$xmlWriter->write('path/to/your/file.xml', $xmlContent);

// Validate the XML content against the grampsxml.dtd format
if ($xmlWriter->validateXmlContent($xmlContent)) {
    echo "XML content is valid";
} else {
    echo "XML content is not valid";
}

// This will write $xmlContent to the specified XML file in the GRAMPS XML format

private function validateXmlContent($xmlContent) { // Add code to validate XML content against grampsxml.dtd format // Return true if valid, false otherwise }

laravel-gramps-xml's People

Contributors

curtisdelicata avatar sweep-ai[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

laravel-gramps-xml's Issues

Sweep: XMLWriter support https://github.com/gramps-project/gramps/blob/master/data/grampsxml.dtd format for exporting to GRAMPS XML format from people objects in eloquent/laravel database

Checklist
  • Modify src/Services/XmlReader.phpee3fbc0 Edit
  • Running GitHub Actions for src/Services/XmlReader.phpEdit
  • Modify src/XmlWriter.php6056c9d Edit
  • Running GitHub Actions for src/XmlWriter.phpEdit
  • Modify README.md ! No changes made Edit
  • Running GitHub Actions for README.mdEdit
  • Modify README.md4463992 Edit
  • Running GitHub Actions for README.mdEdit

Sweep: merge app/ into src/

Checklist
  • Create src/XmlReader.phpdf4673f Edit
  • Running GitHub Actions for src/XmlReader.phpEdit
  • Create src/XmlWriter.php80eaf01 Edit
  • Running GitHub Actions for src/XmlWriter.phpEdit
  • Modify composer.json ! No changes made Edit
  • Running GitHub Actions for composer.jsonEdit
  • Modify README.mde27aa85 Edit
  • Running GitHub Actions for README.mdEdit
  • Modify README.md9d550b1 Edit
  • Running GitHub Actions for README.mdEdit

Sweep: xml

Details

Create laravel 11 using php 8.3 package that reads and writes xml

Checklist
  • Modify README.md4ab8ef8 Edit
  • Running GitHub Actions for README.mdEdit

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.