473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

xml reference problem

gg
is it possible to have a complex type with attribute pointing to another
member
of the complex type?

for example, I tried
<xsd:complexType name="RegexTypes" />
<xsd:sequence>
<xsd:element name="regexName" type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
<xsd:attribute name="level" type="xsd:string" />
...
<xsd:attributeGroup ref="RegexTypes">

<!-- error on next line's xsd:attribute, same for replacing with
element -->
<xsd:attribute name="nextRegexLink" type="regexName" minOccurs="0"
maxOccurs="unbounded" />
</xsd:attributeGroup>
</xsd:complexType>
</xsd:complexType>
<xsd:element name="comment" type="xsd:string">
</xsd:element>
and I get:
Warning 2 The element 'attributeGroup' in namespace
'http://www.w3.org/2001/XMLSchema' has invalid child element 'attribute' in
namespace 'http://www.w3.org/2001/XMLSchema'. List of possible elements
expected: 'annotation' in namespace 'http://www.w3.org/2001/XMLSchema'.
D:\data\Ieproj\Util\RegexDotNet\regex.xsd 34 8 Miscellaneous Files

Warning 1 The 'http://www.w3.org/2001/XMLSchema:attribute' element is not
supported in this context. D:\data\Ieproj\Util\RegexDotNet\regex.xsd 34 8
Miscellaneous Files


I tried another approach that seem to be acceptable to ms visual studio but
not to NetBean IDE 5.5:
<xsd:group name="RegexCollection">
<xsd:sequence>
<xsd:element name="favorite" type="xsd:string" />
..............

<xsd:element ref="comment" />
<xsd:element name="regexType" type="RegexTypes" />
<xsd:element name="nextRegexLink" type="regexName" minOccurs="0"
maxOccurs="unbounded" />

</xsd:sequence>
</xsd:group>
<xsd:complexType name="RegexTypes">
<xsd:sequence>
<xsd:element name="regexName" type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
.............
</xsd:complexType>

src-resolve: Cannot resolve the name 'regexName' to a(n) 'type definition'
component. [47]
XML validation finished.
Mar 28 '07 #1
1 3843
gg
apparently not according to w3 attribute group spec.
however
something like the following does get validated by Netbean 5.5
Netbean does accept something like this
<xsd:group name="RegexCollection">
<xsd:sequence>
...
<xsd:element ref="comment" />
<xsd:element name="regexType" type="RegexTypes" />
<xsd:element name="nextRegexLink" type="regexNameType" />
</xsd:sequence>
</xsd:group>
<xsd:complexType name="regexNameType">
<xsd:sequence>
<xsd:unique name="item-name-uniqueness">
<xsd:selector xpath="item" />
<xsd:field xpath="name" />
</xsd:unique>
<xsd:element name="regexNameBase" type="xsd:Name" />
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="RegexTypes">
<xsd:sequence>
<xsd:element name="regexName" type="regexNameType" />
...
</xsd:sequence>
</xsd:complexType>
I tried to effect the same orginal end result by specifying uniqueness on
the complexType regexNameType
"gg" <gg@Edm.noMail.netwrote in message
news:LOBOh.24713$x9.1300@edtnps89...
is it possible to have a complex type with attribute pointing to another
member
of the complex type?

for example, I tried
<xsd:complexType name="RegexTypes" />
<xsd:sequence>
<xsd:element name="regexName" type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
<xsd:attribute name="level" type="xsd:string" />
...
<xsd:attributeGroup ref="RegexTypes">

<!-- error on next line's xsd:attribute, same for replacing with
element -->
<xsd:attribute name="nextRegexLink" type="regexName" minOccurs="0"
maxOccurs="unbounded" />
</xsd:attributeGroup>
</xsd:complexType>
</xsd:complexType>
<xsd:element name="comment" type="xsd:string">
</xsd:element>
and I get:
Warning 2 The element 'attributeGroup' in namespace
'http://www.w3.org/2001/XMLSchema' has invalid child element 'attribute'
in
namespace 'http://www.w3.org/2001/XMLSchema'. List of possible elements
expected: 'annotation' in namespace 'http://www.w3.org/2001/XMLSchema'.
D:\data\Ieproj\Util\RegexDotNet\regex.xsd 34 8 Miscellaneous Files

Warning 1 The 'http://www.w3.org/2001/XMLSchema:attribute' element is not
supported in this context. D:\data\Ieproj\Util\RegexDotNet\regex.xsd 34 8
Miscellaneous Files


I tried another approach that seem to be acceptable to ms visual studio
but
not to NetBean IDE 5.5:
<xsd:group name="RegexCollection">
<xsd:sequence>
<xsd:element name="favorite" type="xsd:string" />
..............

<xsd:element ref="comment" />
<xsd:element name="regexType" type="RegexTypes" />
<xsd:element name="nextRegexLink" type="regexName" minOccurs="0"
maxOccurs="unbounded" />

</xsd:sequence>
</xsd:group>
<xsd:complexType name="RegexTypes">
<xsd:sequence>
<xsd:element name="regexName" type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
.............
</xsd:complexType>

src-resolve: Cannot resolve the name 'regexName' to a(n) 'type definition'
component. [47]
XML validation finished.


Mar 30 '07 #2

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

Similar topics

2
by: Pkpatel | last post by:
Hi, I keep getting this error every time I try to load crystalreportviewer on a webform with a dataset. Here is the error: -------------------------------------------------------- Server...
6
by: trexim | last post by:
Hi, I am trying to create a Web Reference for CSTA using the URL http://www.ecma-international.org/standards/ecma-348/csta-wsdl/csta-wsdl-all-operations.wsdl Visual .Net complains that: "...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
5
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. ...
27
by: David W | last post by:
I'm almost tearing my hair out. A colleague claimed that a null reference can exist, like this: void f( int& p ) { printf( "%d\n", p ); } int main (int argc, char *argv) {
8
by: toton | last post by:
HI, One more small doubt from today's mail. I have certain function which returns a pointer (sometimes a const pointer from a const member function). And certain member function needs reference...
2
by: toton | last post by:
Hi, This is continuation of topic pointer & reference doubt. http://groups.google.com/group/comp.lang.c++/browse_thread/thread/df84ce6b9af561f9/76304d7d77f6ccca?lnk=raot#76304d7d77f6ccca But I...
29
by: shuisheng | last post by:
Dear All, The problem of choosing pointer or reference is always confusing me. Would you please give me some suggestion on it. I appreciate your kind help. For example, I'd like to convert a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.