Skip to content

kusnezoff-alexander/xmlparser-pest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of a XML 1.0-parser using pest.

⛳ Roadmap

  1. Syntax Parser
  • write the grammar file(s)

    • Test: ExternalID (everything under ###External Entities+Expl in #XML Overview)
  • add data structures

  • (add methods for manipulating data structures & writing the data back )

🎓 Personal Learnings

  • Markup- and Programming-Languages are just a sequence of strings/bytes in the end
  • Specification != Implementation is possible
  • writing Grammar-Rules in PEG
  • Unicode-Encoding

XML Overview

->see XML 1.0 Spec: Character Data and Markup

Markup = Define document's structure (or contain metadata)

  • STag(start-tag),ETag(end-tag),EmptyElemTag
  • EntityRef,CharRef
  • Comment
  • CDStart,CDEnd
  • doctypedecl (DTD)
  • PIs (Processing Instructions)
  • XMLDecl (EncodingDecl,VersionInfo,SDDecl:standalone decl)
  • TextDecl (for external parsed entities)

Character Data = document's content

  • CDATA = for escaping blocks of texts containing markup-strings

Entities

=storage units

  • Document Entity = starting point for XML processor; contained in every XML document
  • Parsed Entity = contents="replacement text"
  • Unparsed Entity = may (or may not) be text and if text may be other than XML (eg gif)
    • ->no restrictions on contents of unparsed entities!
  • Parameter Entities = for use within DTD

External Entities

System Identifier (SystemLiteral) = mostly a URI reference

  • no fragment identifier (#) within URI!!
  • relative URI = relative to XML-doc in which this External Entity is defined?? (unsure, see Spec 4.2.2)

Example

<!ENTITY open-hatch
         SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY open-hatch
         PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
         "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY hatch-pic
         SYSTEM "../grafix/OpenHatch.gif"
         NDATA gif >

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages