473,387 Members | 1,641 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,387 software developers and data experts.

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 2246
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="menuBarItem" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" 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="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hotmail.com> wrote in message
news:uo****************@TK2MSFTNGP10.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...when 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...under 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****@microsoft.com> wrote in message
news:u$**************@TK2MSFTNGP10.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="menuBarItem" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" 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="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hotmail.com> wrote in message
news:uo****************@TK2MSFTNGP10.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********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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...when 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...under 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****@microsoft.com> wrote in message
news:u$**************@TK2MSFTNGP10.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="menuBarItem" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" 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="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hotmail.com> wrote in message
news:uo****************@TK2MSFTNGP10.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****@microsoft.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
What XML Editor are you using?
<menuBarItem> should only appear under <menuBar> and not on all elements.
"Mythran" <ki********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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...when 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...under 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****@microsoft.com> wrote in message
news:u$**************@TK2MSFTNGP10.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="menuBarItem" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" 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="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="menu" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

"Mythran" <ki********@hotmail.com> wrote in message
news:uo****************@TK2MSFTNGP10.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
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...
5
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. ...
7
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. ...
0
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....
0
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...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.