473,766 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing Schema = no element name

Greetings!

I'm trying to import elements declared in the METS and MODS XML Schema
into my own. I've gotten to the point where the xsd validates, but when
I try to validate a document against it, it expects element '' in place
of mets:fileGrp. The same error obtains for mets:structMap if I comment
out the mets:fileGrp code.

Can an insightful person tell me why it will wants '' instead of the
actual Qname I use to identify it?

TIA!
Nick
Relevant markup:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns="http://www.indiana.edu/~eviada"
xmlns:xlink="ht tp://www.w3.org/TR/xlink"
xmlns:mets="htt p://www.loc.gov/METS/"
xmlns:mods="htt p://www.loc.gov/mods/v3"
targetNamespace ="http://www.indiana.edu/~eviada"
elementFormDefa ult="qualified"
attributeFormDe fault="unqualif ied">
<xsd:import namespace="http ://www.loc.gov/METS/"
schemaLocation= "http://www.loc.gov/standards/mets/mets.xsd"/>
<xsd:import namespace="http ://www.loc.gov/mods/v3"
schemaLocation= "http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"/>

<xsd:element name="head" type="headType"/>
<xsd:element name="fileGrpID " type="xsd:strin g"/>
<xsd:element name="fileUriPr efix" type="xsd:strin g"/>
<xsd:element name="collectio nID" type="xsd:strin g"/>
<xsd:element name="collector " type="xsd:strin g"/>
<xsd:element name="relatedSe gments" type="relatedSe gmentsType"/>
<xsd:element name="segment" type="segmentTy pe"/>
<xsd:element name="title" type="xsd:strin g"/>
<xsd:element name="uri" type="xsd:anyUR I"/>

<xsd:complexTyp e name="headType" >
<xsd:sequence >
<xsd:element ref="fileGrpID"/>
<xsd:element ref="fileUriPre fix"/>
<xsd:element ref="collection ID"/>
<xsd:element ref="collector"/>
<xsd:element ref="mets:fileG rp" type="mets:file GrpType"/>
<xsd:element ref="mets:struc tMap" type="mets:stru ctMapType"/>
<xsd:element ref="relatedSeg ments"/>
</xsd:sequence>
</xsd:complexType >

<!-- ... -->

Full URLs can be found:

My xsd file:
http://bl-ldlp-boblee.ads.iu.edu/bul...backSchema.xsd

METS xsd file:
http://www.loc.gov/standards/mets/mets.xsd

XMLSpy generated sample XML file:
http://bl-ldlp-boblee.ads.iu.edu/bullpen/sample4NG.xml
Jul 20 '05 #1
2 2441
You don't say which schema processor you're using, which makes it hard
to respond in detail.

Your schema document is however _not_ valid. For example:

<xsd:element ref="mets:fileG rp" type="mets:file GrpType"/>

is broken -- xsd:element can have _either_ a 'ref' attribute _or_ a
'name' and a 'type' attribute, but you can't mix the two.

So I suggest

a) Getting a better schema processor, i.e. one which reports this
error and
b) removing the 'type' attribute from your mets: references.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2
Henry S. Thompson wrote:

Your schema document is however _not_ valid. For example:

<xsd:element ref="mets:fileG rp" type="mets:file GrpType"/>

is broken -- xsd:element can have _either_ a 'ref' attribute _or_ a
'name' and a 'type' attribute, but you can't mix the two.


Thanks for pointing this out. I'm new to the schema side of XML
processing--I primarily do XSLT.

I've been using XMLSpy write the schema and testing it by having XMLSpy
generate sample XML based on that schema. This is where I came across
the '' element problem. I went back and tried using only the ref
attribute but was getting an error that the schema was not valid on its
own, but might be if part of another...

I think the problem stems from the fact that I was using the imported
fileGrpType in an improper context. I solved this by creating a local
containing element based on the mets:metsType which then holds
mets:fileGrp, etc. I cannot vouch for the accuracy of my interpretation
of the problem, but I do know that I now have a working schema.

Thanks for the advice, HST.
-Nick
Jul 20 '05 #3

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

Similar topics

4
2395
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could generate any of the specific instances. sample schema one: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="base">
1
2237
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse some of these master complex and simple types. This I believe will assist me in transforming between the master schema and the other smaller schemas that contain a subset of the elements in the master schema. I understand that I can import an...
8
2814
by: Poonam | last post by:
Hi, Can some one please help me with (or point me to) a very simple but working code sample that shows how to import XML Schema. I have tried many samples out there on internet but nothing seems to be working. I am trying to import a complex type/simple type element type from an external xml schema. I am using xs:import tag with namespace and schemalocation attributes defined and have also declared xmlns relative to this xml schema. I...
0
1727
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="Loan"> <xs:complexType> <xs:sequence> <xs:element name="Borrower" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="BorrID" use="required">
1
6406
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there should be getRateQuote, and QUOTEREQUEST, etc.
5
5402
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in separate files for ease of maintainability. These schemas are all part of the same namespace. When defining a web service that access more than one of these entities, the wsdl file generated by BEA contains multiple schema elements with the same...
3
3720
by: Sam Alexander | last post by:
Hi Everone, I'm writing a script to import data from an XML file, and this tutorial is really an awesome guide : http://www.kbalertz.com/Q316005/Import.Server.Component.aspx ... problem though is here's a snippet of my XML file: <planets> <sun rise="6:23" set="20:33"/> <moon rise="18:54" set="4:26"/>
5
40943
by: carlpayne1984 | last post by:
Hi all, I'm fairly new to XML, however already I have studied myself stupid without being able to solve this problem. Basically, I have an XML file/Schema about a CD catalog that I've created that I want to combine with an XML/Schema that a friend has created. Both XML files/Schema validate individually. Now comes the tricky part, combining them. I've created a new XML file and schema, called catalog.xml and catalog.xsd. Into the...
0
1660
by: JimP | last post by:
I'm importing XML files into a SQLExpress DB using SQLXML and VB.net 2005. I have a simple *.xsd schema file that is pulling in all attributes from the <Activityelement. It also has a <Headerelement that I'd like to add the 'Run' attribute for each record in the TA_HeaderID field. So, in the example, '879" would be added to each record in the TA_HeaderID field. Schema file... <?xml version="1.0" encoding="utf-8"?>
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8835
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.