Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / November 2005

Tip: Looking for answers? Try searching our database.

simpleContent extension and attributes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SideByEach - 04 Nov 2005 21:38 GMT
Check out the sample XML below.

Sample XML:
    <xs:element name="Image">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="Type" type="xs:string" use="required"/>
                    <xs:attribute name="Name" type="xs:string" use="required"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

If I was at the "Image" element in a XmlSchema object. How would I get
access to the attributes "Type" and "Name"?

If this type wasn't a "simpleContent" extension I would do the
following:

               Dim eDerivedType As XmlSchemaComplexType =
DirectCast(sType.BaseXmlSchemaType,
System.Xml.Schema.XmlSchemaComplexType)

       For Each att As XmlSchemaAttribute In eDerivedType.Attributes
       Next 'att

I've looked through the object via the intellisense but can't seem to
find the attributes. Is the really a valid schema?
Zafar Abbas - 04 Nov 2005 22:26 GMT
Given the XmlSchemaComplexType as ct.
ct.ContentModel must be of type XmlSchemaSimpleContentExtension. Just look
in its Attributes property.

> Check out the sample XML below.
>
[quoted text clipped - 25 lines]
> I've looked through the object via the intellisense but can't seem to
> find the attributes. Is the really a valid schema?
SideByEach - 07 Nov 2005 13:07 GMT
Can you clarify your post. I can't make heads or tails out of it. The
XmlSchemaComplexType object I have has no attributes for the above
portion of the schema.
Zafar Abbas - 07 Nov 2005 19:28 GMT
The XmlSchemaComplexType object contains a ContentModel object, which is of
the type XmlSchemaSimpleContentExtension, _this_ object has an attributes
property.

> Can you clarify your post. I can't make heads or tails out of it. The
> XmlSchemaComplexType object I have has no attributes for the above
> portion of the schema.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.