SlideShare a Scribd company logo
1 of 11
Download to read offline
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?

More Related Content

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

More from 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
 

More from 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
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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?