[sword-devel] XML attribute delimiters in OSIS files?
DM Smith
dmsmith at crosswire.org
Wed Oct 26 13:52:55 MST 2011
David,
I'm looking at the code and it looks correct. I tested it and find no
problem. Bottom line: Your problem is elsewhere.
Here is the result. (It might wrap, making it ugly.)
Given Troy's recent example,
SWBuf sid = t.getAttribute("sID");
will get the value of the sID attribute and it will not include the
quotation marks, whether single or double.
Later when we compare
SWBuf eid = t.getAttribute("eID");
if (sid == eid) {
they match
} else {
they don't match: complain loudly!!!!
}
I think there is something else going on. I need a good test case.
The simplest one I can think of:
<osis><div type="book" osisID="Gen"><chapter osisID="Gen.1"><verse
osisID="Gen.1.1" sID="Gen.1.1"/>In the beginning...<verse
eID='Gen.1.1'/></chapter></div></osis>
If I'm understanding you, this should not produce a module with Gen 1:1
and will give no error message.
I ran this with full debug on and got the following:
[dmsmith at www utilities]$ ./osis2mod /tmp - -d 1023 <<.
> <osis><div type="book" osisID="Gen"><chapter osisID="Gen.1"><verse
osisID="Gen.1.1" sID="Gen.1.1"/>In the beginning...<verse
eID='Gen.1.1'/></chapter></div></osis>
> .
You are running osis2mod: $Rev: 2659 $
DEBUG(ARGS):
path: /tmp
osisDoc: -
create: 0
compressType:
blockType: 4
cipherKey:
normalize: 1
DEBUG(XFORM): N/A: xform push (1) <osis> (tagname=osis)
DEBUG(XFORM): N/A: xform top(1) <osis>
DEBUG(STACK): N/A: push (1) osis
DEBUG(XFORM): N/A: xform push (2) <div osisID="Gen" sID="gen1"
type="book"/> (tagname=div)
DEBUG(XFORM): N/A: xform top(2) <div osisID="Gen" sID="gen1" type="book"/>
DEBUG(FOUND): Found first div and pitching prior material: <osis>
DEBUG(TITLE): Gen: Looking for book introduction
DEBUG(FOUND): New book is Gen
DEBUG(XFORM): Gen: xform push (3) <chapter osisID="Gen.1" sID="gen2"/>
(tagname=chapter)
DEBUG(XFORM): Gen: xform top(3) <chapter osisID="Gen.1" sID="gen2"/>
DEBUG(TITLE): Gen: BOOK INTRO <div osisID="Gen" sID="gen1" type="book"/>
DEBUG(FOUND): Current chapter is Gen.1 (Gen.1)
DEBUG(TITLE): Gen.1: Looking for chapter introduction
DEBUG(XFORM): Gen.1: xform empty <verse osisID="Gen.1.1" sID="Gen.1.1"/>
DEBUG(FOUND): Entering verse
DEBUG(TITLE): Gen.1: Done looking for chapter introduction
DEBUG(TITLE): Gen.1: CHAPTER INTRO <chapter osisID="Gen.1" sID="gen2"/>
DEBUG(WRITE): Gen:Gen: <div osisID="Gen" sID="gen1" type="book"/>
DEBUG(REF): Copy osisID:Gen.1.1
Member Key Count = 1
contains = Genesis 1:1
DEBUG(FOUND): New current verse is Gen.1.1
DEBUG(FOUND): osisID/annotateRef is adjusted to: Gen.1.1
DEBUG(XFORM): Gen.1.1: xform empty <verse eID="Gen.1.1"/>
DEBUG(WRITE): Gen.1:Gen.1: <chapter osisID="Gen.1" sID="gen2"/>
DEBUG(XFORM): Gen.1.1: xform pop(3) <chapter osisID="Gen.1" sID="gen2"/>
DEBUG(XFORM): Gen.1.1: xform pop(2) <div osisID="Gen" sID="gen1"
type="book"/>
DEBUG(XFORM): Gen.1.1: xform pop(1) <osis>
DEBUG(STACK): Gen.1.1: pop(1) osis
DEBUG(WRITE): Gen.1.1:Gen.1.1: <milestone osisID="Gen.1.1" resp="v"
sID="Gen.1.1"/>In the beginning...<milestone eID="Gen.1.1" resp="v"/>
<chapter eID="gen2" osisID="Gen.1"/> <div eID="gen1" osisID="Gen"
type="book"/>
Here is the content of the module's "/tmp/ot" file:
<milestone type="x-importer" subType="x-osis2mod" n="$Rev: 2659 $"/>
<div osisID="Gen" sID="gen1" type="book"/>
<chapter osisID="Gen.1" sID="gen2"/>
<milestone osisID="Gen.1.1" resp="v" sID="Gen.1.1"/>In the
beginning...<milestone eID="Gen.1.1" resp="v"/> <chapter eID="gen2"
osisID="Gen.1"/> <div eID="gen1" osisID="Gen" type="book"/>
In Him,
DM
On 10/26/2011 06:38 AM, David Haslam wrote:
> Mixing double and single quotes, as per earlier messages in this thread.
>
> Example (minus the chaff):
>
> sID="reference"
> .....
> eID='reference'
>
> But this time for the same verse, just as Chris replied, rather than in
> completely separate OSIS elements.
>
> As this is just an observation, I see no immediate need to give a detailed
> example of what happens to the module.
> To locate the places where I spotted it yesterday would take some time.
>
> Perhaps the most interesting thing is that there was no error message from
> osis2mod.
>
> And I agree with Chris, the OSIS needs fixing first, before using as input
> for osis2mod.
>
> David
>
>
>
>
> --
> View this message in context: http://sword-dev.350566.n4.nabble.com/XML-attribute-delimiters-in-OSIS-files-tp3907261p3940110.html
> Sent from the SWORD Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
More information about the sword-devel
mailing list