Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Schema troubles.

Schema troubles.

Scheduled Pinned Locked Moved XML / XSL
xmlquestiondatabasehelpannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alvaro Mendez
    wrote on last edited by
    #1

    I'm creating a typed DataSet for my XML file and I'm having trouble modifying the XSD file to conform to my data's format. Here's a sample of my data:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <dropdowns>
    <Country lang="en">Albania</Country>
    <Country lang="en">Algeria</Country>
    ...

    I need for my Country data table to have two columns: "lang" and "name". How do I set up the XSD to treat the contents of the Country element as my name column? I've tried this, but it's not working:

    <xs:element name="Dropdowns" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Dropdowns" msprop:Generator_DataSetName="Dropdowns">
    xs:complexType
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Country" form="unqualified" msprop:Generator_UserTableName="Country" msprop:Generator_RowDeletedName="CountryRowDeleted" msprop:Generator_RowChangedName="CountryRowChanged" msprop:Generator_RowClassName="CountryRow" msprop:Generator_RowChangingName="CountryRowChanging" msprop:Generator_RowEvArgName="CountryRowChangeEvent" msprop:Generator_RowEvHandlerName="CountryRowChangeEventHandler" msprop:Generator_TableClassName="CountryDataTable" msprop:Generator_TableVarName="tableCountry" msprop:Generator_RowDeletingName="CountryRowDeleting" msprop:Generator_TablePropName="Country">
    <xs:complexType name="name" form="unqualified" msprop:Generator_UserColumnName="name" msprop:nullValue="_empty" msprop:Generator_ColumnPropNameInRow="name" msprop:Generator_ColumnPropNameInTable="nameColumn" msprop:Generator_ColumnVarNameInTable="columnname" type="xs:string" default="">
    <xs:attribute name="lang" form="unqualified" msprop:Generator_UserColumnName="lang" msprop:nullValue="_throw" msprop:Generator_ColumnPropNameInRow="lang" msprop:Generator_ColumnPropNameInTable="langColumn" msprop:Generator_ColumnVarNameInTable="columnlang" type="xs:string" msdata:DefaultValue="en" use="required" />
    </xs:complexType>
    </xs:element>

    How do I fix the part in bold? Thanks! Alvaro


    Eat right.
    Exercise.
    Die anyway.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups