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 4610352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:07:09+00:00 2026-05-22T01:07:09+00:00

New to XML, written an XML document and auto generated a Schema using Visual

  • 0

New to XML, written an XML document and auto generated a Schema using Visual Studio. I started writing my own schema originally. My question would be is there any flaws or possible improvements I can implement? I’ve got type, requirement and occurrence validation, just curious to hear what you experienced guys say.

XML

<?xml version="1.0" encoding="utf-8" ?>
<university>
<lesson id="ms434">
  <subject>Biology</subject>
  <maintopic name="Human Biology">
    <subtopic>Enlarge Hearts</subtopic>
    <subtopic>Heart Valves</subtopic>
  </maintopic>
  <content>
    <sentance>Very long sentance one</sentance>
    <sentance>Very long sentance two</sentance>
    <sentance>Very long sentance three</sentance>
  </content>
</lesson>
</university>

Schema

<?xml version="1.0" encoding="utf-8"?>

<xsl:template match="@* | node()">
  <html>
    <body>
      <h1>Professional Training Facilities</h1>
      <p>
        <strong>University: </strong>
        <xsl:for-each select="university/lesson">          
        <xsl:value-of select="subject"/>
      </p>
      <br/>
      <p>
        <strong>Main Topic: </strong>
        <xsl:value-of select="maintopic=name"/>
      </p>
      <br/>
      <p>
        <strong>Sub Topics: </strong>
        <xsl:for-each select="maintopic">
          <p>
            <xsl:value-of select="subtopic"/>
          </p>
        </xsl:for-each>
      </p>
      <p></p>
      <strong>Content:</strong>
      <xsl:for-each select="content">
        <p>
          <xsl:value-of select="sentance"/>
        </p>
      </xsl:for-each>
      </xsl:for-each> 
      <br/>
    </body>
  </html>
</xsl:template>

When I’d almost completed the Schema manually, I’m sure I had a lot less code, is the auto generation excessive?

Edit: foreach error for first statement, working on a fix, that’s not the problem btw.

  • 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-05-22T01:07:09+00:00Added an answer on May 22, 2026 at 1:07 am

    A schema is a description of a class of documents. Any schema generated from a single document is a guess. For example, if all your lesson elements have a length attribute that is an integer, the tool might guess that it will always be an integer, and give it a type of xs:integer. But you might want to be more precise, and make the type an integer in the range 30 to 60. Or the tool might be more restrictive than you want: perhaps it guesses that the ID is always 5 characters long, when that’s just an accident of your sample data. So whenever you use a schema-generation tool like this, you will need to check the output and change it to describe a class of documents rather than just your sample.

    I don’t know the VS tool, but many such tools have options for the style in which the schema is generated, e.g. local element declarations vs global element declarations. The different outputs might well be equivalent, but some of them may allow greater reuse of components or be easier to modify. It’s worth experimenting with different options.

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

Sidebar

Related Questions

Background I'm reading and writing an XML document using reader and writer, with filtering
I have an XML document: var xml:XML = new XML(<rootNode> <head> <meta name=template content=Default
When loading XML into an XmlDocument, i.e. XmlDocument document = new XmlDocument(); document.LoadXml(xmlData); is
I have the following XML document: <projects> <project> <name>Shockwave</name> <language>Ruby</language> <owner>Brian May</owner> <state>New</state> <startDate>31/10/2008
I'm writing out an XML file using VB.net. When I try to create another
I have an xml document that I am creating using the loop below and
I am using MSXML 6.0 to perform a transform of my own XML into
Background: We have an XML document containing thousands of pseudocode functions. I've written a
When creating a new xml file, how does one go about structuring the file
New to xml. Looking for XPath to search a xml file with python ElementTree

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.