LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2006, 01:30 PM   #1
jwstric2
Member
 
Registered: Jan 2004
Posts: 105

Rep: Reputation: 15
xmlbeans and "special" generic types


I hope this explanation is clear. It might not even be possible but any opinion is welcome.

Im working on modeling some switches for configuration information. The model we are going with is to describe switches just like part of the OSI model, thus we have a physical, link, network, ect.. entity. Thus far I have the following start for physical:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Root">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="System" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="Physical">
                                <xs:annotation>
                                    <xs:documentation>OSI Layer 1: hardware</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element ref="Element" minOccurs="0" maxOccurs="unbounded"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>                            
                        </xs:all>
                    </xs:complexType>
                </xs:element>
                <xs:element name="Customer" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="Element">
        <xs:sequence>
            <xs:element name="Shelf" type="Shelf" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Shelf">
        <xs:sequence>
            <xs:element name="Slot" type="Slot" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Slot">
        <xs:sequence>
            <xs:element name="Card" type="Card"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Card">
        <xs:sequence>
            <xs:element name="Port" type="Port" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Port"/>
    <xs:element name="Element" type="Element">
        <xs:annotation>
            <xs:documentation>There are many different kinds of elements, but in this cut we are only covering the core router.</xs:documentation>
        </xs:annotation>
    </xs:element>
</xs:schema>
What I would like to do is to leave card a generic type as shown but have restrictions that shows cards based on the slot type. For example, if you have a slot instance 2, then 64 bit card types are allowed to be put in this slot. Course this assumes I have a key id of number for the slot.

Any help is appreciated. Thanks.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Generic error "cannot fetch general purpose registers for thread, no such process"? kranti Programming 0 10-22-2005 06:18 AM
NVidia GeForce 4 on Mandrake 10.1 shows "Generic" module... SAFX Mandriva 12 10-16-2004 12:36 PM
warning "conflicting types for buit-in function" while cross-compiling cheema Programming 0 07-07-2004 03:02 AM
where can i find a "VESA driver(generic)" drive rutins or something like lillen Linux - Software 7 02-24-2004 12:48 AM
need help, on how to access quickly to special characters like "ñ" or "á"? Motaro Linux - Newbie 1 12-31-2003 11:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration