Click here to Skip to main content
14,843,944 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questioncreate xml .. [modified] Pin
Rajeshwar Code- Developer27-Jul-09 4:35
MemberRajeshwar Code- Developer27-Jul-09 4:35 
QuestionThe XML parse error 0xc00ce556 occurred on line number 1 Pin
Vimalsoft(Pty) Ltd24-Jul-09 0:59
professionalVimalsoft(Pty) Ltd24-Jul-09 0:59 
AnswerRe: The XML parse error 0xc00ce556 occurred on line number 1 Pin
DoctorMick24-Jul-09 1:17
MemberDoctorMick24-Jul-09 1:17 
GeneralRe: The XML parse error 0xc00ce556 occurred on line number 1 Pin
Vimalsoft(Pty) Ltd24-Jul-09 1:24
professionalVimalsoft(Pty) Ltd24-Jul-09 1:24 
Questionweb application with XML Pin
ashwika4923-Jul-09 1:35
Memberashwika4923-Jul-09 1:35 
AnswerRe: web application with XML Pin
Muhammad Mazhar23-Jul-09 2:10
MemberMuhammad Mazhar23-Jul-09 2:10 
AnswerRe: web application with XML Pin
Mike Ellison27-Jul-09 2:42
MemberMike Ellison27-Jul-09 2:42 
QuestionSpecifying unqiueness of an attribute in xsd. Pin
Comp_Users21-Jul-09 10:16
MemberComp_Users21-Jul-09 10:16 
Hi All,

I have an simple xml file for which I generated an xsd file using Altova XMLSpy tool.
As I wanted the end user who makes the xml entry to enter an unique ID which is an attribute of one of the elements. I modified the generated xsd file to accomodate this rule by including "xs:unique" node and entered valid values(i believe)but to no avail.

Below is my xml file.

<?xml version="1.0"?>
<wwdfdb:DDB xmlns:wwdfdb="http://www.xybec.com/ns/wwdfdb" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xybec.com/ns/wwdfdb Sample.xsd">
	<wwdfdb:MyList>
		<wwdfdb:Num id="3020">
			<wwdfdb:Ver>1.0.0.1</wwdfdb:Ver>
			<wwdfdb:Status>InUse</wwdfdb:Status>
		</wwdfdb:Num>
		<wwdfdb:Num id="3021">
			<wwdfdb:Ver>1.0.0.1</wwdfdb:Ver>
			<wwdfdb:Status>InUse</wwdfdb:Status>
		</wwdfdb:Num>
	</wwdfdb:MyList>
</wwdfdb:DDB>


Below is the xsd file for the xml file.

<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
<xs:schema xmlns="http://www.xybec.com/ns/wwdfdb" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.xybec.com/ns/wwdfdb">
	<xs:element name="Ver">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:enumeration value="1.0.0.1"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="Status">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:enumeration value="InUse"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="Num">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Ver"/>
				<xs:element ref="Status"/>
			</xs:sequence>
			<xs:attribute name="id" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:short">
						<!--<xs:enumeration value="3020"/>
						<xs:enumeration value="3021"/>-->
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="MyList">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Num" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
		<!--added below lines to achieve uniqueness for attribute 'id' but to no avail-->
		<xs:unique name="MyUniqueID">
			<xs:selector xpath="Num"/>
			<xs:field xpath="@id"/>
		</xs:unique>
	</xs:element>
	<xs:element name="DDB">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="MyList"/>
			</xs:sequence>
			<xs:attribute name="version" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:enumeration value="1.0"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema>


Plese note that I have included the 'xs:unique' element in the xsd file above to enforce the rule above but to no avail.

Could somebody correct me and guide such that I can enforce an rule in xsd such that any new block added in the xml file should have an unqiue id.
AnswerRe: Specifying unqiueness of an attribute in xsd. Pin
Stuart Dootson21-Jul-09 11:15
professionalStuart Dootson21-Jul-09 11:15 
GeneralRe: Specifying unqiueness of an attribute in xsd. Pin
Comp_Users21-Jul-09 22:45
MemberComp_Users21-Jul-09 22:45 
QuestionHow to ignore tags ? Pin
matty2desmara17-Jul-09 5:06
Membermatty2desmara17-Jul-09 5:06 
AnswerRe: How to ignore tags ? Pin
Stuart Dootson17-Jul-09 13:18
professionalStuart Dootson17-Jul-09 13:18 
QuestionShould I be using XSLT to transform XML to Multiple EDI formats and vice versa? Pin
tig281015-Jul-09 23:57
Membertig281015-Jul-09 23:57 
AnswerRe: Should I be using XSLT to transform XML to Multiple EDI formats and vice versa? Pin
Stuart Dootson16-Jul-09 0:39
professionalStuart Dootson16-Jul-09 0:39 
GeneralRe: Should I be using XSLT to transform XML to Multiple EDI formats and vice versa? Pin
tig281016-Jul-09 2:55
Membertig281016-Jul-09 2:55 
QuestionHow to get Microsoft Infopath XML generated file to work with the Web? Pin
kcgnd15-Jul-09 2:01
Memberkcgnd15-Jul-09 2:01 
AnswerRe: How to get Microsoft Infopath XML generated file to work with the Web? Pin
Sandy_L_Schultz18-Jul-09 8:20
MemberSandy_L_Schultz18-Jul-09 8:20 
GeneralRe: How to get Microsoft Infopath XML generated file to work with the Web? Pin
Sandy_L_Schultz19-Jul-09 12:43
MemberSandy_L_Schultz19-Jul-09 12:43 
GeneralRe: How to get Microsoft Infopath XML generated file to work with the Web? Pin
Member 120804822-Jul-09 8:52
MemberMember 120804822-Jul-09 8:52 
QuestionHow to calling GetObject() in XML? Pin
whiteclouds14-Jul-09 17:10
Memberwhiteclouds14-Jul-09 17:10 
AnswerRe: How to calling GetObject() in XML? Pin
Roll#114-Jul-09 21:10
MemberRoll#114-Jul-09 21:10 
GeneralRe: How to calling GetObject() in XML? Pin
whiteclouds19-Jul-09 20:21
Memberwhiteclouds19-Jul-09 20:21 
QuestionValidate Xml without using xmlns Pin
tprakash14-Jul-09 2:05
Membertprakash14-Jul-09 2:05 
AnswerRe: Validate Xml without using xmlns Pin
Stuart Dootson14-Jul-09 2:36
professionalStuart Dootson14-Jul-09 2:36 
AnswerRe: Validate Xml without using xmlns Pin
Roll#114-Jul-09 21:25
MemberRoll#114-Jul-09 21:25 

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.