Click here to Skip to main content
16,006,341 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How to test if node exists and it's not empty? Pin
Alvaro Mendez3-Jun-04 12:49
Alvaro Mendez3-Jun-04 12:49 
AnswerRe: How to test if node exists and it's not empty? Pin
Philip Fitzsimons2-Jun-04 3:25
Philip Fitzsimons2-Jun-04 3:25 
GeneralProblem with mailto link Pin
Alvaro Mendez1-Jun-04 9:10
Alvaro Mendez1-Jun-04 9:10 
GeneralXMLNode datagrid Pin
dotnet_cpp31-May-04 20:20
dotnet_cpp31-May-04 20:20 
GeneralXML Schema(s): Help Needed Pin
mlauzon2728-May-04 10:18
mlauzon2728-May-04 10:18 
GeneralRe: XML Schema(s): Help Needed Pin
JussiL2-Jun-04 8:34
JussiL2-Jun-04 8:34 
GeneralRe: XML Schema(s): Help Needed Pin
mlauzon272-Jun-04 8:47
mlauzon272-Jun-04 8:47 
GeneralRe: XML Schema(s): Help Needed Pin
JussiL2-Jun-04 23:55
JussiL2-Jun-04 23:55 
The schema itself was buggy as it had no root element and so on, but here's a refined version from it and below it you'll fin a sample xml-file. You still have to modify the schema so that it suites you purposes..

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="record">
<xs:complexType>
<xs:sequence>
<xs:element name="student" type="studentType"></xs:element>
<xs:element name="instructor" type="instructorType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="personType">
<xs:sequence>
<xs:element name="lastname" type="xs:string"></xs:element>
<xs:element name="firstname" type="xs:string"></xs:element>
<xs:element name="age" type="xs:integer"></xs:element>
<xs:element name="dateborn" type="xs:date"></xs:element>
<xs:element name="address" type="addressType"></xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="studentType">
<xs:complexContent>
<xs:extension base="personType">
<xs:sequence>
<xs:element name="stunum" type="xs:integer"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="instructorType">
<xs:complexContent>
<xs:extension base="personType">
<xs:sequence>
<xs:element name="someinfo" type="xs:string"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="addressType">
<xs:sequence>
<xs:element name="pnum" type="xs:integer"></xs:element>
<xs:element name="addnum" type="xs:integer"></xs:element>
<xs:element name="street" type="xs:string"></xs:element>
<xs:element name="city" type="xs:string"></xs:element>
<xs:element name="country" type="xs:string"></xs:element>
<xs:element name="poczip" type="xs:string"></xs:element>
</xs:sequence>
</xs:complexType>

</xs:schema>

and here's a piece of xml which can be validated with the schema:

<?xml version="1.0" encoding="UTF-8"?>
<record
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='schema.xsd'>
<student>
<lastname>Will</lastname>
<firstname>Smith</firstname>
<age>20</age>
<dateborn>1970-06-02</dateborn>
<address>
<pnum>235</pnum>
<addnum>234</addnum>
<street>Street</street>
<city>City</city>
<country>Country</country>
<poczip>123</poczip>
</address>
<stunum>123</stunum>
</student>
<instructor>
<lastname>John</lastname>
<firstname>Smith</firstname>
<age>20</age>
<dateborn>1960-06-02</dateborn>
<address>
<pnum>432</pnum>
<addnum>432</addnum>
<street>Street2</street>
<city>City2</city>
<country>Country2</country>
<poczip>321</poczip>
</address>
<someinfo>Some information</someinfo>
</instructor>
</record>



GeneralRe: XML Schema(s): Help Needed Pin
mlauzon273-Jun-04 6:00
mlauzon273-Jun-04 6:00 
GeneralRe: XML Schema(s): Help Needed Pin
JussiL3-Jun-04 20:57
JussiL3-Jun-04 20:57 
GeneralVB.net XmlNode to C# Pin
eggie527-May-04 13:34
eggie527-May-04 13:34 
GeneralRe: VB.net XmlNode to C# Pin
eggie527-May-04 15:18
eggie527-May-04 15:18 
GeneralLearning XML Schemas Pin
mlauzon2727-May-04 9:26
mlauzon2727-May-04 9:26 
GeneralRe: Learning XML Schemas Pin
Arjan Einbu27-May-04 13:37
Arjan Einbu27-May-04 13:37 
Generalxsl generating META tag Pin
IsaacB26-May-04 10:56
IsaacB26-May-04 10:56 
GeneralSAX parser - dont work Pin
VictorPr25-May-04 5:21
VictorPr25-May-04 5:21 
GeneralXSD importing problem Pin
Grimolfr24-May-04 4:50
Grimolfr24-May-04 4:50 
Questioncompiling expatpp ? Pin
caignaoli23-May-04 21:57
caignaoli23-May-04 21:57 
QuestionWhy am I getting "The expression...should result in a NodeSet"? Pin
Marc Clifton22-May-04 13:08
mvaMarc Clifton22-May-04 13:08 
AnswerRe: Why am I getting &quot;The expression...should result in a NodeSet&quot;? Pin
Mike Ellison22-May-04 13:47
Mike Ellison22-May-04 13:47 
GeneralRe: Why am I getting &quot;The expression...should result in a NodeSet&quot;? Pin
Marc Clifton22-May-04 14:48
mvaMarc Clifton22-May-04 14:48 
Generalamazon upload Need Help Pin
Sumit Kapoor19-May-04 19:52
Sumit Kapoor19-May-04 19:52 
QuestionXML the way? Pin
RichGuk18-May-04 11:16
RichGuk18-May-04 11:16 
AnswerRe: XML the way? Pin
Christian Graus18-May-04 11:45
protectorChristian Graus18-May-04 11:45 
AnswerRe: XML the way? Pin
eggie527-May-04 13:44
eggie527-May-04 13:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.