Limiting attributes of multiple elements with XML Schema
I am working with a curriculum development group and we are trying to get all of their content into and XML format so that it can be easily displayed by a browser and parsed by our application. For quiz pages we would like to do something like the following:
<question>
<text>Who won superbowl XXXII?</text>
<answer correct="true">Denver Broncos</answer>
<answer correct="false">Green Bay Packers</answer>
<answer correct="false">Dallas Cowboys</answer>
<answer correct="false">Atlanta Falcons</answer>
</question>However, I can't find a way to limit it so that only one answer element within a question element can have a correct attribute with the value of true. Is this possible?
Additionally, if anybody has recommendations for already developed XML based languages for curriculum that they have experience with that would be appreciated.
well, you create 4 sequences where each sequence has a different team winning, and then choice these 4 sequences together. Admittedly, that would be ugly.
Similar Messages
-
Defining entities with XML schema
Hi,
I came across a problem with XML schema's apparent lack of support for entities. e.g. we define an entity like this:
<!ENTITY le "≤" >.
First off I was trying in my XML instance to include an external entity file like this:
<!DOCTYPE wpi [
<!ENTITY % DerwentXmlEntities PUBLIC "-//Derwent//Derwent XML General ENTITIES 20000214//EN"
"derwent-xml-entities.ent">
%DerwentXmlEntities;
]>
<WPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.derwent.co.uk/wpi.xsd">
but I am not clear on where I should place the file derwent-xml-entities.ent. Everything I tried ended up with:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00202: could not open file "derwent-xml-entities.ent"
Is it possible to include a file like this?
So I tried just defining an entity like this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE wpi [
<!ENTITY times "×">
<!ENTITY le "≤">
]>
The "times" seems OK, but for "le" I get:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00217: invalid character 8804 (\u2264)
What sort of encoding should I use?
Thanks
Pete<xsd:element name="PsL">
<xsd:annotation>
<xsd:documentation>
**Pseudo List, required as in D-types, the editors often used the
{H control sequence to force an indent to make lists of compounds more
legible. We can't be sure that they are always lists but there is
useful mark-up there that we wouldn't want to lose**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="PsE" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PsE">
<xsd:annotation>
<xsd:documentation>
Pseudo List Entry
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="PsP" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="PsS" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PsP">
<xsd:annotation>
<xsd:documentation>
Pseudo List Prefix
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="PsP" type="xsd:string"/>
<xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="PsS">
<xsd:annotation>
<xsd:documentation>
Pseudo List Suffix
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="PsS" type="xsd:string"/>
<xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="Prt">
<xsd:annotation>
<xsd:documentation>
************************ Part Container Element **************
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="PrtNo" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="PrtNm" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PrtNo">
<xsd:annotation>
<xsd:documentation>
PartNo
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="PrtNo" type="xsd:string"/>
<xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
xsd:element name="PrtNm">
<xsd:annotation>
<xsd:documentation>
PartName
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="PrtNm" type="xsd:string"/>
<xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="L">
<xsd:annotation>
<xsd:documentation>
************************ List Container Element *************
Attribute typ=used by the composition software to decide how to prefix
the list entries, e.g. (a), (A), (i), (1), etc.
AL for AlphaLower
AU for AlphaUpper
RL for RomanLower
RU for RomanUpper
No for Number
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element ref="LP" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="LS" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="typ" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AL"/>
<xsd:enumeration value="AU"/>
<xsd:enumeration value="RL"/>
<xsd:enumeration value="RU"/>
<xsd:enumeration value="No"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="LP">
<xsd:annotation>
<xsd:documentation>
List Paragraph
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="LP" type="xsd:string"/>
<xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="RefD" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="RefF" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="LS">
<xsd:annotation>
<xsd:documentation>
1st level sublist
Attribute typ=used by the composition software to decide how to prefix
the list entries, e.g. (a), (A), (i), (1), etc.
AL for AlphaLower
AU for AlphaUpper
RL for RomanLower
RU for RomanUpper
No for Number
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element ref="LP" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="LSS" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="typ" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AL"/>
<xsd:enumeration value="AU"/>
<xsd:enumeration value="RL"/>
<xsd:enumeration value="RU"/>
<xsd:enumeration value="No"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="LSS">
<xsd:annotation>
<xsd:documentation>
2nd level list
Attribute typ=used by the composition software to decide how to prefix
the list entries, e.g. (a), (A), (i), (1), etc.
AL for AlphaLower
AU for AlphaUpper
RL for RomanLower
RU for RomanUpper
No for Number
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="LP" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="typ" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AL"/>
<xsd:enumeration value="AU"/>
<xsd:enumeration value="RL"/>
<xsd:enumeration value="RU"/>
<xsd:enumeration value="No"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="IndexingCorePt">
<xsd:annotation>
<xsd:documentation>
******** ROOT ELEMENT for Core Patent Indexing *********
** Indexing is composed of Derwent Classification (DC),IPCs,
Fragmentation Coding (Frags), Polymer Indexing, Unlinked Registry numbers
and Keyword Indexing (KI).
Any combination is these three elements is allowed.
Attribute vs =Version number starting at 0
Attribute co =Patent country
Attribute se =Patent serial
Attribute ki =Patent Kind
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="DC" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="IPCs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="Frag" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="Polymer" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="IdxU" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="KI" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="vs" type ="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="co" type ="xsd:NMTOKEN" use="required"/>
<xsd:attribute name="se" type ="xsd:NMTOKEN" use="required"/>
<xsd:attribute name="ki" type ="xsd:NMTOKEN" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="DC">
<xsd:annotation>
<xsd:documentation>
************* DERWENT CLASSIFICATION *******************
** Derwent Classification is divided in 3 main areas:
Chemical(CPI),General & Mechanical (EngPI),
Electronic & Electronical (EPI)
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="CPIs" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="EngPIs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="EPIs" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="EngPIs" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="EPIs" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:element ref="EPIs" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:element name="CPIs">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT DC
** Container element for CPI**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="CPI" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CPI">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT CPIs
** CPI is composed of sections A to N (no section I)
Any combination is allowed, there has to be at least one section.
No section can appear twice. The DTD does not enforce this.
Section N can't be on his own. The DTD does not enforce this.
Each single Chemical section is composed of one main class (DCCM)
and zero to many secondary classes (DCCSs). One to many Manual
code (MCCs) has to be applied to a given chemical section.
Attribute section= an allowed Derwent CPI section **
Note that content MCCs is optional as its optional in the backfile
before 19??
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="DCCM" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="DCCSs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="MCCs" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:element ref="MCCs" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
<xsd:attribute name="sct" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A"/>
<xsd:enumeration value="B"/>
<xsd:enumeration value="C"/>
<xsd:enumeration value="D"/>
<xsd:enumeration value="E"/>
<xsd:enumeration value="F"/>
<xsd:enumeration value="G"/>
<xsd:enumeration value="H"/>
<xsd:enumeration value="J"/>
<xsd:enumeration value="K"/>
<xsd:enumeration value="L"/>
<xsd:enumeration value="M"/>
<xsd:enumeration value="N"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="DCCM" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** Derwent Class Chemical Main element **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DCCSs">
<xsd:annotation>
<xsd:documentation>
** Derwent Classes Chemical Secondary Container element**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="DCCS" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DCCS" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** A Derwent Class Chemical Secondary (DCCS) **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MCCs">
<xsd:annotation>
<xsd:documentation>
** Manual Codes CPI Container Element **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="MCC" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MCC" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** A Manual Code CPI **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="EngPIs">
<xsd:annotation>
<xsd:documentation>
**General & Mechanical Sections Container element**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="EngPI" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EngPI">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT EngPIs
** General & Mechanical Sections EngPI is composed of sections
P and Q. Any combination is allowed, with at least one section.
There are no manual codes for these sections.
Each single EngPI section is composed of
one or more Derwent Class Engineering (DCEng) elements.
No section can appear twice. The DTD does not enforce this.
Attribute section= an allowed Derwent EngPI section **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="DCEngs" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="sct" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="P"/>
<xsd:enumeration value="Q"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="DCEngs">
<xsd:annotation>
<xsd:documentation>
** Derwent Class Engineering Container eement **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="DCEng" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DCEng" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** Derwent Class Engineering **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="EPIs">
<xsd:annotation>
<xsd:documentation>
** Electronic & Electrical Sections EPI **
Container element for EPI
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="EPI" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EPI">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT EPIs
** EPI is composed of sections R to X. Any combination is allowed,
with at least one section.
Section R can't be on his own. The DTD does not enforce this.
Each single is composed of one or more Derwent Class Electronic
and Electrical (DCE) elements.
No section can appear twice. The DTD does not enforce this. **
Attribute sct = an allowed Derwent EPI section
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="EPIgp" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="sct" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="R"/>
<xsd:enumeration value="S"/>
<xsd:enumeration value="T"/>
<xsd:enumeration value="U"/>
<xsd:enumeration value="V"/>
<xsd:enumeration value="W"/>
<xsd:enumeration value="X"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="EPIgp">
<xsd:annotation>
<xsd:documentation>
** A Container element to group the related DCE & MCEs elements **
Note that content MCEs is optional as its optional in the backfile
before 19??
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="DCE" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="MCEs" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DCE" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** Derwent Class Electronic & Electrical (DCE) contains
Manual Codes Electronic & Electrical (MCE) **
** Derwent Class EPI **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MCEs">
<xsd:annotation>
<xsd:documentation>
** Manual Codes EPI container element **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="MCE" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MCE" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
** A Manual Code EPI **
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="IPCs">
<xsd:annotation>
<xsd:documentation>
********************IPCs Container element *************
** The following xlink construct is a link to the IPC codes on
the WIPO site, this could be added to the DTD to provide the link
without adding any thing to the individual instances
xlink:type (locator) #FIXED "locator"
xlink:rl NMTOKEN #FIXED "IPCs"
xlink:href CDATA #FIXED "http://classifications.wipo.int/fulltext/new_ipc/"
xlink:title CDATA #FIXED "IPC Codes" **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="IPC" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="IPC">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT IPCs
** An IPC Code **
** Attribute rnk= Derwent assigned character to indicate type
of IPC:
A= Main IPC
B= Other, unlinked IPCs
C to Y = Linked IPCs and Index Terms
Z= IPC Index Terms
-= Additional terms **
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="rnk" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A"/>
<xsd:enumeration value="B"/>
<xsd:enumeration value="C"/>
<xsd:enumeration value="D"/>
<xsd:enumeration value="E"/>
<xsd:enumeration value="F"/>
<xsd:enumeration value="G"/>
<xsd:enumeration value="H"/>
<xsd:enumeration value="I"/>
<xsd:enumeration value="J"/>
<xsd:enumeration value="K"/>
<xsd:enumeration value="L"/>
<xsd:enumeration value="M"/>
<xsd:enumeration value="N"/>
<xsd:enumeration value="O"/>
<xsd:enumeration value="P"/>
<xsd:enumeration value="Q"/>
<xsd:enumeration value="R"/>
<xsd:enumeration value="S"/>
<xsd:enumeration value="T"/>
<xsd:enumeration value="U"/>
<xsd:enumeration value="V"/>
<xsd:enumeration value="W"/>
<xsd:enumeration value="X"/>
<xsd:enumeration value="Y"/>
<xsd:enumeration value="Z"/>
<xsd:enumeration value="-"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Frag">
<xsd:annotation>
<xsd:documentation>
***************BCE INDEXING OR FRAGMENTATION ************
** Fragmentation Container element**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="FragSub" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="FragSub">
<xsd:annotation>
<xsd:documentation>
UNIQUE ELEMENT Frag
** Fragmentation Sub heading **
** Attribute sjct=The main BCE chemical subject categories
defined by Derwent as subsets. The subsets are designated by the
subheadings MO through M6:
MO Agricultural, pharmaceutical 1963-1969
M1 Agricultural, pharmaceutical natural products
and polymers 1970 to present
M2 Agricultural, pharmaceutical 1970 to present
M3 General chemicals 1970 to present
M4 Dyes 1970 to present
M5 Steroids 1963 to present
M6 Galenicals 1976 to present"**
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="CardRec" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="sjct" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="M0"/>
<xsd:enumeration value="M1"/>
<xsd:enumeration value="M2"/>
<xsd:enumeration value="M3"/>
<xsd:enumeration value="M4"/>
<xsd:enumeration value="M5"/>
<xsd:enumeration value="M6"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="CardRec">
<xsd:annotation>
<xsd:documentation>
** Card Record **
Attribute no =Derwent assigned record number
Attribute mc = Markush DARC Control Code
Attribute trc = Fragmentaion Control Time ranging codes:
M900 Pre-1970
M901 1970-1971
M902 1972-1981 (8126)
M903 1981 (8127) onward
M905
Attribute rn = 910 Codes generated from registry numbers.
Only searchable from 1981
Attribute wd = 911 Wide Disclosure. Only searchable from 1981
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:element ref="FCodes" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="RINs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="SCNs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="MCNs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="DRNs" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="DCRs" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
-
Mapping with xml-schema XML-data to relational tables
Hello,
is it possible to map data from xml documents to relational tables with xml-schema?
I mean not in nested tables but in relational tables with primary and foreign keys!
With SQL Server 2005 it is very easy, I dont believe that Oracle couldn't do this!
I searched but i cant find anything about that!
Thx
user445232indeed, oracle does this for xml schema based xmltype data, however, these underlying tables are not accessable to the application. Maybe It should for next version, so folks who like to use relational model can use it without mapping it manually.
Actually, nested tables, are the same, their underlying tables (segments) are indeed relational tables, oracle manages them internally and not visiable to the application. You can find them in the user_segments, user_objects views though. -
Validation XML documnet with XML Schema in PL/SQL
Hello,
can someone please explain
How to validate an XML document with XML schema using PL/SQL code (with out writing Java code).
Thanks for your Help in Advance
Surendra.see the posting: Schema validation routine?
regards, Bart -
Hi, I am new to livecycle and wondering if there is any sample for setting up the dynamic table with XML schema so I can access the data through workbench's xpath. thanks.
Ivor,
Take a look at the samples shipped with Designer. For 8.2.1 release take a look at
C:\Program Files\Adobe\LiveCycle Designer ES\8.2\EN\Samples\Forms\Purchase Order\Schema\Schema\Purchase Order.xsd
and the form samples.
Otherwise, forward a request to [email protected] I would be happy to send you a sample XDP with a dynamic table and a schema.
Steve -
Has anybody tried creating and validating a XML doc with XML Schema?
Hi,
Has anybody tried creating and validating a XML doc with XML Schema?With XMLBeans, an XML document may be created from and validated with an XML schema.
-
I am facing a new problem with xml schema, plz help me
Hi @,
I am facing a problem with xml schema validation. Below is my code.
public void initialize(String cfgFileName) {
try {
try {
DOMParserWrapper parser = (DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance();
parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",true );
parser.setFeature( "http://xml.org/sax/features/validation",true);
parser.setFeature( "http://xml.org/sax/features/namespaces",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true );
Document document = parser.parse(cfgFileName);
System.out.println("Vijay .. code .. damar\n");
}catch (org.xml.sax.SAXParseException spe) {
} catch (org.xml.sax.SAXNotRecognizedException ex ){
} catch (org.xml.sax.SAXNotSupportedException ex ){
} catch (org.xml.sax.SAXException se) {
if (se.getException() != null)
se.getException().printStackTrace(System.err);
else
se.printStackTrace(System.err);
}catch (Exception e) {
System.out.println("Caught unknown exception : \n");
e.printStackTrace(System.err);
System.out.println("Vijay .. code .. success\n");
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
//docBuilder.setErrorHandler(myErrorHandler);
cfg = docBuilder.parse(new File(cfgFileName));
cfg .getDocumentElement ().normalize ();
} catch (Exception e) {
e.printStackTrace();
In the above code I am parsing the xml file and i am doing schema validation. Schema validation is proper and it is validating correctly. Only problem is that, It is validating and showing error correctly correctly but it is not catching that error.
For clear understanding I am printing one statement before parsing and after parsing.
SYSTEM.OUT.PRINTLN("Vijay .. code .. damar\n") this is before parsing
SYSTEM.OUT.PRINTLN("Vijay .. code .. success\n") this is after parsing
Here what is happening means, It is validating correctly and showing error :
[Error] nw_layout-new.xml:800:97: Datatype error: Value 'y' does not match regular expression facet 'yes|no'..
Vijay .. code .. damar
Vijay .. code .. success
Here it is showing error and still continueing not catching.
Plz give solution for this.
Thanks
vijay KHello dipthebe,
Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
iPhone, iPad, iPod touch: Troubleshooting touchscreen response
http://support.apple.com/kb/ts1827
Use iTunes to restore your iOS device to factory settings
http://support.apple.com/kb/HT1414
Regards,
-Norm G. -
Generate Adobe Interactive Form with XML Schema-Based Interface
Hi,
I need to generate a adobe Interactive but with XML Schema-Based Interface, i have one example but with ABAP Dictionary-Based Interface.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
* EXCEPTIONS
* CANCEL = 1
* USAGE_ERROR = 2
* SYSTEM_ERROR = 3
* INTERNAL_ERROR = 4
* OTHERS = 5
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZMMDM_CL'
IMPORTING
e_funcname = fm_name.
But when i call the next function for print i need the docxml parameter and i don't know how to get it
fm_name
CALL FUNCTION fm_name
EXPORTING
/1BCDWB/DOCPARAMS = fp_docparams
* /1bcdwb/docxml =
* IMPORTING
* /1BCDWB/FORMOUTPUT =
* EXCEPTIONS
* USAGE_ERROR = 1
* SYSTEM_ERROR = 2
* INTERNAL_ERROR = 3
* OTHERS = 41) this questions was asked many times before, you didn´t search for a second
2) I am not aware of any standard solution
3) custom solution: use XSLT transformation ID to get XML from the filled DDIC structure and use string operations to add the header and footer to create a valid XML.
Regards Otto -
Schema Validation on attributes of an element in XML againt XSD schema
Hi,
I had generated artifact java classes from XSD schema file.Now i am validatiing one sample XML document by using these classes in JAXB.The XML document is validated successfully.but only elements are validated ,but not attributes of that elements.for example ,i am giving wrong element which is not defined inside the schema file,it throws validation error as expected ,whereas validation against wrong attributes of elements in XML it is not working anyway,it does not throw any validation errors,but it should throw validation errors.kindly help me to solve this issue.
Here The sample validation code snippets :
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.ValidationEventLocator;
public class MyEventHandler implements ValidationEventHandler{
public boolean handleEvent(ValidationEvent ve) {
if (ve.getSeverity()==ValidationEvent.FATAL_ERROR ||
ve .getSeverity()==ValidationEvent.ERROR){
ValidationEventLocator locator = ve.getLocator();
//Print message from valdation event
System.out.println("Invalid booking document: "
+ locator.getURL());
System.out.println("Error: " + ve.getMessage());
//Output line and column number
System.out.println("Error at column " +
locator.getColumnNumber() +
", line "
+ locator.getLineNumber());
return true;
Unmarshaller unmarshaller = jc.createUnmarshaller();
unmarshaller.setEventHandler(new MyEventHandler());Here is my analagous 'strange' behavior. I am jaxb processing and then marshalling generated classes to XML ( following the simple Sun 'PurchaseOrder' example )
1. This works:
<xsd:schema....>
<xsd:complextType name = "myName">
<xsd:attribute name='name1'>
</xsd:complextType>
</xsd:schema>
2. This doesn't:
<xsd:schema....>
<xsd:complextType name = "myName">
<xsd:attribute name='name1'/>
<xsd:attribute name='name2'/>
</xsd:complextType>
</xsd:schema>
That is, using more than one attribute line within this simple complex type causes nothing to be marshalled to XML.
Ideas? -
Unable to find root element in XML Schema when Syndicating (SAP MDM)
Hi experts,
We are having a problem with our Syndication.
We have created an XML Schema using XML Spy. We need a namespace, and this is 70 characters long (in other words, far shorter than maximum at 255 characters).
<xs:schema xmlns:ns="http://schemas.xxxxx.com/ServiceManagement/ServiceMasterDataFromMDM/0.3" xmlns:xs="http://www.xxxxx.org/2001/XMLSchema" targetNamespace="http://schemas.xxxxxx.com/ServiceManagement/ServiceMasterDataFromMDM/0.3" elementFormDefault="unqualified" attributeFormDefault="unqualified">
When opening the xml schema file in Syndicator, the root field is disabled.
If we remove namespace in heading of xml schema, the root field is enabled, and the root element is correct.
How can we make use of the XML schema when we need namespace?
We have tried to add namespace annotation ns: to all type definitions:
<xs:element name="ServiceCategory" type="ns:ServiceCategoryType">
This did not help.
Please advice.
KR,
Thomas
Edited by: Thomas on Mar 2, 2011 2:12 PM>>We need a namespace, and this is 70 characters long
If you want namespace to appear in XML and your XSD has it too. please add the namespace under "URI" attribute in XML schema in Console.
You need to import the XSD in Console first, specify namespace under URI and then use this to build syndication map.
Thanks
Aamir -
With the Xerces parser, you can validate an XML document against an XML schema. But what I wanted to do is something different.
I want to validate data before they are put in XML. Like this:
1) I have a set of class/classes that act as helper class(es) that creates an XML document that conforms to a specific XML Schema. The class(es) would have, of course, setXXXX() methods in it. The XML document is not created until someone call create().
2) With each setXXXXX() method call, I know that the setXXXXX() would eventually map to a specific attribute in a specific element in the XML document that will be created.
3) Therefore, I would want to be able to throw an Exception if a developer call setXXXX() with the correct Java data type, but with an incorrect value based on the XML Schema .... instead of throwing the error when the XML is being serialized / created by the XML parser in the create() method.
Any ideas on how to do this?
Regards,
JohnThe only way that I could think to do this is to have
a lot of XSDs, one for each element essentially.
In this case you'd have to build your mini-XMLs, parse
each one with an XSD, and then report the error.
Why do you want to do it this way? Is it because you
want to know exactly which one gave an error without
having to parse through the sometimes cryptic error
messages?
PaulYes. that's one.
The other is, if you think of a form that is being filled by a user, you would want the user to be informed of which field in the form has the incorrect value, instead of just showing a generic message .... after which the user may get fed up and do his business elsewhere. Not good for business, isn't it? -
Hi, i have got another problem with livecycle designer scripting.
I have got script line which is defining of string variable:
var aaa = "this is my string";
and i have got embed XML schema like this (it`s only short part of whole file):
... xs:element name="bbb" type="xs:string"/ ...
After saving data to XML i would like to get "this is my string" as a value of my "bbb" XML element.
To save this data i`m using submit button which is connect with submit.php file on my server.
How to connect script created variable and embed XML schema element which is present on my "Data View" tab.
Please help me a bit becouse i don`t know even where to search answer of it...
Of course i know possibilities to create fake unvisible text field object and bind it with 'bbb' and than put "this.rawValue = aaa" to connect those two variables but i think that is not a good idea to solve it in that way. It`s too primitivei solve it, i should write this:
xfa.datasets.data.bbb.value = aaa; -
Dynamic tables with XML schema binding
Hello,
I'm currently fighting a strange issue dealing with a complex dynamic form. This form contains multiple dynamic tables to which the user may add new lines or delete lines that are no longer needed. This is being implemented using the instanceManager and works just fine.
However, if I try to bind XML based data to this table, it looks like if rows added by the instance manager are always bound to the same record (they all contain identical values). The XML schema is correct, the issue also happens with sample XML data files.
This seems to have something to do with the programatically added lines, but I have run out of ideas ... Can anyone provide some pointers?
Thanks a million,
Steffen.Thanks for the reply, Paul.
I have the question about the schema,
say i have a table like this:
Item | Cost
A | 10.3
B | 21.1
Total| 31.4
and my schema is:
so when I bind the table row should it be $.ItemTable[*].Item ? -
Has anyone been successful at validating xml with a Schema running weblogic 6.1
sp2?
Here is a snippet of code...
SAXParserFactory objFactory = SAXParserFactory.newInstance();
objFactory.setValidating("true");
objFactory.setNamespaceAware("true");
objFactory.setFeature("http://apache.org/xml/features/validation/schema", "true");
objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)), A_HANDLER);
When my xml code runs through the parser I get an error for each element saying
the element type is not declared in the dtd or schema.
Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml validation
with a Schema. From what I've read it seems that it does.
Any help or insight would be appreciated.
Thanks
KarenI figured out my problem in case anyone else is having trouble..
In the xml document that you need to refer to:
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
supported by xerces 1.3.1.
Whew!
"Karen Schaper" <[email protected]> wrote:
>
Has anyone been successful at validating xml with a Schema running weblogic
6.1
sp2?
Here is a snippet of code...
SAXParserFactory objFactory = SAXParserFactory.newInstance();
objFactory.setValidating("true");
objFactory.setNamespaceAware("true");
objFactory.setFeature("http://apache.org/xml/features/validation/schema",
"true");
objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
A_HANDLER);
When my xml code runs through the parser I get an error for each element
saying
the element type is not declared in the dtd or schema.
Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
validation
with a Schema. From what I've read it seems that it does.
Any help or insight would be appreciated.
Thanks
Karen -
Help needed with XML Schema Processor sample
I'm trying to run the sample that came with the Oracle XML Schema Processor (XSDSample.java) and get the following error:
-- process file: catalogue.xml
file:/D:/java/xml/ORACLE/XSD/catalogue.xml<Line 8, Column 32>: XSD-2001: (Error) Can not create instance of: 'oracle.xml.parser.schema.XSDBuilder'
What am I doing wrong. I am running the sample unchanged.
thx,
e
nullLooks like unzipping the jar and making sure its in your classpath fixed the problem. not sure why explicitly having the xschema.jar in the classpath didn't work.
e
Maybe you are looking for
-
No Batch menu in Bridge (Photoshop CS6)
I've installed and reinstalled Photoshop CS6 and but continue to have no Photoshop/Batch menu in Bridge as I did in CS5. Windows 7. CS6 is an upgrade. I've been living with it as I see a lot of others have the same problem with no answer that I can
-
I have just upgraded to the new OS X V. 10.10.3 but cannot access my iCloud Drive documents using the resident Pages and Numbers software on my MacBook Pro. Help is needed to access those documents using the resident software on my MacBook Pro rather
-
Adobe Reader 10.1.3 MUI error 1321
I posted this in the enterprise forum but have not had any luck getting a response so I'm reposting it here to see if I have any luck. I am currently deploying Adobe Reader 10.1.3 MUI and I am seeing several machines fail the installation and report
-
Hp 4580 wireless connection question
Can I connect this printer by usb To one pc, and ALSO connect it wirelessly to other computers on the wireless network in The house ?
-
Exporting "Original" from iPhoto '09 v8.1.2(424) to External Hard Drive
RMS3RD Re: error writing to disk Feb 6, 2014 8:40 AM (in response to Terence Devlin) Terence, not sure of the etiquette here but this is similar to what I am experiencing: CPE: MacBook Pro 5,5 Core2Duo running OSX 10.5.8 with EHD Seagate Ba