web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to Generate XSD file from XML

(0) ShareShare
ReportReport
Posted on by 433

Hello Experts,

I want to generate a XSD File from XML File Using C/AL Code.

Can any one explain or give me any useful links to achieve this.

Thank You

Mahesh.U

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    using DotNet variable you can replicate the code in the below or use XSD using Process Start Info to convert.

    msdn.microsoft.com/.../system.xml.schema.xmlschemainference.aspx

  • Mahesh U Profile Picture
    433 on at

    Thanks for the link,

    by refering that link i tried to write a code but no use i am not able to generate.

    SchemaSet := XMlSchInt.XmlSchemaInference();
    XMlSchInt.InferSchema(XmlDocument,SchemaSet);
    XMlSchInt.TypeInference(XmlDocument);
    MESSAGE(XMlSchInt.ToString);

    Variable Declaration

    ----------------------

    Name                 DataType                          Subtype                                                                                    Length

    XmlDocument   DotNet                        System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0,                                                                                        Culture=neutral, PublicKeyToken=b77a5c561934e089' 

    XMlSchInt         DotNet                    System.Xml.Schema.XmlSchemaInference.'System.Xml,                                                                                               Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 


    SchemaSet      DotNet                  System.Xml.Schema.XmlSchema.'System.Xml, Version=4.0.0.0, Culture=neutral,                                                          PublicKeyToken=b77a5c561934e089'

    But it is giving error. please help me

    Thank You

    Mahesh.U

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    What error are you getting ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans