Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:17:07+00:00 2026-06-04T20:17:07+00:00

After parsing HTML or XML file, we can get the DOM tree. After parsing

  • 0

After parsing HTML or XML file, we can get the DOM tree.

After parsing C, C++, or JavaScript, we can get the Syntax tree.

Note that the syntax tree is constructed based on the context-free grammar which specifies a valid C/C++/JS program.

But it seems the DOM tree is just a pure hierarchy structure specified only by the HTML/XML file. Is that true? Is that the reason that Schema Validation has been done after parsing? What is the fundamental difference between these two kinds of parse trees?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:17:09+00:00Added an answer on June 4, 2026 at 8:17 pm

    Like any other language, XML is described by a grammar. XML’s grammar is rather simple (start-tags, end-tags, correct nesting). So the syntax tree might seem simple as well (just an hierarchy of elements). An XML schema is another grammar that describes an XML file’s content.

    So basically it’s two parsers being invoked after each other. The first one verifies that all start-tags have an end-tag and that the nesting is right.

    The second parser verifies that the XML file’s content is structured according to the schema (grammar).. like that an element named “B” can only be contained within an element named “A”.

    This shouldn’t be compared to parsing programming languages like C since you cannot change a programming language’s syntax. If-statements can only appear within function bodies, not outside and you cannot change that. However in XML you can specify that “B”-elements can only appear within “A”-elements, or that “A”-elements can only appear within “B”-elements.. all by specifying the grammar of your XML file’s content in form of a schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the followinng Xresponse after parsing the XML document: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/
I am working on a project that will involve parsing HTML. After searching around,
I am trying to generate AST after parsing a HTML file. grammar XHTML2CSV; options
I am parsing an XML file into a table and want to use the
I am parsing an XML file into a table and want to use the
What is the cost of parsing a large XML file using PHP on every
hi friends i m using this tutorial http://xjaphx.wordpress.com/2012/02/04/android-xml-adventure-parsing-html-using-jsoup/ and after i implemented this code
I am attempting to do some Html parsing in a C#. After searching SO
I need to create a dynamic html table using PHP after parsing a JSON
I have a block of HTML that I am parsing with Jsoup, however, not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.