Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML defintion

Reply
Thread Tools

XML defintion

 
 
yasar.khan@gmail.com
Guest
Posts: n/a
 
      07-31-2006
Is there any way we can replicate language "c" enum in XML schema? for
example

enum
{
GREEN =1001,
YELLOW
RED
}

so in c once you refer GREEN it means 1001. Do we have anything like
this in XML schema?

Yasar

 
Reply With Quote
 
 
 
 
Jure Sah
Guest
Posts: n/a
 
      07-31-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) pravi:
> Is there any way we can replicate language "c" enum in XML schema? for
> example
>
> enum
> {
> GREEN =1001,
> YELLOW
> RED
> }
>
> so in c once you refer GREEN it means 1001. Do we have anything like
> this in XML schema?


<enum>
<green value=1001 />
<yellow />
<red />
</enum>

--
Primary function: Coprocessor
Secondary function: Cluster commander

http://www.thought-beacon.net

Pay once per lifetime webhosting:
http://farcomm-it.com/?ref=jsah

We are the paragon of humanity. You may worship us. From afar.

01010010 01100101 01110011 01101001 01100100 01100101 01101110 01110100
01000010 01000001 01010011 01001001 01000011
 
Reply With Quote
 
 
 
 
yasar.khan@gmail.com
Guest
Posts: n/a
 
      08-01-2006

Jure Sah wrote:
> (E-Mail Removed) pravi:
> > Is there any way we can replicate language "c" enum in XML schema? for
> > example
> >
> > enum
> > {
> > GREEN =1001,
> > YELLOW
> > RED
> > }
> >
> > so in c once you refer GREEN it means 1001. Do we have anything like
> > this in XML schema?

>
> <enum>
> <green value=1001 />
> <yellow />
> <red />
> </enum>
>
> --
> Primary function: Coprocessor
> Secondary function: Cluster commander
>
> http://www.thought-beacon.net
>
> Pay once per lifetime webhosting:
> http://farcomm-it.com/?ref=jsah
>
> We are the paragon of humanity. You may worship us. From afar.
>
> 01010010 01100101 01110011 01101001 01100100 01100101 01101110 01110100
> 01000010 01000001 01010011 01001001 01000011


No I have to define like this and I have no way to assign value to
individual element.
<xsd:simpleType name="floodEnum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="unicast"/>
<xsd:enumeration value="multicast"/>
<xsd:enumeration value="broadcast"/>
<xsd:enumeration value="all"/>
</xsd:restriction>
</xsd:simpleType>

 
Reply With Quote
 
Boris Kolpackov
Guest
Posts: n/a
 
      08-01-2006
Hi Yasar,

"(E-Mail Removed)" <(E-Mail Removed)> writes:

> Is there any way we can replicate language "c" enum in XML schema? for
> example
>
> enum
> {
> GREEN =1001,
> YELLOW
> RED
> }
>
> so in c once you refer GREEN it means 1001. Do we have anything like
> this in XML schema?


XML Schema describes what will be allowed in XML instances. It can either
be GREEN (e.g., as a string) or 1001 (as an integer). The fact that GREEN
means 1001 is an application-specific logic. So I suggest that you simply
translate enum symbols to numbers (or to C enumerators) in your
application. Though this can be a major inconvenience if you are using
XML data binding and the tool generates C/C++ enums that start from 0.


hth,
-boris


--
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Type Defintion Cannot be Abstract" Lord0 XML 3 02-26-2007 12:20 PM
Function Declaration and Defintion Problem Amit_Basnak C++ 5 12-28-2006 09:55 AM
What would this defintion mean: int Function(class CString filename) huguogang@gmail.com C++ 4 10-02-2006 07:31 AM
Different TD style defintion per table? Bardo HTML 3 07-11-2004 12:11 PM
XSD document for XSD defintion Rick Razzano XML 1 09-26-2003 12:41 AM



Advertisments