当我验证我的compound document (compound.xml)
时,它会向我提供这些特定的授权错误。我正在使用(http://validator.w3.org/check)
**Namespace prefix gr on grant is not defined** - xsi:schemaLocation="http://tutorialone.com/test/grant/ns grant.xsd">
**Namespace prefix gr on title is not defined** - <gr:title>NIH Clinical Cancer Basic Research Grant</gr:title>
大多数元素都会出现这些错误......我无法弄清楚究竟是什么问题!如果你要验证它,你会得到一个上面前缀错误的列表我是新手,并且不知道相当多的数量。为方便起见,我列出了所有文件!
我尝试在 http:// .... 之前添加 gr:但是这不起作用!我看起来非常仔细,但无法确定问题所在。
xsi:schemaLocation="http://tutorialone.com/test/grant/ns grant.xsd"
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Date: 20/3/2015
Filename: compound.xml
Supporting Files: grant.xsd
-->
<gr:grant grantNum="NIHCCC-4481-05" funding="federal"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:crs="http://tutorialone.com/test/grant/ns"
xsi:schemaLocation="http://tutorialone.com/test/grant/ns grant.xsd">
<gr:title>NIH Clinical Cancer Basic Research Grant</gr:title>
<gr:agency>National Institute of Health</gr:agency>
<gr:department>University Hospital Clinical Cancer Center</gr:department>
<gr:summary>
Basic NIH support funding for current and future Phase 1 through Phase 3 cancer clinical trials.
</gr:summary>
<gr:initiated>2006-07-01</gr:initiated>
<gr:expires>2010-06-30</gr:expires>
<gr:coordinator>Alice Walters</gr:coordinator>
<stu:studies xmlns:stu="http://tutorialone.com/test/studies/ns"
xsi:schemaLocation = "http://tutorialone.com/test/studies/ns studies.xsd">
<stu:study studyID="CCC-501-24">
<stu:title>Treatment of Radiation Firbrosis</stu:title>
<stu:summary>
This study is investigating whether two drugs, vitamin E(Alpha-tocopherol), and
Oxpentifylline, may help to heal body tissues damaged by radiotheraphy.
</stu:summary>
<stu:pi>Richard Tunney</stu:pi>
<stu:startDate>15/08/2006</stu:startDate>
<stu:stopDate>22/01/2008</stu:stopDate>
<stu:enrollment>24</stu:enrollment>
<stu:gender>female</stu:gender>
<stu:phase>3</stu:phase>
<stu:site>University Hospital</stu:site>
</stu:study>
<stu:study studyID="CCC-510-43">
<stu:title>Tamoxifen for Early Stage Breast Cancer</stu:title>
<stu:summary>
This study is to discover whether taking Tamoxifen for longer than
five years will reduce the risk of recurrence without additional side effects.
</stu:summary>
<stu:pi>Alice Walters</stu:pi>
<stu:startDate>12/1/2006</stu:startDate>
<stu:stopDate>11/30/2012</stu:stopDate>
<stu:enrollment>100</stu:enrollment>
<stu:gender>female</stu:gender>
<stu:phase>3</stu:phase>
<stu:site>University Hospital</stu:site>
<stu:site>St. Thomas Vianney Hospital</stu:site>
<stu:site>Ohio Cancer Clinic</stu:site>
</stu:study>
<stu:study studyID="CCC-510-48">
<stu:title>Taxoprexin for Advanced Breast Cancer</stu:title>
<stu:summary>
This study seeks to dicover the effacy of of Taxoprexin in treating
advanced stage breast cancer, to determine the side effects of
Taxoprexin, and to determine how quickly the body gets rid of Taxoprexin.
</stu:summary>
<stu:pi>Chandaskar Rao</stu:pi>
<stu:startDate>15/04/2006</stu:startDate>
<stu:stopDate>15/04/2007</stu:stopDate>
<stu:enrollment>15</stu:enrollment>
<stu:gender>female</stu:gender>
<stu:phase>2</stu:phase>
<stu:site>University Hospital</stu:site>
</stu:study>
<stu:study studyID="CCC-425-08">
<stu:title>CT Scanning in Early Stage Testicular Cancer</stu:title>
<stu:summary>
This study tests whether giving CT scans more often will detect
the recurrence of testicular cancer earlier.
</stu:summary>
<stu:pi>Dennis Lehman</stu:pi>
<stu:startDate>15/11/2006</stu:startDate>
<stu:stopDate>14/11/2009</stu:stopDate>
<stu:enrollment>48</stu:enrollment>
<stu:gender>woman</stu:gender>
<stu:phase>3</stu:phase>
<stu:site>University Hospital</stu:site>
<stu:site>Ohio Cancer Clinic</stu:site>
</stu:study>
<stu:study studyID="CCC-805-88">
<stu:title>Chemotheraphy with Cisplatin and Irintecan in Advanced Pancreatic Cancer</stu:title>
<stu:summary>
This study test whether giving patients of combination of chemotheraphy
with Cisplatin and Irinotecan will control the symptons of advanced
pancreatic cancer.
</stu:summary>
<stu:pi>Michael Siudzinski</stu:pi>
<stu:startDate>01/09/2006</stu:startDate>
<stu:stopDate>31/05/2009</stu:stopDate>
<stu:enrollment>12</stu:enrollment>
<stu:gender>all</stu:gender>
<stu:phase>2</stu:phase>
<stu:site>Unversity Hospital</stu:site>
</stu:study>
<stu:study studyID="CCC-718-14">
<stu:title>Encrecolomab in Post-Surgical Colon Cancer</stu:title>
<stu:pi>Linda Sanchez</stu:pi>
<stu:startDate>15/01/2007</stu:startDate>
<stu:stopDate>31/12/2012</stu:stopDate>
<stu:enrollment>1000</stu:enrollment>
<stu:gender>all</stu:gender>
<stu:phase>3</stu:phase>
<stu:site>Univeristy Hospital</stu:site>
<stu:site>Ohio Cancer Clinic</stu:site>
<stu:site>St. Thomas Vianney Hospitstu:al</stu:site>
<stu:site>Midwest Cancer Center</stu:site>
<stu:site>Methodist Hospital</stu:site>
</stu:study>
<stu:study studyID="CCC-330-21">
<stu:title>Cisplatin in the Treatment of Mesothelioma</stu:title>
<stu:summary>
This study examines the effacy of Cisplatin in the treatment of
mesothelioma using a standard randomized clinical trial.
</stu:summary>
<stu:pi>Karen Cho</stu:pi>
<stu:startDate>01/07/2006</stu:startDate>
<stu:stopDate>31/03/2009</stu:stopDate>
<stu:enrollment>240 patients</stu:enrollment>
<stu:gender>all</stu:gender>
<stu:phase>3</stu:phase>
<stu:site>University Hospital</stu:site>
<stu:site>Ohio Cancer Clinic</stu:site>
</stu:study>
</stu:studies>
</gr:grant>
为了让你们更好地了解我的文档,这里有我的xsd文件,用于授予和研究 -
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Author: James Wainwright
Date: 20/3/2015
Filename: grant.xsd
Supporting Files: grant.xml
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://tutorialone.com/test/grant/ns"
targetNamespace="http://tutorialone.com/test/grant/ns"
xmlns:stu="http://tutorialone.com/test/studies/ns"
elementFormDefault="qualified" attributeFormDefault="unqualified" >
<xs:import namespace="http://tutorialone.com/test/grant/ns" schemaLocation="studies.xsd" />
<!-- Elements -->
<xs:element name='agency' type='xs:string' />
<xs:element name='summary' type='xs:string' />
<xs:element name='department' type='xs:string' />
<xs:element name='summary' type='xs:string' />
<xs:element name='initiated' type='xs:date' />
<xs:element name='expires' type='xs:date' />
<xs:element name='coordinator' type='xs:string' />
<!-- Attributes -->
<xs:attribute name='grantNum' type='xs:grantNumFormat' />
<xs:attribute name='funding' type='xs:fundingFormat' />
<!-- Simple Type -->
<xs:simpleType name='grantNumFormat'>
<xs:restriction base='xs:ID'>
<xs:pattern value='[A-Z][A-Z][A-Z][A-Z][A-Z][A-Z][A-Z]-d{4}-d{2}' />
</xs:restriction>
</xs:simpleType>
<!-- Wasn't sure if the DTD would do this or not - So I added this anyway -->
<xs:simpleType name='fundingFormat'>
<xs:restriction base="xs:string">
<xs:enumeration value="federal" />
<xs:enumeration value="state" />
<xs:enumeration value="local" />
<xs:enumeration value="private" />
</xs:restriction>
</xs:simpleType>
<!-- Complex Type -->
<xs:element name="grant"> <!-- 4. declare the complex type -->
<xs:complexType>
<xs:sequence>
<xs:element ref="title" />
<xs:element ref="agency" />
<xs:element ref="department" />
<xs:element ref="summary" />
<xs:element ref="initiated" />
<xs:element ref="expires" />
<xs:element ref="coordinator" />
</xs:sequence>
<xs:attribute ref="grantNum" use="required" />
<xs:attribute ref="funding" use="required" />
</xs:complexType>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Tutorial: 1
Stu ID:
Author: James Wainwright
Date: 20/3/2015
Filename: studies.xsd
Supporting Files: studies.xml
-->
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema"
xmlns="http://tutorialone.com/test/studies/ns"
targetNamespace="http://tutorialone.com/test/studies/ns"
elementFormDefault="qualified" attributeFormDefault="unqualified" >
<xs:attribute name="studyID" type="studyIdType" />
<xs:simpleType name="studyIdType">
<xs:restriction base="xs:ID">
<xs:pattern value="CCC-\d{3}-\d\d" />
</xs:restriction>
</xs:simpleType>
<xs:element name="title" type="xs:string" />
<xs:element name="summary" type="xs:string" />
<xs:element name="pi" type="xs:string" />
<xs:element name="startDate" type="xs:date" />
<xs:element name="stopDate" type="xs:date" />
<xs:element name="site" type="xs:string" />
<xs:element name="enrollment" type="xs:intType" />
<!-- Simple Types -->
<xs:simpleType name="intType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1" />
</xs:restriction>
</xs:simpleType>
<xs:element name="phase" type="xs:phaseRestrict" />
<xs:simpleType name="phaseRestrict">
<xs:restriction base="xs:integer">
<xs:minExclusive value="1" />
<xs:minInclusive value="3" />
</xs:restriction>
</xs:simpleType>
<xs:element name="gender" type="xs:genderRestrict" />
<xs:simpleType name="genderRestrict">
<xs:restriction base="xs:string">
<xs:enumeration value="male" />
<xs:enumeration value="female" />
<xs:enumeration value="all" />
</xs:restriction>
</xs:simpleType>
<!-- Complex types -->
<!-- Main Element sequence -->
<xs:element name="study">
<xs:complexType>
<xs:sequence>
<xs:element ref="title" />
<xs:element ref="summary" minOccurs="0" maxOccurs="unbounded" />
<xs:element ref="pi" />
<xs:element ref="startDate" />
<xs:element ref="stopDate" />
<xs:element ref="enrollment" />
<xs:element ref="gender" />
<xs:element ref="phase" />
<xs:element ref="site" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute ref="studyID" use="required" />
</xs:complexType>
</xs:element>
<!-- Root Element -->
<xs:element name="studies">
<xs:complexType>
<xs:sequence>
<xs:element ref="study" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xsi:schema>
No DOCTYPE found! Checking XML syntax only.
我不确定是否会发生这种情况,因为我已将其指定为XML文档。
答案 0 :(得分:0)
添加此xmlns:gr="http://tutorialone.com/test/grant/ns"
并移除xmlns:crs="http://tutorialone.com/test/grant/ns"
<强>即强>
<gr:grant grantNum="NIHCCC-4481-05" funding="federal"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gr="http://tutorialone.com/test/grant/ns"
xsi:schemaLocation="http://tutorialone.com/test/grant/ns grant.xsd">