473,659 Members | 3,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSD For XML File

Hrm, I don't think it's possible to create a schema for the following XML, just
asking in hopes of some good suggestions for it:

<menuBar>
<menuBarItem>
<menu>
<menuItem />
<menuItem />
<menuItem>
<menu>
<menuItem />
</menu>
</menuItem>
</menu>
</menuBarItem>
</menuBar>

Get the picture? I don't think it's possible because of the <menu> grandchild of
the first <menu> node. Anyone have any ideas of what I can do to create a schema
so I can get intellisense in the .Net ide?

Thanks in advance,

Mythran
Nov 12 '05 #1
4 2255
This schema should work for you:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="menuBar">
<xs:complexType >
<xs:sequence>
<xs:element name="menuBarIt em" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="menu">
<xs:complexType >
<xs:sequence>
<xs:element name="menuItem" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hot mail.com> wrote in message
news:uo******** ********@TK2MSF TNGP10.phx.gbl. ..
Hrm, I don't think it's possible to create a schema for the following XML, just asking in hopes of some good suggestions for it:

<menuBar>
<menuBarItem>
<menu>
<menuItem />
<menuItem />
<menuItem>
<menu>
<menuItem />
</menu>
</menuItem>
</menu>
</menuBarItem>
</menuBar>

Get the picture? I don't think it's possible because of the <menu> grandchild of the first <menu> node. Anyone have any ideas of what I can do to create a schema so I can get intellisense in the .Net ide?

Thanks in advance,

Mythran

Nov 12 '05 #2
Thanks, I believe that's what I'm looking for :)

New question that I'm pondering while messing with the new xsd...

I see that under every element in intellisense, I see the <menuBarItem> as an
element I can enter. This is not valid according to "our" standards...whe n I
type in <menuBarItem> under <menu> or <menuItem> it produces an error (which is a
good thing, as it's not really valid)...but the question I'm wanting to ask
is...how can I keep the menuBarItem element from appearing under all elements
except the <menuBar> element?

<menuBarItem> is just one of the elements that are available...und er some others,
there are some that are not supposed to be listed as well...but are. I'm hoping
that if we can fix the <menuBarItem> element from appearing, I can see what I
need to do for the rest :)

Thanks much..

Mythran
"Zafar Abbas [MSFT]" <za****@microso ft.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
This schema should work for you:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="menuBar">
<xs:complexType >
<xs:sequence>
<xs:element name="menuBarIt em" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="menu">
<xs:complexType >
<xs:sequence>
<xs:element name="menuItem" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hot mail.com> wrote in message
news:uo******** ********@TK2MSF TNGP10.phx.gbl. ..
Hrm, I don't think it's possible to create a schema for the following XML,

just
asking in hopes of some good suggestions for it:

<menuBar>
<menuBarItem>
<menu>
<menuItem />
<menuItem />
<menuItem>
<menu>
<menuItem />
</menu>
</menuItem>
</menu>
</menuBarItem>
</menuBar>

Get the picture? I don't think it's possible because of the <menu>

grandchild of
the first <menu> node. Anyone have any ideas of what I can do to create a

schema
so I can get intellisense in the .Net ide?

Thanks in advance,

Mythran


Nov 12 '05 #3
What XML Editor are you using?
<menuBarItem> should only appear under <menuBar> and not on all elements.
"Mythran" <ki********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Thanks, I believe that's what I'm looking for :)

New question that I'm pondering while messing with the new xsd...

I see that under every element in intellisense, I see the <menuBarItem> as an element I can enter. This is not valid according to "our" standards...whe n I type in <menuBarItem> under <menu> or <menuItem> it produces an error (which is a good thing, as it's not really valid)...but the question I'm wanting to ask is...how can I keep the menuBarItem element from appearing under all elements except the <menuBar> element?

<menuBarItem> is just one of the elements that are available...und er some others, there are some that are not supposed to be listed as well...but are. I'm hoping that if we can fix the <menuBarItem> element from appearing, I can see what I need to do for the rest :)

Thanks much..

Mythran
"Zafar Abbas [MSFT]" <za****@microso ft.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
This schema should work for you:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="menuBar">
<xs:complexType >
<xs:sequence>
<xs:element name="menuBarIt em" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="menu">
<xs:complexType >
<xs:sequence>
<xs:element name="menuItem" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hot mail.com> wrote in message
news:uo******** ********@TK2MSF TNGP10.phx.gbl. ..
Hrm, I don't think it's possible to create a schema for the following
XML, just
asking in hopes of some good suggestions for it:

<menuBar>
<menuBarItem>
<menu>
<menuItem />
<menuItem />
<menuItem>
<menu>
<menuItem />
</menu>
</menuItem>
</menu>
</menuBarItem>
</menuBar>

Get the picture? I don't think it's possible because of the <menu>

grandchild of
the first <menu> node. Anyone have any ideas of what I can do to
create a schema
so I can get intellisense in the .Net ide?

Thanks in advance,

Mythran



Nov 12 '05 #4
I'm using the .Net IDE for editing the xml file...

I found out what was causing it and running more checks and tests on it to
manipulate it even more :)

The problem was in my xml code, for the <menuBar> element i had the xmlns
attribute defined...as follows:

<menuBar xmlns:mnu="blah ">

</menuBar>

I took out the :mnu portion and now it works...now I'm trying to remove all
qualifiers for the xml so it will work like the following:

<menuBar xmlns="blah">

</menuBar>

So far so good :) I'll let y'all know if I have anymore questions.

Mythran
"Zafar Abbas [MSFT]" <za****@microso ft.com> wrote in message
news:OO******** ******@tk2msftn gp13.phx.gbl...
What XML Editor are you using?
<menuBarItem> should only appear under <menuBar> and not on all elements.
"Mythran" <ki********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Thanks, I believe that's what I'm looking for :)

New question that I'm pondering while messing with the new xsd...

I see that under every element in intellisense, I see the <menuBarItem> as

an
element I can enter. This is not valid according to "our"

standards...whe n I
type in <menuBarItem> under <menu> or <menuItem> it produces an error

(which is a
good thing, as it's not really valid)...but the question I'm wanting to

ask
is...how can I keep the menuBarItem element from appearing under all

elements
except the <menuBar> element?

<menuBarItem> is just one of the elements that are available...und er some

others,
there are some that are not supposed to be listed as well...but are. I'm

hoping
that if we can fix the <menuBarItem> element from appearing, I can see

what I
need to do for the rest :)

Thanks much..

Mythran
"Zafar Abbas [MSFT]" <za****@microso ft.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
This schema should work for you:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="menuBar">
<xs:complexType >
<xs:sequence>
<xs:element name="menuBarIt em" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="menu">
<xs:complexType >
<xs:sequence>
<xs:element name="menuItem" maxOccurs="unbo unded" minOccurs="0">
<xs:complexType >
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbo unded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hot mail.com> wrote in message
news:uo******** ********@TK2MSF TNGP10.phx.gbl. ..
> Hrm, I don't think it's possible to create a schema for the following XML, just
> asking in hopes of some good suggestions for it:
>
> <menuBar>
> <menuBarItem>
> <menu>
> <menuItem />
> <menuItem />
> <menuItem>
> <menu>
> <menuItem />
> </menu>
> </menuItem>
> </menu>
> </menuBarItem>
> </menuBar>
>
> Get the picture? I don't think it's possible because of the <menu>
grandchild of
> the first <menu> node. Anyone have any ideas of what I can do to create a schema
> so I can get intellisense in the .Net ide?
>
> Thanks in advance,
>
> Mythran
>
>



Nov 12 '05 #5

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

Similar topics

2
3921
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
5
5451
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. I want to develop a webpage where people can send attachments that are stored on their local PC.
7
3529
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. How do i make the last pointer in the indirect sector that has another level of indirect pointer, and be defined recursively to support infinite large files? -code-
0
3931
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
0
2026
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers said to me that they have no problem doing that, but the following project file is said to be corrupted while opening in the IDE, it is the project file of NT xemacs BETA 21.5.24, http://ftp.xemacs.org/pub/beta/xemacs-21.5.24.tar.gz (under the...
0
8337
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
8851
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
8748
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
8531
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,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
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.