M
maxwell
I'm trying to develop a schema, and test it on some sample data.
There are plenty of examples out there on how to develop schemas etc.,
but they all seem to assume that you give a URI for the schema that
points to a web address. For now, I do not have the schema in a web-
accessible place, it's just on the local file system. I'm stuck
trying to specify the xmlns inside the file.
If I have the schema in the same directory as the xml data file, I can
get away with the following first lines in the xml data file (that is,
it passes muster with xmllint)
<?xml version="1.0"?>
<Mo:MorphologicalData xmlns:Mo="Morph.xsd">...
But if I try for more generality--like putting all my schemas in a
single directory somewhere else--I can't seem to pull it off. That
is, if I replace the above couple lines in my xml data file with the
following:
<?xml version="1.0"?>
<Mo:MorphologicalData
xmlns:Mo="file:///home/mmaxwell/Data/LinguisticSchemas/
Morph.xsd">
--then xmllint gives me an error msg:
MorphTestData.xml:4: element MorphologicalData: Schemas validity
error :
Element 'Mo:MorphologicalData': No matching global declaration
available.
(This is on a Linux file system, and I know the .xsd file exists in
the specified directory.)
I tried searching for "file:///" on line to get some examples of how
to do this, but all of the search engines I tried strip off the
":///", even though I quote it, so I get a bunch of irrelevant hits
with the word "file" in them. Just pointing me to some examples would
probably suffice.
Mike Maxwell
There are plenty of examples out there on how to develop schemas etc.,
but they all seem to assume that you give a URI for the schema that
points to a web address. For now, I do not have the schema in a web-
accessible place, it's just on the local file system. I'm stuck
trying to specify the xmlns inside the file.
If I have the schema in the same directory as the xml data file, I can
get away with the following first lines in the xml data file (that is,
it passes muster with xmllint)
<?xml version="1.0"?>
<Mo:MorphologicalData xmlns:Mo="Morph.xsd">...
But if I try for more generality--like putting all my schemas in a
single directory somewhere else--I can't seem to pull it off. That
is, if I replace the above couple lines in my xml data file with the
following:
<?xml version="1.0"?>
<Mo:MorphologicalData
xmlns:Mo="file:///home/mmaxwell/Data/LinguisticSchemas/
Morph.xsd">
--then xmllint gives me an error msg:
MorphTestData.xml> /usr/bin/xmllint --noout --noent --schema Morph.xsd
MorphTestData.xml:4: element MorphologicalData: Schemas validity
error :
Element 'Mo:MorphologicalData': No matching global declaration
available.
(This is on a Linux file system, and I know the .xsd file exists in
the specified directory.)
I tried searching for "file:///" on line to get some examples of how
to do this, but all of the search engines I tried strip off the
":///", even though I quote it, so I get a bunch of irrelevant hits
with the word "file" in them. Just pointing me to some examples would
probably suffice.
Mike Maxwell