Schema Error
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Thu Aug 02, 2012 6:27 pm
Schema Error
Post by nlpalmquist »
I can not seem to get the validation to like the XML/XSD documents
My XML starts:
<?xml version="1.0" encoding="UTF-8" ?>
<MetroBill
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Metrobill.xsd">
My XSD starts:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" >
I get an error that says:
Severity: warning
Description: SchemaLocation: schemaLocation value = 'Metrobill.xsd' must have even number of URI's.
Start location: 4:25
End location: 4:40
I can not figure out what the heck that means. It does not seem that any change I make removes this error.
When I display the .xsd file it shows the message:
Cannot find the declaration of element 'xs:schema' and highlights that in the document.
This could be two different issues but maybe it is the same problem. I would really appreciate any help. I tried have Oxygen generate a new Schema and it is still indicating the same error about the URI's but added an error about the target namespace of a attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'
Any help at all would be greatly appreciated.
My XML starts:
<?xml version="1.0" encoding="UTF-8" ?>
<MetroBill
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Metrobill.xsd">
My XSD starts:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" >
I get an error that says:
Severity: warning
Description: SchemaLocation: schemaLocation value = 'Metrobill.xsd' must have even number of URI's.
Start location: 4:25
End location: 4:40
I can not figure out what the heck that means. It does not seem that any change I make removes this error.
When I display the .xsd file it shows the message:
Cannot find the declaration of element 'xs:schema' and highlights that in the document.
This could be two different issues but maybe it is the same problem. I would really appreciate any help. I tried have Oxygen generate a new Schema and it is still indicating the same error about the URI's but added an error about the target namespace of a attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'
Any help at all would be greatly appreciated.
Re: Schema Error
Hi,
Your schema does not define a target namespace therefore you should use the xsi:noNamespaceSchemaLocation instead of xsi:schemaLocation to associate the schema with the document
If your schema defined a target namespace, let's say http://www.example.com/namespace then you would have associated the schema with the document with something like
that is adding the namespace to the schema location value.
oXygen provides an associate schema action that helps you by automatically inserting the right xsi: attribute and value to associate the selected schema.
Regards,
George
Your schema does not define a target namespace therefore you should use the xsi:noNamespaceSchemaLocation instead of xsi:schemaLocation to associate the schema with the document
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<MetroBill
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Metrobill.xsd">
Code: Select all
xsi:schemaLocation="http://www.example.com/namespace Metrobill.xsd"
oXygen provides an associate schema action that helps you by automatically inserting the right xsi: attribute and value to associate the selected schema.
Regards,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service