[sword-devel] XML Validation Used
Chris Little
chrislit at crosswire.org
Thu Jun 21 19:06:17 MST 2012
On 06/21/2012 05:53 PM, luke wrote:
> Here is the answer to Peter's question,
> I'm using xmllint with osisCore.2.1.1.xsd as my schema. Also about the language I am creating for, it is not yet in the sword project, but I have a local locale here on my computer that I have created. The below output is what comes out when I have left a footnote in only one of the section titles. I noticed that our Bible has 6 section titles with footnotes and that only the 3 that were at the beginning of chapters were getting flagged as invalid. I was able to fix two by moving the footnote to the same word used in the first verse of the chapter. So far I don't have any great solutions for what to do with this footnote from Genesis 40.
>
> As for the multiple verses combined into one, I have removed that from my usfm file and just skipped the verses that follow in the series, but it would be much better if they could be included in the sword module.
>
> $ xmllint --noout --schema http://www.bibletechnologies.net/osisCore.2.1.1.xsd Kit at bS@m at .osis.xml
> Kit at bS@m at .osis.xml:4125: element note: Schemas validity error : Element '{http://www.bibletechnologies.net/2003/OSIS/namespace}note', attribute 'osisID': [facet 'pattern'] The value '!footnote' is not accepted by the pattern '(((\p{L}|\p{N}|_)+)((\.(\p{L}|\p{N}|_)+)*)?:)?((\p{L}|\p{N}|_|(\\[^\s]))+)((\.(\p{L}|\p{N}|_|(\\[^\s]))+)*)?(!((\p{L}|\p{N}|_|(\\[^\s]))+)((\.(\p{L}|\p{N}|_|(\\[^\s]))+)*)?)?'.
> Kit at bS@m at .osis.xml:4125: element note: Schemas validity error : Element '{http://www.bibletechnologies.net/2003/OSIS/namespace}note', attribute 'osisID': '!footnote' is not a valid value of the atomic type '{http://www.bibletechnologies.net/2003/OSIS/namespace}osisIDRegex'.
> KitabS at m@.osis.xml:4125: element note: Schemas validity error : Element '{http://www.bibletechnologies.net/2003/OSIS/namespace}note', attribute 'osisID': '!footnote' is not a valid value of the list type '{http://www.bibletechnologies.net/2003/OSIS/namespace}osisIDType'.
> Kit at bS@m at .osis.xml fails to validate
Like Peter said, there's nothing illegal about the particular hierarchy
of elements you were using. It's important to read the errors your
validator reports and confirm that what you guess is the problem is
actually what the validator is reporting.
Above, xmllint is telling you that the osisID attribute has an invalid
value: "!footnote". There's no problem with notes in titles, but
"!footnote" is definitely not a permitted osisID. I would guess you're
generating footnote osisIDs based on the osisID of the parent node and
your titles have no osisID, so ""+"!footnote" results in this illegal
osisID. Fix the script to generate, e.g., "Gen.40!footnote" and it
should work fine.
There's nothing inherently problematic about combined verses, either. If
you have trouble interpreting the error message, we can probably
identify the problem if you post the error and the offending chunk of XML.
> @ used above in order to avoid Google.
>
> Last of all, I am not able to use the perl file to fix titles. This is the command I'm trying to use and the error that comes up:
>
> perl title_cleanup.pl Kit at bS@m at .osis.xml
> Can't locate XML/LibXML.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at title_cleanup.pl line 41.
> BEGIN failed--compilation aborted at title_cleanup.pl line 41.
>
> What package might I be missing? I installed the perl library for working with xml data, but the error persists.
XML::LibXML appears to be the necessary library. In Ubuntu (& presumably
many other distros) it's the libxml-libxml-perl package.
--Chris
More information about the sword-devel
mailing list