473,396 Members | 2,154 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,396 software developers and data experts.

XML Schemas (SOM) - Finding order of elements

Hi all,

I am a newbie to using the XML Schema Object Model (SOM) and would like a
few pointers on how to perform a particular task.
I am essentially trying to search for elements/attributes via the SOM as
they appear in a visual XML editor (as in the tree view).
I need to be able to:
1. Start by finding the "root node" of the schema. I.e. the complex type
that contains references to all other types.
2. Move to each nested complex type in the order in which they appear in the
tree.
For example, I have a schema that defines an instance document that looks
like:

<RootNode>
<Child1>
<Child1_01>
<Child1_02>
</Child1>
<Child2>
<Child2_01>
<Child2_02>
</Child2>

I need to be able to load the schema from file, seek to "RootNode".
Then I should be able to determine that "Child1" is the first immediate
child of "RootNode".
From there I should be able to determine that "Child1_01" is the first
immediate child of "Child1", etc. etc.
"Child1" is also defined with a ref="Child1_01" as "Child1_01" is also a
complex type. I am assuming there is some way through the API to follow
through to the references of the element.

Any pointers much appreciated.
I hope I have explained well enough!

Cheers,

Bardo
Nov 9 '06 #1
2 1141
Bardo wrote:
I am a newbie to using the XML Schema Object Model (SOM) and would like a
few pointers on how to perform a particular task.
That article
<http://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspxmight
help.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 9 '06 #2
Thanks Martin,

The article/code sample "Generating XSD from sample XML" in MSDN:

http://msdn.microsoft.com/xml/defaul...tml/xmlgen.asp

Also helped.

Bardo

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:u5*************@TK2MSFTNGP04.phx.gbl...
Bardo wrote:
>I am a newbie to using the XML Schema Object Model (SOM) and would like a
few pointers on how to perform a particular task.

That article
<http://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspxmight
help.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 10 '06 #3

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

Similar topics

0
by: kyancy | last post by:
Hello All. We have several XML schemas to describe common component document parts. We then create new XML schemas as necessary that use "xsd:import schemaLocation=whateverLocation.." to include...
0
by: edkawas | last post by:
Hi, Can the following be done? I have some elements, that can have other sub elements with mixed content. The sub elements can either be restricted via min=1, max=1 or min=1 max=unbounded.
3
by: Matt Frame | last post by:
I am just starting to work with Schemas and VB.Net. I created a simple schema with a structure of a top level group, then inside that group I have sub-groups and elements and within the sub-groups...
4
by: anonymous | last post by:
When I use the schema collection to apply many schemas to one XML instance document, I get an error if I do not qualify every element with the appropriate namespace. Both the W3C site and this...
5
by: rox.scott | last post by:
The following article says the .NET SOM will not allow what it calls "non-deterministic" schemas...
3
by: rossu | last post by:
One of the nice features of XML is that it is order independent i.e. <a>1</a><b>2</b> works as well as ><b>2</b><a>1</a>. Unfortunately, the schema system in .NET doesn't seem to be happy with...
2
by: Darrell Plank | last post by:
I'm a real XML novice, but my ultimate goal here is to get a workable schema for the GEDCOM XML format as spec'ed out here: http://www.familysearch.org/GEDCOM/GedXML60.pdf It's a proposed XML...
2
by: Bardo | last post by:
Hi all, I am a newbie to using the XML Schema Object Model (SOM) and would like a few pointers on how to perform a particular task. I am essentially trying to search for elements/attributes via...
0
by: IsValidUN | last post by:
Does anyone have a recommendation for handling a case where (at least) two schemas define an class with only slight variation, as to the best way to handle so I can combine to one class? For...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.