Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:10:34+00:00 2026-05-15T21:10:34+00:00

How to represent the following data in XML format? commandA ( a | b

  • 0

How to represent the following data in XML format?

commandA                 ( a | b | c )

position = pos [(m | n | o )]

[space = space] [(m|n|o)]      

[option1]

[option2 = "Hello"]

[option3]

Note:
[ ] –> denotes optional,

( ) –> denotes mandatory

| –> denotes anyone of the value

Eg:

 commandA a position = 1.0<m> space = 2.0<n> option1  option2="Hello"

How to effectively represent this data in xml?

I tried something like this,

<command name="commandA" position = "position" >
     <option name="option1"/>  
     <option name="option2" value = "Hello"/>
     <option name="option3"/>
</command>

But how to handle the command value i.e a|b|c and position i.e m|n|o ?

EDIT:
Command: Syntax:

commandA (a|b|c) pos=0[w|x|y|z] [spa=0.0[w|x|y|z]] [str=”Hello”]

commandA a pos=0w spa=0.0z str=”Hello”

I tried something like this,

   <command name="commandA">
 <direction>
    <direction name="a"/>
    <direction name="b">
    <direction name="c"/>
 </direction>
 <parameter>
    <position value="pos=0" />
    <spacing value="spa=0.0" />
    <options>
        <option name="w"/>
        <option name="x"/>
        <option name="y"/>
        <option name="z"/>
    </options>
 </parameter>
 <string value="str=" />
 </command>

Any suggestions on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:10:35+00:00Added an answer on May 15, 2026 at 9:10 pm

    How about something like this. It combines tags to guide the autocompletion, along with tags for the command DOM:

    <ac:autocomlete>
      <command>   
        <command-name>commandA</command-name>
        <separator> </separator>
        <ac:choice>
          <command-type>a</command-type>
          <command-type>b</command-type>
          <command-type>c</command-type>
        </ac:choice>
        <separator> </separator>
        <pos>
           <pos-text>pos=</pos-text>
           <pos-value><ac:match regex="\d+"/></pos-value>
           <ac:optional>
              <ac:choice>
                 <pos-unit>w</pos-unit>
                 <pos-unit>x</pos-unit>
                 <pos-unit>y</pos-unit>
                 <pos-unit>z</pos-unit>
              </ac:choice>
           </ac:optional>
        </pos>
        <ac:optional>
           <spa-separator> </spa-separator>
           <spa>
              <spa-text>spa=</spa-text>
              <spa-value><ac:match regex="\d+\.\d+"/></spa-value>
              <ac:optional>
                <ac:choice>
                   <spa-unit>w</spa-unit>
                   <spa-unit>x</spa-unit>
                   <spa-unit>y</spa-unit>
                   <spa-unit>z</spa-unit>
                </ac:choice>
              </ac:optional>
           </spa>
        </ac:optional>
        <ac:optional>
           <arg-separator> </arg-separator>
           <arg-name>str=</arg-name>
           <arg-value><ac:match regex='"[^"]*"'/></arg-value>
        </ac:optional>
      </command>
    </autocomlete>
    

    The autocompletion code matches literal element text exactly once, unless it is contained in a choice or optional tag, which changes the behavior accordingly. I’ve put these autocomplete tags in a separate namespace, to separate what the auto-complete code recognises, and what is the DOM, although you don’t have to maintain a separate namespace if you don’t want to.

    The match tag matches/completes text according to a regular expression. When building the DOM, the match tags are replaced with the literal text that was entered.

    The auto-complete tags tell the auto-completion how to deal with child tags. The names of the child tags are arbitrary and are not used by auto-completion, but can be used in building a DOM for your command that the user has typed in: once the auto-complete has built the model, and auto-complete tags removed, what remains is a DOM for the command the user typed in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to represent certain data in following format using xml. root-> col1-item1 ->
I'm trying to figure out the best way to represent the following data structures
I need to represent the following records DATA 000200AA 00000200AA 000020BCD 00000020BCD 000020ABC AS
I need to build a form that shows data is the following format: M(1
I am reading data from another system that returns XML that provides the following
How can I represent the following in XSD. <price-update> <![CDATA[ arbitrary data goes here
Given data in the following format (tag_uri image_uri image_uri image_uri ...), I need to
I have been trying to represent the following data in a Flex Bubblechart.See the
So I have the following data that represets the hour and quarter hour with
I'm struggling to logically represent the following in a Django filter. I have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.