473,788 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:complexTyp e name="RegexType s" />
<xsd:sequence >
<xsd:element name="regexName " type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
<xsd:attribut e name="level" type="xsd:strin g" />
...
<xsd:attributeG roup ref="RegexTypes ">

<!-- error on next line's xsd:attribute, same for replacing with
element -->
<xsd:attribut e name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />
</xsd:attributeGr oup>
</xsd:complexType >
</xsd:complexType >
<xsd:element name="comment" type="xsd:strin g">
</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\RegexDotNe t\regex.xsd 34 8 Miscellaneous Files

Warning 1 The 'http://www.w3.org/2001/XMLSchema:attri bute' element is not
supported in this context. D:\data\Ieproj\ Util\RegexDotNe t\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="RegexColl ection">
<xsd:sequence >
<xsd:element name="favorite" type="xsd:strin g" />
..............

<xsd:element ref="comment" />
<xsd:element name="regexType " type="RegexType s" />
<xsd:element name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />

</xsd:sequence>
</xsd:group>
<xsd:complexTyp e name="RegexType s">
<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 3861
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="RegexColl ection">
<xsd:sequence >
...
<xsd:element ref="comment" />
<xsd:element name="regexType " type="RegexType s" />
<xsd:element name="nextRegex Link" type="regexName Type" />
</xsd:sequence>
</xsd:group>
<xsd:complexTyp e name="regexName Type">
<xsd:sequence >
<xsd:unique name="item-name-uniqueness">
<xsd:selector xpath="item" />
<xsd:field xpath="name" />
</xsd:unique>
<xsd:element name="regexName Base" type="xsd:Name" />
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="RegexType s">
<xsd:sequence >
<xsd:element name="regexName " type="regexName Type" />
...
</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.2471 3$x9.1300@edtnp s89...
is it possible to have a complex type with attribute pointing to another
member
of the complex type?

for example, I tried
<xsd:complexTyp e name="RegexType s" />
<xsd:sequence >
<xsd:element name="regexName " type="xsd:Name" />
<xsd:element ref="comment" />
</xsd:sequence>
<xsd:attribut e name="level" type="xsd:strin g" />
...
<xsd:attributeG roup ref="RegexTypes ">

<!-- error on next line's xsd:attribute, same for replacing with
element -->
<xsd:attribut e name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />
</xsd:attributeGr oup>
</xsd:complexType >
</xsd:complexType >
<xsd:element name="comment" type="xsd:strin g">
</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\RegexDotNe t\regex.xsd 34 8 Miscellaneous Files

Warning 1 The 'http://www.w3.org/2001/XMLSchema:attri bute' element is not
supported in this context. D:\data\Ieproj\ Util\RegexDotNe t\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="RegexColl ection">
<xsd:sequence >
<xsd:element name="favorite" type="xsd:strin g" />
..............

<xsd:element ref="comment" />
<xsd:element name="regexType " type="RegexType s" />
<xsd:element name="nextRegex Link" type="regexName " minOccurs="0"
maxOccurs="unbo unded" />

</xsd:sequence>
</xsd:group>
<xsd:complexTyp e name="RegexType s">
<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
10549
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 Error in '/Cr_Dataset' Application. ----------------------------------------------------------- ---------------------
6
5623
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: " The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading
2
2597
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 good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
2
3060
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 what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
3
4414
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 really understand how this could be an issue. The assemblies that the system is complaining about are ones that we build here and we're not changing version numbers on anything. The errors come and go with no apparent rhyme or reason. We do not...
5
49828
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. To do this, I created a reference to "Microsoft Excel 11.0 Object Library", and have a "using Excel;" directive. I decided to add a method for creating a TextBox using the Shapes.AddTextBox method, which requires a
27
4234
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
2402
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 (or better a const reference). for eg, const PointRange* points = cc.points(ptAligned);
2
2845
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 think it is better to have a new topic rather than continuing on old one. As now I am sure pointer to reference and reference to pointer are freely convertable, the potential danger lies in the first one. Pointer may be NULL, but reference should...
29
3656
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 string to a integer number. bool Convert(const string& str, int* pData); bool Convert(const string& str, int& data);
0
9656
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
9498
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
10175
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...
1
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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
8993
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
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.