[xsde-users] Cannot get the value

Keith Oppenheim KOppenheim at nextpointnetworks.com
Thu Jul 3 18:09:33 EDT 2008

Hi Boris,

The schema fragment attached by Khuong comes directly from the NETCONF
schema defined in RFC 4741.  The schema defines a <source> element
that's nested inside of a <get-config> element.  The <source> element is
of type="getConfigSourceType":

<xs:complexType name="getConfigSourceType">
         <xs:element ref="config-name"/>
         <xs:element name="url" type="configURIType"/>

The schema is structured to give the user flexibility in defining the
element nested within <source>.  The user can nest one of <running/>,
<candidate/>, or <startup/> elements within <source>.  Alternatively,
via the substitution group mechanism, the user can nest any user-defined
element as long as it derives from configNameType and uses <config-name>
as the head of its substitution group. 


Keith Oppenheim
NextPoint Networks, Inc.
-----Original Message-----
From: xsde-users-bounces at codesynthesis.com
[mailto:xsde-users-bounces at codesynthesis.com] On Behalf Of Boris
Sent: Wednesday, June 25, 2008 9:25 AM
To: Khuong Nguyen Thi Lien
Cc: xsde-users at codesynthesis.com
Subject: Re: [xsde-users] Cannot get the value

Hi Khuong,

Khuong Nguyen Thi Lien <ntlkhuong at tma.com.vn> writes:

> <xs:complexType name="configNameType"/>
>             <xs:element name="config-name" type="configNameType"
> abstract="true"/>
>             <xs:element name="startup" type="configNameType"
> substitutionGroup="config-name"/>
>             <xs:element name="candidate" type="configNameType"
> substitutionGroup="config-name"/>
>             <xs:element name="running" type="configNameType"
> substitutionGroup="config-name"/>

This schema does not make much sense since the elements that substitute
config-name (startup, candidate, and running) all use the same type as
config-name. Normally you would have types derived from configNameType
for startup, candidate, and running, for example (normally such types
would also include additional elements/attributes):

<xs:complexType name="startupType">
    <extension base="configNameType"/>

<xs:element name="startup" type="startupType" 

<xs:complexType name="candidateType">
    <extension base="configNameType"/>

<xs:element name="candidate" type="candidateType" 

<xs:complexType name="runningType">
    <extension base="configNameType"/>

<xs:element name="running" type="runningType" 

Then you would implement parser skeletons for each of them and
add them to the map that is used to parse config-name. During
parsing, depending on the actual element name found in XML (e.g.,
running, startup, etc.), the corresponding parser skeleton will
be executed.


More information about the xsde-users mailing list