Skip to content

Commit

Permalink
lidoTool: fix split path, xslt: fix validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mokko committed Jun 1, 2024
1 parent 04a56ba commit c8b018a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion zml2lido/data/xsl/zml2lido/classificationWrap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<xsl:value-of select="@id"/>
</xsl:message-->
<xsl:comment>Objekttyp für CCC-Portal</xsl:comment>
<lido:classification type="Objekttyp">
<lido:classification lido:type="Objekttyp">
<lido:conceptID lido:encodinganalog="RIA:Objekttyp" lido:source="ObjCategoryVoc" lido:type="local"/>
<lido:term xml:lang="de">
<xsl:value-of select="$objekttypControl"/>
Expand Down
2 changes: 1 addition & 1 deletion zml2lido/data/xsl/zml2lido/event-Zuordnung.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<xsl:variable name="bereich" select="z:vocabularyReference[@name = 'ObjOrgGroupVoc']/z:vocabularyReferenceItem/z:formattedValue"/>
<xsl:variable name="sammlung" select="func:vocmap-control('Bereich',$bereich)"/>

<lido:eventSet lido:sortOrder="30">
<lido:eventSet lido:sortorder="30">
<lido:event>
<lido:eventType>
<lido:conceptID lido:source="LIDO-Terminologie"
Expand Down
5 changes: 3 additions & 2 deletions zml2lido/lidoTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@ def splitLidoSingle(self, *, src: str | Path) -> None:
"""
Create individual files per lido record
"""
# orig = Path.cwd()
orig = Path.cwd()
splitDir = self.outdir / "split"
print(f"split's parent: {self.outdir=}")
# existance of splitDir is a bad criterion, but cant think of a better one
if not splitDir.exists() or self.force: # self.force is True was problematic
print("SPLITLIDO making")
os.chdir(self.script_dir)
os.chdir(self.outdir)
self.saxon(src=src, xsl=xsl["splitLido"], output="o.xml")
os.chdir(orig)
else:
Expand Down
3 changes: 3 additions & 0 deletions zml2lido/relWorksCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def lookup_from_lido_file(self, *, path: Path) -> None:
Should we check that we don't process a lido lvl2 file that has already
been processed?
"""
print(f"relWorksCache: lookup_from_lido_file")
IDs = self._lido_to_ids(path=path)
for mtype, id_int in IDs:
self.lookup_relWork(mtype=mtype, ID=id_int)
Expand Down Expand Up @@ -123,6 +124,7 @@ def load_cache_file(self) -> Path:
Returns the path used for the cache file.
"""
path: Path = self.cache_path
print(f"Loading file cache {self.cache_path}")
if path.exists():
newM = Module(file=path)
self.cache += newM
Expand All @@ -136,6 +138,7 @@ def save(self) -> Path:
Returns the path used for the cache file.
"""
path: Path = self.cache_path
print(f"Saving file cache {self.cache_path}")
self.cache.toFile(path=path)
return path

Expand Down

0 comments on commit c8b018a

Please sign in to comment.