Results 1 to 3 of 3

Thread: [RESOLVED] Validate XML-text from (Rich)Textbox against XSD

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Resolved [RESOLVED] Validate XML-text from (Rich)Textbox against XSD

    Hi there,

    I've been looking for a method to validate my xml(string) in a (rich)textbox against an .xsd. The best sample I've found is: http://www.vbforums.com/showthread.p...ainst-xsd-file, but it uses a "file". How to use it with a string in a (rich)textbox?

    Thanks for the help in advance.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Validate XML-text from (Rich)Textbox against XSD

    I'm getting close to solve this, but I'm getting an error in the following code:

    Code:
    dim ns as string = "http://schemas.microsoft.com/office/2009/07/customui"
    dim xsdschema as string = mypathtoxsdschema
    
    Dim x As New XmlDocument
    x.LoadXml(myxml)
    x.Schemas.Add(ns, xsdschema)
    myxml:
    Code:
    customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <ribbon startFromScratch="false">
          <tabs>
             <tab id="customTab" label="Custom Tab">
                <group id="customGroup" label="Custom Group">
                   <button id="customButton" label="Custom Button" imageMso="HappyFace" size="large" onAction="Callback" />
                </group>
             </tab>
          </tabs>
       </ribbon>
    </customUI>
    ERROR: x.Schemas.Add(ns, xsdschema): The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  3. #3

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Validate XML-text from (Rich)Textbox against XSD

    Think I got it. Need to test it properly...


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width