Click here to Skip to main content
15,917,568 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: XML + XSL in a Client Browser Pin
Steve Marsh21-Oct-08 8:45
Steve Marsh21-Oct-08 8:45 
GeneralRe: XML + XSL in a Client Browser Pin
Lea Hayes21-Oct-08 9:07
Lea Hayes21-Oct-08 9:07 
Questionrelated search Pin
rose19615-Oct-08 2:18
rose19615-Oct-08 2:18 
QuestionRe: related search Pin
led mike15-Oct-08 4:53
led mike15-Oct-08 4:53 
AnswerRe: related search Pin
rose19615-Oct-08 19:24
rose19615-Oct-08 19:24 
GeneralRe: related search Pin
led mike16-Oct-08 4:50
led mike16-Oct-08 4:50 
GeneralXML load in C# fails Pin
hairy_hats15-Oct-08 1:18
hairy_hats15-Oct-08 1:18 
GeneralRe: XML load in C# fails Pin
led mike15-Oct-08 4:52
led mike15-Oct-08 4:52 
GeneralRe: XML load in C# fails Pin
hairy_hats15-Oct-08 5:01
hairy_hats15-Oct-08 5:01 
QuestionXSD.exe XML question Pin
Planker14-Oct-08 5:21
Planker14-Oct-08 5:21 
QuestionXML and performance Pin
pedefetoll7-Oct-08 22:49
pedefetoll7-Oct-08 22:49 
AnswerRe: XML and performance [modified] Pin
led mike8-Oct-08 5:17
led mike8-Oct-08 5:17 
GeneralRe: XML and performance Pin
pedefetoll9-Oct-08 0:00
pedefetoll9-Oct-08 0:00 
QuestionRe: XML and performance Pin
led mike9-Oct-08 4:36
led mike9-Oct-08 4:36 
GeneralRe: XML and performance Pin
Gerald Schwab15-Oct-08 16:57
Gerald Schwab15-Oct-08 16:57 
GeneralRe: XML and performance Pin
pedefetoll17-Oct-08 6:54
pedefetoll17-Oct-08 6:54 
QuestionXPath Predicates Pin
threemp37-Oct-08 12:11
threemp37-Oct-08 12:11 
AnswerRe: XPath Predicates Pin
threemp37-Oct-08 12:15
threemp37-Oct-08 12:15 
GeneralRe: XPath Predicates Pin
threemp37-Oct-08 12:32
threemp37-Oct-08 12:32 
GeneralRe: XPath Predicates Pin
led mike8-Oct-08 4:50
led mike8-Oct-08 4:50 
Questionattribute dependand element? Pin
jVersteegen7-Oct-08 1:32
jVersteegen7-Oct-08 1:32 
Hello,
Maybe I want the impossible, i don't know..does anyone? I'm only just starting to learn xsd schema-s.
Is it possible to have an element in an xsd that is dependand of the value of an attribute?


for example: in the below schema, can the name and type of the element where ORDER is located be dependand of the value of the attribute REPORT_TYPE? If the REPORT_TYPE="ORDER_DEFINITION" there should be an ORDER of ORDERType, if the REPORT_TYPE="ORDER_BATCH_CONSUMPTION" there should be a RUN of RUNType, or when the value is something else in the future there should't be an element at all?


<code>
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema blockDefault="" elementFormDefault="qualified" targetNamespace="xdwhml" version="1" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="DATAREPORT">
<xs:complexType>
<xs:sequence>
<xs:element name="REPORT_HEADER">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="REPORT">
<xs:complexType>
<xs:attribute name="REPORT_ID" type="xs:string" />
<xs:attribute name="DATETIME" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element xmlns:q1="xdwhml" name="ORDER" type="q1:ORDERType" />
</xs:choice>
</xs:sequence>
<xs:attribute xmlns:q1="xdwhml" name="REPORT_TYPE" type="q1:REPORT_TYPE_ENUM" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:simpleType name="REPORT_TYPE_ENUM">
<xs:restriction base="xs:string">
<xs:enumeration value="ORDER_DEFINITION" />
<xs:enumeration value="ORDER_BATCH_CONSUMPTION" />
</xs:restriction>
</xs:simpleType>

<xs:complexType name="ORDERType">
<xs:attribute name="ORDER_NAME" type="xs:string" use="required" />
<xs:attribute name="LINE_NAME" type="xs:string" use="required" />
<xs:attribute name="DESTINATION_NAME" type="xs:string" use="required" />
<xs:attribute name="RECIPE_NAME" type="xs:string" use="required" />
<xs:attribute name="BATCH_NUMBER" type="xs:string" use="optional" />
</xs:complexType>

</xs:schema>
</code>
QuestionHow to use XSL to get the most common value in XML Pin
darasd1-Oct-08 0:17
darasd1-Oct-08 0:17 
AnswerRe: How to use XSL to get the most common value in XML Pin
led mike1-Oct-08 5:06
led mike1-Oct-08 5:06 
GeneralRe: How to use XSL to get the most common value in XML Pin
darasd1-Oct-08 5:30
darasd1-Oct-08 5:30 
GeneralRe: How to use XSL to get the most common value in XML Pin
led mike1-Oct-08 6:42
led mike1-Oct-08 6:42 

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.