.NET XML

Moderators: None (Apply to moderate this forum)
Number of threads: 16
Number of posts: 18

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
XML parsing using XLinq Posted by Jason8788 on 5 Oct 2011 at 2:38 PM
I have a simple XML schema from a video recorder that I need to parse using XLinq. All of the XLinq example seem to take a XML document. Here is the schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GPSIndexes">
<xs:complexType>
<xs:sequence>
<xs:element name="annotation">
<xs:complexType>
<xs:sequence>
<xs:element name="documentation" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RHXmlType" type="xs:string" />
<xs:element name="RHXmlVersion" type="xs:decimal" />
<xs:element name="mediaName" type="xs:string" />
<xs:element name="dateCreated" type="xs:decimal" />
<xs:element name="timeCodeOffset" type="xs:unsignedByte" />
<xs:element maxOccurs="unbounded" name="GPSIndex">
<xs:complexType>
<xs:sequence>
<xs:element name="lon" type="xs:decimal" />
<xs:element name="lat" type="xs:decimal" />
<xs:element name="altitude" type="xs:decimal" />
<xs:element name="timeCode" type="xs:string" />
<xs:element name="name" />
<xs:element name="utcTime" type="xs:decimal" />
<xs:element name="course" type="xs:decimal" />
<xs:element name="speed" type="xs:decimal" />
<xs:element name="azimuth" type="xs:byte" />
<xs:element name="dop" type="xs:decimal" />
<xs:element name="fix" type="xs:string" />
<xs:element name="satsinuse" type="xs:unsignedByte" />
<xs:element name="geoidht" type="xs:decimal" />
<xs:element name="range" type="xs:unsignedByte" />
<xs:element name="data" type="xs:unsignedByte" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

What is the proper way to load this into XLinq so I can validate XML?

Thanks,
Jason.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.