SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
SXML:
S-expression eXtensible Markup Language




          by Sterling Stuart Stein
Manipulating XML
●   Many ways to manipulate XML
    –   PHP
    –   JavaScript
    –   XSLT
●   Many annoyances
    –   Print statements (is it well-formed?)
    –   Lack of safety (Stray ampersands?)
    –   Verbose commands
PHP example
        <?php
Echo:    echo '<tag attr="val">';
         echo 'data';
         echo '</tag>';
        ?>


        <?php
         $doc = new DomDocument('1.0');
DOM:     $root = $doc->createElement('tag');
         $root->set_attribute("attr","val");
         $doc->appendChild($root);
         $value = $doc->createTextNode('data');
         $root->appendChild($value);
         echo $doc->dump_mem();
        ?>
              JavaScript is similar.
XSLT
                          <xsl:template match="/">
   Can have literals:      <tag attr="val">
                            <xsl:text>data</xsl:text>
                           </tag>
                          </xsl:template>




                          <tag>
                           <xsl:attribute name="attr">
Hard to add attributes:     <xsl:text>val</xsl:text>
                           </xsl:attribute>
                          </tag>
XSLT 2
                 Verbose function call syntax:
                 navitem("val1","val2");
      <xsl:call-template name="navitem">
       <xsl:with-param name="param1" select="'val1'" />
       <xsl:with-param name="param2" select="'val2'" />
      </xsl:call-template>

                         Hard to extend:
                         grouping
<xsl:key name="group-by-surname" match="contact" use="surname" />
<xsl:template match="records">
 <xsl:for-each select="contact[count(. | key('contacts-by-surname', surname)[1]) =
1]">
  <xsl:sort select="surname" />
  <xsl:value-of select="surname" />,<br />
  <xsl:for-each select="key('group-by-surname', surname)">
  <xsl:sort select="forename" />
  <xsl:value-of select="forename" /> (<xsl:value-of select="title" />)<br />
  </xsl:for-each>
 </xsl:for-each>
</xsl:template>
S-expressions
●   Stands for symbolic expression
●   Fully parenthesized parse tree
●   Usually uses prefix notation
    –   1+2*3 = (+ 1 (* 2 3))
●   Used to represent data and code in LISP
S-expressions and XML
●   S-expressions and XML represent parse trees
●   LISP can modify S-expressions
●   Therefore, use LISP on XML = SXML
●   Goal is to have uniform interfaces
●   Mapping from XML to S-expressions:
    <tag attr="val">   ("tag" (("attr"."val"))
     Data               "Data"
     <inside />         ("inside" ())
    </tag>             )
Features
           Quasiquotes make having
           executable snippets easy:
`("div" (("id"."nav"))            Similar to:
 ,(navitem "link" "dest")         <?php ...code... ?>
 ,@morenodes                      but safer.
 )


         Attributes can be dealt with
         the same as everything else:
        `("div"
          (("class".,(if (here) "active" "inactive")))
         )
Features 2
●   Has transforms that are XSLT-like
●   Has sorting by multiple criteria and grouping
●   Has path matching
    –   Currently far inferior to XSLT
    –   Planning on path like: table/tr = (* "table" "tr")
●   Will have SQL interface
    –   Also specified as S-expressions through macros
    –   Possibly with type safety to protect from SQL injection
        attacks
    –   Results returned as SXML trees
Implementation
●   Implemented as a library for Bigloo Scheme
●   Allows for native compiling
    –   Runs fast
●   Safe for CGI
    –   String lengths checked by language
    –   SQL checked by macros
●   Avoids destructive functions
    –   Personal preference
    –   Not suitable for huge documents
Thank you!




 Any questions?
Any suggestions?

Más contenido relacionado

La actualidad más candente (16)

J query1
J query1J query1
J query1
 
J query
J queryJ query
J query
 
Php verses MySQL
Php verses MySQLPhp verses MySQL
Php verses MySQL
 
Week3
Week3Week3
Week3
 
Xml 2
Xml  2 Xml  2
Xml 2
 
Jiemamy inside 2
Jiemamy inside 2Jiemamy inside 2
Jiemamy inside 2
 
jQuery
jQueryjQuery
jQuery
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
MySQL
MySQLMySQL
MySQL
 
Json Persistence Framework
Json Persistence FrameworkJson Persistence Framework
Json Persistence Framework
 
How to search extracted data
How to search extracted dataHow to search extracted data
How to search extracted data
 
Jquery introduction
Jquery introductionJquery introduction
Jquery introduction
 
MongoDB and RDBMS
MongoDB and RDBMSMongoDB and RDBMS
MongoDB and RDBMS
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
MySql:Introduction
MySql:IntroductionMySql:Introduction
MySql:Introduction
 
jQuery
jQueryjQuery
jQuery
 

Destacado

Nutrición y salud.
Nutrición  y salud. Nutrición  y salud.
Nutrición y salud. Benitez1013
 
June 11 ARTBA T&I wotus hearing statement
June 11 ARTBA T&I wotus hearing statementJune 11 ARTBA T&I wotus hearing statement
June 11 ARTBA T&I wotus hearing statementartba
 
Xogos matemáticos
Xogos matemáticosXogos matemáticos
Xogos matemáticoscolecabalo
 
Jpeg ads for newsletters (1)
Jpeg ads for newsletters (1)Jpeg ads for newsletters (1)
Jpeg ads for newsletters (1)scttsorenson
 
Trabajo sobre la web 2 voki
Trabajo sobre la web 2 voki Trabajo sobre la web 2 voki
Trabajo sobre la web 2 voki luisarendon123
 
Rinoceron de java
Rinoceron de javaRinoceron de java
Rinoceron de javaelrira25
 
Ayuda memoria-para-los-mas-que-senescentes
Ayuda memoria-para-los-mas-que-senescentesAyuda memoria-para-los-mas-que-senescentes
Ayuda memoria-para-los-mas-que-senescentesRegina Franco
 

Destacado (12)

Nutrición y salud.
Nutrición  y salud. Nutrición  y salud.
Nutrición y salud.
 
June 11 ARTBA T&I wotus hearing statement
June 11 ARTBA T&I wotus hearing statementJune 11 ARTBA T&I wotus hearing statement
June 11 ARTBA T&I wotus hearing statement
 
Trabajo profe coral
Trabajo profe coralTrabajo profe coral
Trabajo profe coral
 
Mongrel
MongrelMongrel
Mongrel
 
Xogos matemáticos
Xogos matemáticosXogos matemáticos
Xogos matemáticos
 
Jpeg ads for newsletters (1)
Jpeg ads for newsletters (1)Jpeg ads for newsletters (1)
Jpeg ads for newsletters (1)
 
Trabajo sobre la web 2 voki
Trabajo sobre la web 2 voki Trabajo sobre la web 2 voki
Trabajo sobre la web 2 voki
 
Rinoceron de java
Rinoceron de javaRinoceron de java
Rinoceron de java
 
Ayuda memoria-para-los-mas-que-senescentes
Ayuda memoria-para-los-mas-que-senescentesAyuda memoria-para-los-mas-que-senescentes
Ayuda memoria-para-los-mas-que-senescentes
 
Frasesvastagalarza
FrasesvastagalarzaFrasesvastagalarza
Frasesvastagalarza
 
Proyecto guía la torre 1 y 2 eso
Proyecto guía la torre 1 y 2 esoProyecto guía la torre 1 y 2 eso
Proyecto guía la torre 1 y 2 eso
 
Switching oct2013
Switching oct2013Switching oct2013
Switching oct2013
 

Similar a SXML: S-expression eXtensible Markup Language

XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!Bertrand Delacretaz
 
Java Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsJava Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsAnton Keks
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
XML Tools for Perl
XML Tools for PerlXML Tools for Perl
XML Tools for PerlGeir Aalberg
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Rubysbeam
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new featuresJakub Malý
 
Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIRoselin Mary S
 
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation LanguagesSyntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation LanguagesTara Athan
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For XmlLars Trieloff
 
Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)Sumant Tambe
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your TemplatesThomas Weinert
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersAmanda Gilmore
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xsltTUSHAR VARSHNEY
 

Similar a SXML: S-expression eXtensible Markup Language (20)

XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
Java Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsJava Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & Servlets
 
XML-Javascript
XML-JavascriptXML-Javascript
XML-Javascript
 
XML-Javascript
XML-JavascriptXML-Javascript
XML-Javascript
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
XML Tools for Perl
XML Tools for PerlXML Tools for Perl
XML Tools for Perl
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Ruby
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new features
 
Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit II
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation LanguagesSyntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages
Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages
 
Lobos Introduction
Lobos IntroductionLobos Introduction
Lobos Introduction
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For Xml
 
Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)Native XML processing in C++ (BoostCon'11)
Native XML processing in C++ (BoostCon'11)
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
 
XML_schema_Structure
XML_schema_StructureXML_schema_Structure
XML_schema_Structure
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
 

Más de elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

Más de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

SXML: S-expression eXtensible Markup Language

  • 1. SXML: S-expression eXtensible Markup Language by Sterling Stuart Stein
  • 2. Manipulating XML ● Many ways to manipulate XML – PHP – JavaScript – XSLT ● Many annoyances – Print statements (is it well-formed?) – Lack of safety (Stray ampersands?) – Verbose commands
  • 3. PHP example <?php Echo: echo '<tag attr="val">'; echo 'data'; echo '</tag>'; ?> <?php $doc = new DomDocument('1.0'); DOM: $root = $doc->createElement('tag'); $root->set_attribute("attr","val"); $doc->appendChild($root); $value = $doc->createTextNode('data'); $root->appendChild($value); echo $doc->dump_mem(); ?> JavaScript is similar.
  • 4. XSLT <xsl:template match="/"> Can have literals: <tag attr="val"> <xsl:text>data</xsl:text> </tag> </xsl:template> <tag> <xsl:attribute name="attr"> Hard to add attributes: <xsl:text>val</xsl:text> </xsl:attribute> </tag>
  • 5. XSLT 2 Verbose function call syntax: navitem("val1","val2"); <xsl:call-template name="navitem"> <xsl:with-param name="param1" select="'val1'" /> <xsl:with-param name="param2" select="'val2'" /> </xsl:call-template> Hard to extend: grouping <xsl:key name="group-by-surname" match="contact" use="surname" /> <xsl:template match="records"> <xsl:for-each select="contact[count(. | key('contacts-by-surname', surname)[1]) = 1]"> <xsl:sort select="surname" /> <xsl:value-of select="surname" />,<br /> <xsl:for-each select="key('group-by-surname', surname)"> <xsl:sort select="forename" /> <xsl:value-of select="forename" /> (<xsl:value-of select="title" />)<br /> </xsl:for-each> </xsl:for-each> </xsl:template>
  • 6. S-expressions ● Stands for symbolic expression ● Fully parenthesized parse tree ● Usually uses prefix notation – 1+2*3 = (+ 1 (* 2 3)) ● Used to represent data and code in LISP
  • 7. S-expressions and XML ● S-expressions and XML represent parse trees ● LISP can modify S-expressions ● Therefore, use LISP on XML = SXML ● Goal is to have uniform interfaces ● Mapping from XML to S-expressions: <tag attr="val"> ("tag" (("attr"."val")) Data "Data" <inside /> ("inside" ()) </tag> )
  • 8. Features Quasiquotes make having executable snippets easy: `("div" (("id"."nav")) Similar to: ,(navitem "link" "dest") <?php ...code... ?> ,@morenodes but safer. ) Attributes can be dealt with the same as everything else: `("div" (("class".,(if (here) "active" "inactive"))) )
  • 9. Features 2 ● Has transforms that are XSLT-like ● Has sorting by multiple criteria and grouping ● Has path matching – Currently far inferior to XSLT – Planning on path like: table/tr = (* "table" "tr") ● Will have SQL interface – Also specified as S-expressions through macros – Possibly with type safety to protect from SQL injection attacks – Results returned as SXML trees
  • 10. Implementation ● Implemented as a library for Bigloo Scheme ● Allows for native compiling – Runs fast ● Safe for CGI – String lengths checked by language – SQL checked by macros ● Avoids destructive functions – Personal preference – Not suitable for huge documents
  • 11. Thank you! Any questions? Any suggestions?