473,698 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading a COMPLEX CONTENT : Stan Can you help?

Hi STAN,
Stan: Thanks for your response to my previous post on reading a XSD file
using your article in
"https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".

it works quite well but I have one problem.. I am not able to read a Complex
Content.. Here is a portion of the XSD that contains the complex content. I
need to read the elements under it and could not get an handle to it..

Could you please help?

Thanks,
Ganesh
*************** ********
<xs:complexTy pe name="UserBasic ">
<xs:complexCont ent mixed="false">
<xs:extension base="core:OCID ataResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbo unded" name="placed"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="received"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="missed"
type="BasicLogE ntry" />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
*************** ********
Jan 12 '06 #1
4 1769
Ganesh,

Try this:

XmlSchemaType type;

// type = ...

if (type is XmlSchemaComple xType)

{

XmlSchemaComple xType ct = type as XmlSchemaComple xType;

if (ct.ContentMode l is XmlSchemaSimple Content)

{

// simple content processing

}

else

{

if (ct.ContentMode l is XmlSchemaComple xContent)

{

// complex content processing

}

// particle processing

XmlSchemaPartic le particle = null;

if (ct.ContentMode l == null)

particle = ct.Particle;

else

{

if (ct.ContentMode l.Content is XmlSchemaComple xContentExtensi on)

{

XmlSchemaComple xContentExtensi on xscce =
ct.ContentModel .Content as XmlSchemaComple xContentExtensi on;

particle = xscce.Particle;

}

else if (ct.ContentMode l.Content is
XmlSchemaComple xContentRestric tion)

{

XmlSchemaComple xContentRestric tion xsccr =
ct.ContentModel .Content as XmlSchemaComple xContentRestric tion;

particle = xsccr.Particle;

}

}

// particle processing code

}

}
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:B2******** *************** ***********@mic rosoft.com...
Hi STAN,
Stan: Thanks for your response to my previous post on reading a XSD file
using your article in
"https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".

it works quite well but I have one problem.. I am not able to read a
Complex
Content.. Here is a portion of the XSD that contains the complex content.
I
need to read the elements under it and could not get an handle to it..

Could you please help?

Thanks,
Ganesh
*************** ********
<xs:complexTy pe name="UserBasic ">
<xs:complexCont ent mixed="false">
<xs:extension base="core:OCID ataResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbo unded" name="placed"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="received"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="missed"
type="BasicLogE ntry" />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
*************** ********

Jan 12 '06 #2
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file and
representing the XSD in a Tree View (with nodes of all the elements) in a
..NET application. The problem that I have now is that the Tree works well but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the "WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
Ganesh,

Try this:

XmlSchemaType type;

// type = ...

if (type is XmlSchemaComple xType)

{

XmlSchemaComple xType ct = type as XmlSchemaComple xType;

if (ct.ContentMode l is XmlSchemaSimple Content)

{

// simple content processing

}

else

{

if (ct.ContentMode l is XmlSchemaComple xContent)

{

// complex content processing

}

// particle processing

XmlSchemaPartic le particle = null;

if (ct.ContentMode l == null)

particle = ct.Particle;

else

{

if (ct.ContentMode l.Content is XmlSchemaComple xContentExtensi on)

{

XmlSchemaComple xContentExtensi on xscce =
ct.ContentModel .Content as XmlSchemaComple xContentExtensi on;

particle = xscce.Particle;

}

else if (ct.ContentMode l.Content is
XmlSchemaComple xContentRestric tion)

{

XmlSchemaComple xContentRestric tion xsccr =
ct.ContentModel .Content as XmlSchemaComple xContentRestric tion;

particle = xsccr.Particle;

}

}

// particle processing code

}

}
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:B2******** *************** ***********@mic rosoft.com...
Hi STAN,
Stan: Thanks for your response to my previous post on reading a XSD file
using your article in
"https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".

it works quite well but I have one problem.. I am not able to read a
Complex
Content.. Here is a portion of the XSD that contains the complex content.
I
need to read the elements under it and could not get an handle to it..

Could you please help?

Thanks,
Ganesh
*************** ********
<xs:complexTy pe name="UserBasic ">
<xs:complexCont ent mixed="false">
<xs:extension base="core:OCID ataResponse">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbo unded" name="placed"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="received"
type="BasicLogE ntry" />
<xs:element minOccurs="0" maxOccurs="unbo unded" name="missed"
type="BasicLogE ntry" />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
*************** ********


Jan 13 '06 #3
I'm not sure what you're saying. Are the globals not ordered properly or
are you saying elements in a sequence are randomly ordered?

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:C8******** *************** ***********@mic rosoft.com...
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file
and
representing the XSD in a Tree View (with nodes of all the elements) in a
.NET application. The problem that I have now is that the Tree works well
but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the
"WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
Ganesh,

Try this:

XmlSchemaType type;

// type = ...

if (type is XmlSchemaComple xType)

{

XmlSchemaComple xType ct = type as XmlSchemaComple xType;

if (ct.ContentMode l is XmlSchemaSimple Content)

{

// simple content processing

}

else

{

if (ct.ContentMode l is XmlSchemaComple xContent)

{

// complex content processing

}

// particle processing

XmlSchemaPartic le particle = null;

if (ct.ContentMode l == null)

particle = ct.Particle;

else

{

if (ct.ContentMode l.Content is
XmlSchemaComple xContentExtensi on)

{

XmlSchemaComple xContentExtensi on xscce =
ct.ContentModel .Content as XmlSchemaComple xContentExtensi on;

particle = xscce.Particle;

}

else if (ct.ContentMode l.Content is
XmlSchemaComple xContentRestric tion)

{

XmlSchemaComple xContentRestric tion xsccr =
ct.ContentModel .Content as XmlSchemaComple xContentRestric tion;

particle = xsccr.Particle;

}

}

// particle processing code

}

}
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:B2******** *************** ***********@mic rosoft.com...
> Hi STAN,
> Stan: Thanks for your response to my previous post on reading a XSD
> file
> using your article in
> "https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".
>
> it works quite well but I have one problem.. I am not able to read a
> Complex
> Content.. Here is a portion of the XSD that contains the complex
> content.
> I
> need to read the elements under it and could not get an handle to it..
>
> Could you please help?
>
> Thanks,
> Ganesh
>
>
> *************** ********
> <xs:complexTy pe name="UserBasic ">
> <xs:complexCont ent mixed="false">
> <xs:extension base="core:OCID ataResponse">
> <xs:sequence>
> <xs:element minOccurs="0" maxOccurs="unbo unded" name="placed"
> type="BasicLogE ntry" />
> <xs:element minOccurs="0" maxOccurs="unbo unded"
> name="received"
> type="BasicLogE ntry" />
> <xs:element minOccurs="0" maxOccurs="unbo unded" name="missed"
> type="BasicLogE ntry" />
> </xs:sequence>
> </xs:extension>
> </xs:complexConte nt>
> </xs:complexType>
> *************** ********


Jan 17 '06 #4
If I draw a tree with all the nodes (for each element), the tree does not
represent the XSD in the same order as they appear in the actual file. The
elements are are in random.

Thanks,
Ganesh

"Stan Kitsis [MSFT]" wrote:
I'm not sure what you're saying. Are the globals not ordered properly or
are you saying elements in a sequence are randomly ordered?

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:C8******** *************** ***********@mic rosoft.com...
Hi Stan,
Thanks for the reply.It works well. Basically, I am reading the XSD file
and
representing the XSD in a Tree View (with nodes of all the elements) in a
.NET application. The problem that I have now is that the Tree works well
but
the nodes do not appear in the same order as they appear in the XSD file.
They are in any order. Do you know I could solve this?. I am creating the
nodes in the same way that you have the "recursive" calling of the
"WalkThe
Particle" sub.

Thanks for your time.
Ganesh
"Stan Kitsis [MSFT]" wrote:
Ganesh,

Try this:

XmlSchemaType type;

// type = ...

if (type is XmlSchemaComple xType)

{

XmlSchemaComple xType ct = type as XmlSchemaComple xType;

if (ct.ContentMode l is XmlSchemaSimple Content)

{

// simple content processing

}

else

{

if (ct.ContentMode l is XmlSchemaComple xContent)

{

// complex content processing

}

// particle processing

XmlSchemaPartic le particle = null;

if (ct.ContentMode l == null)

particle = ct.Particle;

else

{

if (ct.ContentMode l.Content is
XmlSchemaComple xContentExtensi on)

{

XmlSchemaComple xContentExtensi on xscce =
ct.ContentModel .Content as XmlSchemaComple xContentExtensi on;

particle = xscce.Particle;

}

else if (ct.ContentMode l.Content is
XmlSchemaComple xContentRestric tion)

{

XmlSchemaComple xContentRestric tion xsccr =
ct.ContentModel .Content as XmlSchemaComple xContentRestric tion;

particle = xsccr.Particle;

}

}

// particle processing code

}

}
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Ganesh Muthuvelu" <Ga************ *@discussions.m icrosoft.com> wrote in
message news:B2******** *************** ***********@mic rosoft.com...
> Hi STAN,
> Stan: Thanks for your response to my previous post on reading a XSD
> file
> using your article in
> "https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx".
>
> it works quite well but I have one problem.. I am not able to read a
> Complex
> Content.. Here is a portion of the XSD that contains the complex
> content.
> I
> need to read the elements under it and could not get an handle to it..
>
> Could you please help?
>
> Thanks,
> Ganesh
>
>
> *************** ********
> <xs:complexTy pe name="UserBasic ">
> <xs:complexCont ent mixed="false">
> <xs:extension base="core:OCID ataResponse">
> <xs:sequence>
> <xs:element minOccurs="0" maxOccurs="unbo unded" name="placed"
> type="BasicLogE ntry" />
> <xs:element minOccurs="0" maxOccurs="unbo unded"
> name="received"
> type="BasicLogE ntry" />
> <xs:element minOccurs="0" maxOccurs="unbo unded" name="missed"
> type="BasicLogE ntry" />
> </xs:sequence>
> </xs:extension>
> </xs:complexConte nt>
> </xs:complexType>
> *************** ********


Jan 17 '06 #5

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

Similar topics

0
1591
by: infinull | last post by:
I am making a script that is a very complex Content Management system. it makes a UDM navigation bar and writes content and a title. i want it to write content other that just basic text, like a calendar or a guest-book, and to do it with an extension system, the page says what type of content it is and an extension file processes the info. the content file would hold, a title, the type of content it is using, and content, the content...
0
1572
by: AL | last post by:
Hello, working on an xsd schema, I'd like it to have a node of which I don't know the content at design time: I want the document instance to identify such node contents, where content should have a complex structure (complex type). Probably xs:anytype is what I need, but I miss something... In the following schema, I define a "genericchild" node, which I'd want to be able to contain any (complex type) node I want to put in there: :...
13
5187
by: Dennis M. Straussfogel | last post by:
I'm trying to validate a page that begins with: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.did> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ....
0
1437
by: philip20060308 | last post by:
Hi all, Has anyone ever seen Python 2.4.1's httplib choke when reading chunked content? I'm using it via urrlib2, and I ran into a particular server that returns something that httplib doesn't expect. Specifically, in the code below where the error occurs, line == ''. Python 2.4.1 (#2, Oct 12 2005, 01:36:32) 20050518] on freebsd6 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2
2
2147
by: Paul Hale | last post by:
Hi, I have a c# application that I would like to read in a “somewebsite.url” file and extract the “Web document URL:” property for use in my app. Can anybody give me any pointers on how this can be done please? (If I crack it myself I will post the answer back here) Thanks,
4
1675
by: Vikas Kumar | last post by:
propertyDescription += "<br>" + lblpropertyDescription.Text; //here i am reading some text from text area i test wrting "p" in my text area it wrks fine but when i write <pin my text area it gives the following error Error Message:A potentially dangerous Request.Form value was detected from the client (lblpropertyDescription=" "). Stack Trace: at System.Web.HttpRequest.ValidateString(String s, String
1
2920
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4 instead of Pop3. Primary reason for that :- Is we want to better meet out SLA, so we have decided to go with the 2 instances of this application, and hence decided to use IMAP4 to concurrently accessing the mailboxes via IMAP4. My issues:- Now...
5
3726
by: Nathan Sokalski | last post by:
I have css that would normally be placed in style tags in the header of the Master page that I want to add programmatically for a specific Web Content Form (the *.aspx page). How do I do this for a Web Content Form? I cannot use style tags in a Web Content Form, and I am having trouble figuring out how to add all the desired css properties to a System.Web.UI.WebControls.Style object. Can anyone help me? Thanks. -- Nathan Sokalski...
5
2160
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could be 1 of these or 100....quantity can change***** </Tabs>
0
8680
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8609
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
9030
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
8899
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
8871
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
7738
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 projectplanning, coding, testing, and deploymentwithout 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
4371
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...
1
3052
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
3
2007
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.