RJP43 / OneWordHistory_CHEAP

This repository will house the research and website development of my final paper/project for the History of the English Language course at Pitt Greensburg. This project intends to analyze the history of a single word - CHEAP!
1 stars 1 forks source link

What am I doing wrong here? #1

Closed RJP43 closed 8 years ago

RJP43 commented 8 years ago

@ebeshero, @djbpitt, @ghbondar could any of you suggest what I am doing wrong here.

This is a sample of the XML (available in entirety here) `

To barter, buy and sell; to trade, deal, bargain.
                 <f name="firstUse">c1000 West Saxon Gospels: Matt. (Corpus Cambr.) xxi. 12</f>
                 <f name="type">intransitive</f>
              </fs>`

I want each <fs> @type value and the corresponding inner <f> elements to appear in a single row so that each row has the <fs> @type value and the <f name="type"> in one table cell (with the <f name="type"> in parenthesis), then the corresponding <f name="definition"> in it's own table cell, and then the corresponding <f name="firstUse"> in it's own table cell.

But right now I am getting all of the <fs> @type values in a single cell, all of the <f name="definition"> in a single cell, and all of the <f name="firstUse"> in a single cell all in one single row.

I would appreciate any help I could get with this, please.

Thanks!

RJP43 commented 8 years ago

maybe the feature structure doesn't really give this data justice... maybe I would be better off just using html tables.. any thoughts @ebeshero @djbpitt ?

ebeshero commented 8 years ago

@RJP43 Don't give up on feature structures! You should be able to use it for anything that you can turn into an HTML table, and associated SVG. I'll take a closer look at your code soon.

ebeshero commented 8 years ago

@RJP43 Okay, if I understand this right, it's a) maybe a problem with how you're coding the feature strucutres, but b) almost certainly a problem with XSLT to transform them to HTML, right? I'll take a look at both now, and comment.

ebeshero commented 8 years ago

@RJP43 I have just been studying your TEI feature structures XML, and I've just been looking at your XSLT. You're on the right track here, I think, but you just need to plot out a plan for your internal elements. I pushed your XSLT back with some comments on where the code isn't outputting what you want, and suggestions for what to do to make it work.

But here is something to think about: Your inner <fs> markup has some redundancies in the way you're working with the @type attribute. For example, you have set up 9 ways for the word "cheap" to be used as a noun (and incidentally, I think this sort of thing is exactly what feature structures markup was designed to store in binding related information together). But notice that each of the 9 ways has the same @type attribute:

<fs type="noun">
               <f name="obsolete">
                     <fs type="cheap" n="1">
                        <f name="definition">A bargain about the bartering or exchanging of one commodity for another, or of giving money or the like for any commodity; bargaining, trade, buying and selling.</f>
                        <f name="firstUse">OE Beowulf 2415</f>
                        <f name="type">simple</f>
                     </fs>
                     <fs type="cheap" n="2">
                        <f name="definition">The place of buying and selling; market.</f>
                        <f name="firstUse">c1000 Ælfric Gram. (Z.) xxxii. 201</f>
                        <f name="type">simple</f>
                     </fs>
                     <fs type="cheap" n="2">
                        <f name="definition">in place-names, as Cheapside, Eastcheap.</f>
                        <f name="firstUse">c1300 K. Alis. 2654</f>
                        <f name="type">simple</f>
                     </fs>
                     <fs type="cheap" n="3">
                        <f name="definition">That which is given in exchange for a commodity; price; value.</f>
                        <f name="firstUse">c1025 Cnut's Eccl. Laws 18 (Bosw.)</f>
                        <f name="type">simple</f>
                     </fs>
                     <fs type="cheap" n="4">
                        <f name="definition">Exchangeable commodities, merchandise, goods, chattels, esp. (live) cattle.</f>
                        <f name="firstUse">897 Anglo-Saxon Chron.</f>
                        <f name="type">simple</f>
                     </fs>
                     <fs type="cheap" n="5">
                        <f name="definition"> Bargain, purchase; qualified from the buyer's point of view as good, great, etc., as in the modern ‘a good bargain’, ‘a great bargain’, ‘a bargain’, etc. Cf. French faire bon marché.</f>
                        <f name="firstUse">1340 Ayenbite (1866) 36</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="6">
                        <f name="definition">State of the market, qualified from the buyer's point of view as good, dear, etc. good cheap: a state of the market good for the purchaser; low prices, abundance of commodities, plenty, cheapness. So dear cheap: a dear market, high prices, dearth, scarcity.</f>
                        <f name="firstUse">c1325 Pol. Songs (Camden) 341</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="6">
                        <f name="definition">Plenty, abundance.</f>
                        <f name="firstUse">c1325 Coer de L. 1897</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="7">
                        <f name="definition">Abundance of commodities, plenty, cheapness; opposed to dearth.</f>
                        <f name="firstUse">c1384 Chaucer Hous of Fame 1974</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="8">
                        <f name="definition">good cheap was used for: That is a good bargain, that can be purchased on advantageous terms; low-priced, cheap. Compared better cheap, best cheap. So (rarely) great cheap. (It is not clear whether the notion was ‘at a good market’, or ‘as a good bargain’.)</f>
                        <f name="type">contextual</f>
                        <f name="firstUse">c1375 Cato Major i. xxix, in Anglia (1884) VII</f>
                     </fs>
                     <fs type="cheap" n="8">
                        <f name="definition">That costs little (trouble, etc.), easily obtained; plentiful, abundant; of small value, ‘cheap’.</f>
                        <f name="firstUse">1340 Ayenbite (1866) 256</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="9">
                        <f name="definition">good cheap was also used (cf. to or at good cheap in sense 5a) for: On advantageous terms, at a low cost, cheaply.</f>
                        <f name="firstUse">1420 Will &amp; Inv. N. Counties (1835) 63</f>
                        <f name="type">contextual</f>
                     </fs>
                     <fs type="cheap" n="9">
                        <f name="definition">On good terms, with little effort; cheaply, easily.</f>
                        <f name="firstUse">1567–9 J. Jewel Def. Apol. Churche Eng. (1611) 461</f>
                        <f name="type">contextual</f>
                     </fs>
               </f>
            </fs>

I don't recommend doing that because you're unnecessarily repeating information. I would instead recommend using @ana on the outer holding <f name="obsolete"> element, and just make it <f name="cheap" ana="obsolete">. Notice that I'm recommending a change to your use of attributes here, and that is because the word itself seems to make more sense as the @name, and @ana (for analytic) is something you could use to differentiate among usages of this name. Does that make sense?

Now, as for your XSLT, you're getting there, and it's complicated. You either need to write more template rules and rearrange your HTML elements (as I suggest in my comment tag in your XSLT), or you need to work with <xsl:for-each> (and again rearrange your HTML elements). You can do this!