Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    Hello. Only a few of the following fields will have rowspans greater than one. Because of this, I'm sticking most of the fields on a single line and just a few of them on multiple lines.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <datatype>
      <name>contacts
        <field>name</field>
        <field>home ph</field>
        <field>cell ph</field>
        <field>work ph</field>
        <field>birthday</field>
        <field>address
          <rowspan>2</rowspan>
        </field>
        <field>e-mail</field>
        <field>http://</field>
        <field>notes
          <rowspan>3</rowspan>
        </field>
      </name>
    </datatype>
    Does that look like the best way of formatting my XML?
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I generally don't mix text nodes with other child elements. I think it's messy.

    Try using attributes instead.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <datatype>
      <name>contacts
        <field>name</field>
        <field>home ph</field>
        <field>cell ph</field>
        <field>work ph</field>
        <field>birthday</field>
        <field rowspan="2">address</field>
        <field>e-mail</field>
        <field>http://</field>
        <field rowspan="3">notes</field>
      </name>
    </datatype>

  4. #3
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    Thank you! That was exactly the kind of guidance I was looking for.
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You're welcome. On second look, you should probably put all the values in attributes... I tend to use text nodes only for long chunks of data.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <datatype name="contacts">
        <field name="name" />
        <field name="home ph" />
        <field name="cell ph" />
        <field name="work ph" />
        <field name="birthday" />
        <field name="address" rowspan="2" />
        <field name="e-mail" />
        <field name="http://" />
        <field name="notes" rowspan="3" />
    </datatype>

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Ok, on further analysis, it seems like you'll need more information. I'm using the "name" attribute to represent the table name / form name or column name / input name and the "legend" and "label" attributes to represent the title elements that will be associated with the corresponding input. "Default" will prefill the input with the specified value.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <datatype name="contacts" legend="Contact">
        <field name="name" label="Name" />
        <field name="home_phone" label="Home Phone">
        <field name="cell_phone" label="Cell Phone" />
        <field name="work_phone" label="Work Phone" />
        <field name="birthday" label="Birthday" />
        <field name="address" label="Address" rowspan="2" />
        <field name="email" label="Email Address" />
        <field name="url" label="Website Address" default="http://" />
        <field name="notes" label="Notes" rowspan="3" />
    </datatype>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:26 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com