473,714 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do you add an xml schema attributegroup to a complextype extension?

I am trying to get my schema to look like this

<xsd:extensio n base="MyExtensi on">
<xsd:attributeG roup ref="DocumentAt tributes">
<xsd:annotation >
<xsd:documentat ion>Notes</xsd:documentati on>
</xsd:annotation>
</xsd:attributeGr oup>
</xsd:extension>
I know I need to add the attributeGroup to the complextype extension

I coded as so

MyComplexTypeEx tension.Attribu te.Add(Attribut eGroup);

When I call the streamwriter to write the schema to a file, an
exception error is thrown.

Anyone know the correct code to do this?

Thanks

Nov 12 '05 #1
3 2029
Make sure that the object you add to the extension is a
XmlSchemaAttrib uteGroupRef.
Please post your code and data if it is still a problem.
Zafar

<co********@yah oo.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I am trying to get my schema to look like this

<xsd:extensio n base="MyExtensi on">
<xsd:attributeG roup ref="DocumentAt tributes">
<xsd:annotation >
<xsd:documentat ion>Notes</xsd:documentati on>
</xsd:annotation>
</xsd:attributeGr oup>
</xsd:extension>
I know I need to add the attributeGroup to the complextype extension

I coded as so

MyComplexTypeEx tension.Attribu te.Add(Attribut eGroup);

When I call the streamwriter to write the schema to a file, an
exception error is thrown.

Anyone know the correct code to do this?

Thanks

Nov 12 '05 #2

XmlSchemaComple xContentExtensi on cce =
CreateExtension Base("MyComplex ContentExt");
XmlSchemaAttrib uteGroup DocAttrGroup =
CreateAttribute Group("MyAttrib uteGroup);
XmlSchemaAnnota tion annot = new XmlSchemaAnnota tion();
XmlSchemaDocume ntation doc = new XmlSchemaDocume ntation();
XmlDocument doc = new XmlDocument();
XmlSchemaAnnota tion annot = new XmlSchemaAnnota tion();
XmlNode newNode = new XmlNode[1]{ doc.CreateTextN ode(strText)};
doc.Markup = newNode;
annot.Items.Add (doc);
DocAttrGroup.An notation = annot;
cce.Attributes. Add(DocAttrGrou p);

Nov 12 '05 #3
You are adding an object of type XmlSchemaAttrib uteGroup to the Attributes
collection. It should be of the type XmlSchemaAttrib uteGroupRef.
<co********@yah oo.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .

XmlSchemaComple xContentExtensi on cce =
CreateExtension Base("MyComplex ContentExt");
XmlSchemaAttrib uteGroup DocAttrGroup =
CreateAttribute Group("MyAttrib uteGroup);
XmlSchemaAnnota tion annot = new XmlSchemaAnnota tion();
XmlSchemaDocume ntation doc = new XmlSchemaDocume ntation();
XmlDocument doc = new XmlDocument();
XmlSchemaAnnota tion annot = new XmlSchemaAnnota tion();
XmlNode newNode = new XmlNode[1]{ doc.CreateTextN ode(strText)};
doc.Markup = newNode;
annot.Items.Add (doc);
DocAttrGroup.An notation = annot;
cce.Attributes. Add(DocAttrGrou p);

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1416
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I wonder wether the W3C has published an XML Schema for XLink. I want in a schema to describe an element which must have the XLink attributes. How can I do this ?
4
2934
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are defined in a different namespace from the element.
9
8826
by: Stanimir Stamenkov | last post by:
Using Xerces2 Java I'm trying to validate a CSV data following an XNI example <http://xml.apache.org/xerces2-j/xni-config.html#examples>. The CSV scanner generates XML tree events like: <csv> <row> <col>Andy Clark</col> <col>16 Jan 1973</col> <col>Cincinnati</col>
1
6399
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there should be getRateQuote, and QUOTEREQUEST, etc.
2
1154
by: steve_marjoribanks | last post by:
I have a section of a schema below and I've got a problem I can'y figure out. I'm not having a good day though so it's probably just me being stupid!! ;-) I need the shearStrength element to have an xink:href attribute as shown below but I also need it to have something like: <extension base="float"> <attributeGroup ref="ags:UoMGroup" /> </extension>
4
1304
by: olivier.scalbert | last post by:
Hello, I need to create an xsd to validate the following type of xml: <?xml version="1.0" encoding="UTF-8"?> <root <exception1 xsi:type="ExceptionAType"> <Type>1</Type> <Info>Bla bla</Info> </exception1>
1
3048
by: Blue Doze | last post by:
Hello, I have the following XML schema fragment: <xs:complexType name="type.1"> <xs:simpleContent> <xs:restriction base="ns:type"> <xs:simpleType> <xs:restriction base="xs:positiveInteger"/> </xs:simpleType>
0
2628
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of the particle of the base this xsd file is valid as per w3c standard i am also providing error in detail and geometry.xsd file geometry.xsd <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://www.opengis.net/gml"...
0
3362
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="alarm-manual alarm-manual.xsd" <h:p>Text ... <a:par-value name="myName"/... text </h:p>
0
8808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8712
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9316
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4727
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2524
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.