Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DTD for DataSource

    Can you please post a link to the DTD of DataSource XML? I wanted to see what my options are, what tags, attributes are available, what possible values can be assigned to those, etc.
    I know that the DataSource XML can customize a lot of things that would drive the way data is loaded into DataBound components. I just wanted to see the breadth of those options.

    Thanks in advance,

    #2
    It's here (it's not a DTD).

    Comment


      #3
      Thanks for the quick pointer. However is there any future plan to make a DTD of the XML? It would be a perfect one stop reference for all possibilities of DS XML configurations. Will be truly very useful to all.
      Thanks in advance,

      Comment


        #4
        I'd also like to see a DTD for the DataSource. In particular, I need to specify valid operators for a particular field. Can you provide/reference an example?
        Also, a sample of valueMap which has a display value and data value.

        Comment


          #5
          There isn't a DTD because the format is extensible. There's this reference.

          Several sample DataSources show valueMaps, such as this one.

          There's a few different APIs for controlling the valid operator (eg SimpleType, and programmatic calls to setTypeOperators()). Doing it in XML would look like:

          Code:
          <fields>
              <field name="foo" type="text">
                  <validOperators>equals</validOperators>
                  <validOperators>lessThan</validOperators>
                  <validOperators>greaterThan</validOperators>
              </field>
          </fields>
          If you were returning it to a FilterBuilder.fieldDataSource, what would be expected, building on the List of HashMaps example from the other thread, would be a key in the Map "validOperators" whose value is a List of Strings.
          Last edited by Isomorphic; 26 Aug 2010, 12:40.

          Comment


            #6
            Thanks, that was a help however, I discovered it's actually <validOperators> instead of <typeOperators>

            Code:
            <fields>
                <field name="foo" type="text">
                    <validOperators>equals</validOperators>
                    <validOperators>lessThan</validOperators>
                    <validOperators>greaterThan</validOperators>
                </field>
            </fields>

            Comment


              #7
              Whoops, you're correct, thanks. We corrected the previous post as well.

              Comment


                #8
                Originally posted by bill.erskine View Post
                I'd also like to see a DTD for the DataSource. In particular, I need to specify valid operators for a particular field. Can you provide/reference an example?
                Also, a sample of valueMap which has a display value and data value.
                Hi,

                I just found this thread while searching for some information. If it is still a concern for you, you can start with my XSD from this thread and modify it to your needs.

                A ValueMap with display value / data value looks like:
                Code:
                <field name="MAXDISTANCE" title="Max Distance" type="integer">
                	<valueMap>
                		<value id="" />
                		<value id="10">up to 10km</value>
                		<value id="20">up to 20km</value>
                		<value id="50">up to 50km</value>
                		<value id="100">up to 100km</value>
                		<value id="200">up to 200km</value>
                		<value id="500">up to 500km</value>
                	</valueMap>
                </field>
                Best regards,
                Blama

                Comment

                Working...
                X