HELP! Need valid xsd for xml file(Rookie :)

  • <?xml version="1.0" encoding="UTF-8" ?>

    - <File>

    - <Row>

    <Column Name="JobID">2010-1022</Column>

    <Column Name="Folder">Closed (Filled)</Column>

    <Column Name="NumberofOpenings">1</Column>

    <Column Name="NumberofOpeningsRemaining">0</Column>

    <Column Name="BusinessCardTitle">Director of Operations</Column>

    </Row>

    </File>

  • 1. In an SSMS query window run this while in Grid Results mode (Ctrl+G):

    SELECT CONVERT(XML,'<?xml version="1.0" encoding="UTF-8" ?>

    <File>

    <Row>

    <Column Name="JobID">2010-1022</Column>

    <Column Name="Folder">Closed (Filled)</Column>

    <Column Name="NumberofOpenings">1</Column>

    <Column Name="NumberofOpeningsRemaining">0</Column>

    <Column Name="BusinessCardTitle">Director of Operations</Column>

    </Row>

    </File>') ;

    2. Then click on the result to open it in the XML editor.

    3. On the XML menu choose Create Schema.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • I've generated an xsd file from SSIS and Visual Studio, but the output is invalid for this non-standard xml.

    Thanks for the response...JON

  • Invalid meaning you don't like it?

    The schema generator generates a valid schema per the XML provided...but it takes a least-common-denominator approach. If you have constraints you need in your schema then you need to create your own XSD...SSMS cannot read your mind.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply