473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XML Validation against multiple schema Error

Ben

Hi All,
I have 2 XSDs - one with the Types to be used throughout the
application, and one specific to my module (a.xsd & b.xsd)

a.xsd has

<xs:attribute name="MyTest">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="A" /> </xs:restriction>
</xs:simpleType>
</xs:attribute>

b.xsd uses it as
--Regular schema stuuf---
<xs:import namespace="http://schemas.mycompany.myproject"
schemaLocation="file:///C:/Program Files/XML/a.xsd"/>
<xs:complexType name="UserA">
<xs:sequence>
<xs:element name="Type" type="xs:token" />
<xs:attribute name="MyTest" type="a:MyTest" />
</xs:complexType>
I get the error "type MyTest is not declared or is not a simple type
xml".

I have researched this for hours and cannot find a soultion .
Any help is greatly appreciated.

Thanks,
Ben


*** Sent via Developersdex http://www.developersdex.com ***
Jan 19 '07 #1
1 3608
"Ben" <no****@devdex.comwrote in message
news:O7**************@TK2MSFTNGP03.phx.gbl...
>
Hi All,
I have 2 XSDs - one with the Types to be used throughout the
application, and one specific to my module (a.xsd & b.xsd)

a.xsd has

<xs:attribute name="MyTest">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="A" /</xs:restriction>
</xs:simpleType>
</xs:attribute>

b.xsd uses it as
--Regular schema stuuf---
<xs:import namespace="http://schemas.mycompany.myproject"
schemaLocation="file:///C:/Program Files/XML/a.xsd"/>
<xs:complexType name="UserA">
<xs:sequence>
<xs:element name="Type" type="xs:token" />
<xs:attribute name="MyTest" type="a:MyTest" />
</xs:complexType>
You want:

<xs:attribute ref="a:MyTest"/>

I don't recall if it also needs the name, but I don't think so. a:MyTest is
the attribute. The simpleType is anonymous.

John
Jan 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RockyH | last post by:
Hello, I'm having a problem when trying to use the XmlReader.Create(nodeReader, settings) method to validate an XML document against a schema. The problem is that if there are multiple missing...
2
by: Sudip Chakraborty | last post by:
Is there a way to see constraint validation errors while loading xml into a DataSet ? I'm interested in the line number in the xml file which is causing the error. I've enclosed the relevant stack...
2
by: Shone | last post by:
I would like to perform a 2-pass XML reading from a stream. Once using the Validating reader, just to confirm the validity against the schema, and next time to do a reading to extract the data....
3
by: Dave | last post by:
Hi, I'm really confused as to how to validate XML fragments against a schema in C#. I am creating XML through an automated process and have an .xsd which was given to me to validate against....
4
by: Igor Koretsky | last post by:
Hi. Using VB.Net System.Xml 1.0 SchemaCollection Object I am getting an error when trying to add ‘Schema A’ to the SchemaCollection. Here are my schema files..
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
7
by: christian.eickhoff | last post by:
Hi Everyone, I am currently implementing an XercesDOMParser to parse an XML file and to validate this file against its XSD Schema file which are both located on my local HD drive. For this...
6
by: lists | last post by:
Hi all, I am trying to validate an XML file against an XSD schema file within a ..NET C++ program, but the validation doesn't seem to be occuring. My code is listed below. The validation...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
0
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 --->...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.