Click here to Skip to main content
15,888,803 members
Home / Discussions / XML / XSL
   

XML / XSL

 
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 
GeneralRe: How to use XSL to get the most common value in XML Pin
darasd1-Oct-08 22:34
darasd1-Oct-08 22:34 
GeneralRe: How to use XSL to get the most common value in XML Pin
led mike2-Oct-08 4:32
led mike2-Oct-08 4:32 
AnswerRe: How to use XSL to get the most common value in XML [modified] Pin
Gerald Schwab15-Oct-08 17:25
Gerald Schwab15-Oct-08 17:25 
QuestionXML+XLST simple simple question Pin
Herds30-Sep-08 20:16
Herds30-Sep-08 20:16 
AnswerRe: XML+XLST simple simple question Pin
led mike1-Oct-08 4:57
led mike1-Oct-08 4:57 
GeneralRe: XML+XLST simple simple question Pin
Herds1-Oct-08 7:30
Herds1-Oct-08 7:30 
QuestionHow to catch an exception thrown by MSXML? [modified] Pin
JoeSchmoe00730-Sep-08 7:42
JoeSchmoe00730-Sep-08 7:42 
AnswerRe: How to catch an exception thrown by MSXML? Pin
led mike1-Oct-08 5:03
led mike1-Oct-08 5:03 
QuestionXDS Pin
postonoh29-Sep-08 11:36
postonoh29-Sep-08 11:36 
AnswerRe: XDS Pin
Dave Kreskowiak29-Sep-08 11:59
mveDave Kreskowiak29-Sep-08 11:59 
GeneralRe: XDS Pin
postonoh29-Sep-08 13:53
postonoh29-Sep-08 13:53 
Questionapply xsl on xml to generate sql Pin
AndieDu28-Sep-08 13:51
AndieDu28-Sep-08 13:51 
AnswerRe: apply xsl on xml to generate sql Pin
AndieDu28-Sep-08 19:06
AndieDu28-Sep-08 19:06 

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.