Click here to Skip to main content
15,900,258 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: XML transform to SQL by XSL Pin
led mike5-Sep-08 4:57
led mike5-Sep-08 4:57 
GeneralRe: XML transform to SQL by XSL Pin
AndieDu7-Sep-08 13:47
AndieDu7-Sep-08 13:47 
GeneralRe: XML transform to SQL by XSL Pin
led mike8-Sep-08 5:02
led mike8-Sep-08 5:02 
GeneralRe: XML transform to SQL by XSL Pin
AndieDu8-Sep-08 13:38
AndieDu8-Sep-08 13:38 
QuestionUsing XML to represent parameter data (VST) Pin
Leslie Sanford31-Aug-08 16:41
Leslie Sanford31-Aug-08 16:41 
QuestionGeocoding using google service Pin
mkanna29-Aug-08 6:21
mkanna29-Aug-08 6:21 
AnswerRe: Geocoding using google service Pin
led mike2-Sep-08 5:54
led mike2-Sep-08 5:54 
QuestionSchema and derived types Pin
Russell Jones29-Aug-08 4:56
Russell Jones29-Aug-08 4:56 
I'm trying to create a list containing subtypes of an abstract type in xml and validate it using an xml schema

I tried to use this as a schema but when i try to validate i get an error telling me that I cannot use transaction because it's marked abstract. Basically I'm trying to end up with a list that contains transaction nodes some of which are of type transaction1 and some are transaction2.

<pre><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="rootelement" type="docroot" />
<xs:complextype name="docroot">
<xs:sequence>
<xs:element name="transactions" type="transactions" />
</xs:sequence>
</xs:complextype>
<xs:complextype name="transactions">
<xs:sequence>
<xs:choice minoccurs="0" maxoccurs="unbounded">
<xs:element name="transaction" minoccurs="0" maxoccurs="unbounded" type="transaction" />
</xs:choice>
</xs:sequence>
</xs:complextype>
<xs:complextype name="transaction" abstract="true">
<xs:sequence>
<xs:element name="content" minoccurs="1" maxoccurs="1" />
<xs:element name="extracontent" minoccurs="0" maxoccurs="1" />
<xs:element name="noextracontent" minoccurs="0" maxoccurs="1" />
</xs:sequence>
<xs:attribute name="type" />
</xs:complextype>
<xs:complextype name="transaction1">
<xs:complexcontent>
<xs:restriction base="transaction">
<xs:sequence>
<xs:element name="content" minoccurs="1" maxoccurs="1" />
<xs:element name="extracontent" minoccurs="1" maxoccurs="1" />
<xs:element name="noextracontent" minoccurs="0" maxoccurs="0" />
</xs:sequence>
<xs:attribute name="type" fixed="1" />
</xs:restriction>
</xs:complexcontent>
</xs:complextype>
<xs:complextype name="transaction2">
<xs:complexcontent>
<xs:restriction base="transaction">
<xs:sequence>
<xs:element name="content" minoccurs="1" maxoccurs="1" />
<xs:element name="extracontent" minoccurs="0" maxoccurs="0" />
<xs:element name="noextracontent" minoccurs="1" maxoccurs="1" />
</xs:sequence>
<xs:attribute name="type" fixed="2" />
</xs:restriction>
</xs:complexcontent>
</xs:complextype>
</xs:schema></pre>

The code above is only for testing, I'm trying to get my head round how restriction etc works in schema.

Does anyone know how to do this?

Cheers,

Russell
AnswerRe: Schema and derived types Pin
Erik Westermann10-Sep-08 4:45
professionalErik Westermann10-Sep-08 4:45 
Questionhow to get XML file. Pin
AtulRane28-Aug-08 19:14
AtulRane28-Aug-08 19:14 
AnswerRe: how to get XML file. Pin
Russell Jones29-Aug-08 4:51
Russell Jones29-Aug-08 4:51 
AnswerRe: how to get XML file. Pin
Michael Dunn29-Aug-08 13:30
sitebuilderMichael Dunn29-Aug-08 13:30 
Question[Message Deleted] Pin
vankayalapati27-Aug-08 19:04
vankayalapati27-Aug-08 19:04 
AnswerRe: how to add event handling in xslt Pin
led mike28-Aug-08 5:11
led mike28-Aug-08 5:11 
QuestionReading values from unformatted xml Pin
indian14325-Aug-08 23:40
indian14325-Aug-08 23:40 
AnswerRe: Reading values from unformatted xml Pin
Christian Graus26-Aug-08 0:50
protectorChristian Graus26-Aug-08 0:50 
Questionxml to xml [modified] Pin
Member 470396625-Aug-08 5:16
Member 470396625-Aug-08 5:16 
AnswerRe: xml to xml Pin
led mike26-Aug-08 5:40
led mike26-Aug-08 5:40 
AnswerRe: xml to xml Pin
led mike27-Aug-08 6:25
led mike27-Aug-08 6:25 
QuestionXSL copy-of problem! Pin
Saul Johnson24-Aug-08 5:46
Saul Johnson24-Aug-08 5:46 
AnswerRe: XSL copy-of problem! Pin
Frank Horn25-Aug-08 8:11
Frank Horn25-Aug-08 8:11 
GeneralRe: XSL copy-of problem! Pin
Saul Johnson25-Aug-08 11:22
Saul Johnson25-Aug-08 11:22 
GeneralRe: XSL copy-of problem! Pin
Frank Horn25-Aug-08 21:10
Frank Horn25-Aug-08 21:10 
GeneralRe: XSL copy-of problem! Pin
Saul Johnson1-Sep-08 0:35
Saul Johnson1-Sep-08 0:35 
Questiontransform XML to XML Pin
StevenGoldberg23-Aug-08 11:56
StevenGoldberg23-Aug-08 11:56 

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.