Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

liberu-genealogy/laravel-gramps-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 theXmlReader service. Here's a basic example:

// Import the XmlReader classuseLaravelGrampsXml\XmlReader;// Create an instance of the XmlReader$xmlReader =newXmlReader();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 operationecho"Error reading XML file:" .$e->getMessage();}

XmlWriter

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

useLaravelGrampsXml\XmlWriter;$xmlWriter =newXmlWriter();$xmlWriter->write('path/to/your/file.xml',$xmlContent);// Validate the XML content against the grampsxml.dtd formatif ($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}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp