Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pike
pike
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #3932

Closed
Open
Opened May 31, 2005 by Peter Bortas@zinoOwner

XML parser incorrectly accepts document without top-level element

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3932

Reported by Jonas Wallden jonasw@roxen.com

Both of these examples should signal parse errors:

  ceylon:server $ ~/pike/7.4/bin/pike
  Pike v7.4 release 301 running Hilfe v3.5 (Incremental Pike Frontend)
  > function cb = lambda(mixed ...foo) { werror("%O\n", foo); };
  > Parser.XML.Simple()->parse("", cb);
  (1) Result: ({ })
  > Parser.XML.Simple()->parse("<?xml version='1.0'?>", cb);
  ({ /* 5 elements */
      "<?xml",
      0,
      ([ /* 1 element */
        "version":"1.0"
      ]),
      0,
      ([ /* 1 element */
        "location":21
      ])
  })
  (2) Result: ({ })

Relevant productions from the XML specification:

[1] document ::= prolog element Misc* [39] element ::= EmptyElemTag | STag content ETag [40] STag ::= '<' Name (S Attribute)* S? '>' [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'

Assignee
Assign to
Pike 7.4
Milestone
Pike 7.4
Assign milestone
Time tracking
None
Due date
None
Reference: pikelang/pike#3932