xml


Is it possible to have an element in XSD Schema only in case of specific value for another element in schema?


My XML Schema looks like -
<element name="PurchaseOrderInformation">
<complexType>
<sequence>
<element ref="pidx:PurchaseOrderNumber"/>
<element ref="pidx:PurchaseOrderIssuedDate" minOccurs="0"/>
<element ref="pidx:PurchaseOrderTypeCode" minOccurs="0"/>
<element ref="pidx:ReleaseNumber" minOccurs="0"/>
<element ref="pidx:SalesOrderNumber" minOccurs="0"/>
<element ref="pidx:RevisionNumber" minOccurs="0"/>
</sequence>
</complexType>
</element>
<element name="PurchaseOrderIssuedDate" type="date"/>
<element name="PurchaseOrderLineItemNumber" type="string"/>
Whenever customer name is "ABC" , i need to have PurchaseOrderLineItemNumber element under PurchaseOrderInformation complex type.
Is there any way to achieve this?
XSD 1.0
Constraining the values of elements based upon other elements is not possible in XSD 1.0.
XSD 1.1
XSD 1.1 has assertions that allow constraints to vary per values per document. If XSD 1.1 isn't an option (as it is not for libxml, .NET, etc), then such checks have to be performed outside of XSD.

Related Links

Oracle SQL issue with selecting invalid chars
xs:unique - Enforce Unique Attribute Values in Schema on abstract element
Tomcat deploying 2 aplications with 2 databases
Browse an xml tree and get a specific value
XSLT for-each loop and nodes with different pattern
Removing tags in lisp program
How do you specify a XmlAccessorType to be used for JAXB xjc-generated classes
magento, add cron with config.xml file
Validating XML Data with XSD
How i get the soap structure of my WCF?
Visual Studio 2012 XML intellisense broken due to auto-loading duplicate xsd files
Excel to XML - duplicating records on highest level
what how to get a node from an xml document using xslt
Multilevel XSD constraint
XML parsing using xpath for child node containing default namespace
Adding Dynamic Content to an XML Document

Categories

HOME
shell
asp.net-web-api
search
api
ecmascript-6
css3
battery
saml-2.0
composite-primary-key
graphics
cakephp-3.4
angularfire2
frontend
gson
resultset
opengl-es-3.0
cmdb
supervisor
atlassian
http-post
scsi
fileserver
bourbon
href
systemtime
php-mysqlidb
tosca
has-and-belongs-to-many
winexe
ceylon
user-defined-functions
finagle
fstream
contacts
getpixel
modalviewcontroller
jwplayer6
sql-server-ce
z-notation
password-protection
gdata
unordered-map
android-checkbox
android-exoplayer
signal-strength
libgphoto2
opennms
yii2-api
netbeans6.8
launchctl
datamaps
convex-optimization
payara-micro
aquamacs
amq
qtranslate
appdomain
spring-data-couchbase
arules
universal-analytics
google-photos
docpad
mapxtreme
centrifuge
flex4.6
file-uri
aurora
dbamp
redis-cluster
html-to-pdf
libav
jbase
toran-proxy
opl
qt5.2
themoviedb-api
lazybones
poppler
extjs-grid
mod-proxy
keyup
cwrsync
alloy-ui
nutiteq
jquery-forms-plugin
cross-join
rapidsvn
mruby
contrast
spy++
iso-prolog
nsmenu
ora-00904
reflector
live555
buffering
menubar
rfc5322
ie8-compatibility-mode
neos-server
gpars
mantle
preload
window-decoration
predicatebuilder
kqueue
cross-database
virtualpathprovider
urlrewriter
role
winmain
umra
qglwidget
cac
diagrams
updatesourcetrigger
vs-android
xpsdocument
fault-tolerance
contentpresenter

Resources

Encrypt Message