clarin-eric / ParlaMint

ParlaMint: Comparable Parliamentary Corpora
https://clarin-eric.github.io/ParlaMint/
41 stars 52 forks source link

add common content failing, when politicalParty present #683

Closed matyaskopp closed 1 year ago

matyaskopp commented 1 year ago

I do not understand why there is this code, do I am leaving to you to fix this issue

ILLEGAL TEMPLATE USED
Error on line 385 column 34 of parlamint-add-common-content.xsl:
  XTMM9000  Processing terminated by xsl:message at line 385 in parlamint-add-common-content.xsl
  In template rule with match="@*" on line 384 of parlamint-add-common-content.xsl
     invoked by xsl:apply-templates at file:/home/matyas/Documents/UFAL/REP/ParlaMint-clarin-eric/Scripts/parlamint-add-common-content.xsl#922
  In template rule with match="element(Q{http://www.tei-c.org/ns/1.0}org)[xs:string(@role) eq "politicalParty"]" on line 919 of parlamint-add-common-content.xsl
     invoked by xsl:apply-templates at file:/home/matyas/Documents/UFAL/REP/ParlaMint-clarin-eric/Scripts/parlamint-add-common-content.xsl#905
  In template rule with match="element(Q{http://www.tei-c.org/ns/1.0}listOrg)" on line 890 of parlamint-add-common-content.xsl
     invoked by built-in template rule (text-only)
     invoked by xsl:apply-templates at file:/home/matyas/Documents/UFAL/REP/ParlaMint-clarin-eric/Scripts/parlamint-add-common-content.xsl#364
     invoked by xsl:for-each at file:/home/matyas/Documents/UFAL/REP/ParlaMint-clarin-eric/Scripts/parlamint-add-common-content.xsl#357
  In template rule with match="/" on line 354 of parlamint-add-common-content.xsl
Processing terminated by xsl:message at line 385 in parlamint-add-common-content.xsl

the reason for this error is that https://github.com/clarin-eric/ParlaMint/blob/db9eaf51ea3549345a4f095aaac137555d06dd0e/Scripts/parlamint-add-common-content.xsl#L919-L926 attributes @* fails to this template: https://github.com/clarin-eric/ParlaMint/blob/db9eaf51ea3549345a4f095aaac137555d06dd0e/Scripts/parlamint-add-common-content.xsl#L384-L386


and this is also strange - the same template in different a mode: https://github.com/clarin-eric/ParlaMint/blob/53c4c1974152e7ff8e512af24f73460fa5fa055d/Scripts/parlamint-add-common-content.xsl#L788-L796

matyaskopp commented 1 year ago

I hope it is fixed with d5e40e4

TomazErjavec commented 1 year ago

I do not understand why there is this code

Because now every template (except for "/") must be either mode = root or mode = comp. And, yes, you fixed it.

is is also strange - the same template in different a mode

This I don't understand, the example you gave is from an old commit, this is now https://github.com/clarin-eric/ParlaMint/blob/d5e40e4a8a3e95f48df454afeb1c72bea533655c/Scripts/parlamint-add-common-content.xsl#L919-L926

Btw, I think this template (and a few similiar ones) should actually be in parlamint2release.xsl because they fix corpus specific ugs rather than "adding" common content. Would you agree? I can move them.

matyaskopp commented 1 year ago

Btw, I think this template (and a few similiar ones) should actually be in parlamint2release.xsl because they fix corpus specific ugs rather than "adding" common content. Would you agree? I can move them.

Agree, please (re)move these templates